-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/manager
- Loading branch information
Showing
17 changed files
with
180 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,11 +28,24 @@ jobs: | |
with: | ||
java-version: 17 | ||
distribution: temurin | ||
- name: Get previous build number | ||
id: getPreviousBuild | ||
run: | | ||
PREVIOUS_TAG=$(git for-each-ref --sort=-version:refname --count 1 --format="%(refname:short)" "refs/tags/*") | ||
echo result=${PREVIOUS_TAG} >> $GITHUB_OUTPUT | ||
- name: Get current build number | ||
id: getCurrentBuild | ||
if: success() | ||
env: | ||
PREVIOUS_BUILD: ${{ steps.getPreviousBuild.outputs.result }} | ||
run: echo result=$((++PREVIOUS_BUILD)) >> $GITHUB_OUTPUT | ||
- name: Build with Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: build | ||
gradle-home-cache-cleanup: true | ||
env: | ||
BUILD_NUMBER: ${{ steps.getCurrentBuild.outputs.result }} | ||
- uses: actions/upload-artifact@v3 | ||
if: success() | ||
with: | ||
|
@@ -45,17 +58,6 @@ jobs: | |
name: MCXboxBroadcastStandalone | ||
path: bootstrap/standalone/build/libs/MCXboxBroadcastStandalone.jar | ||
if-no-files-found: error | ||
- name: Get previous build number | ||
id: getPreviousBuild | ||
run: | | ||
PREVIOUS_TAG=$(git for-each-ref --sort=-version:refname --count 1 --format="%(refname:short)" "refs/tags/*") | ||
echo result=${PREVIOUS_TAG} >> $GITHUB_OUTPUT | ||
- name: Get current build number | ||
id: getCurrentBuild | ||
if: success() | ||
env: | ||
PREVIOUS_BUILD: ${{ steps.getPreviousBuild.outputs.result }} | ||
run: echo result=$((++PREVIOUS_BUILD)) >> $GITHUB_OUTPUT | ||
- name: Bump version and push tag | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...p/geyser/src/main/resources/extension.yml → ...src/main/resource-templates/extension.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
id: mcxboxbroadcast | ||
name: MCXboxBroadcast | ||
version: 1.0 | ||
main: com.rtm516.mcxboxbroadcast.bootstrap.geyser.MCXboxBroadcastExtension | ||
api: "1.0.1" | ||
authors: [ "rtm516" ] | ||
version: {{ version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
build-logic/src/main/kotlin/com.rtm516.mcxboxbroadcast.java-conventions.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import net.kyori.indra.git.IndraGitExtension | ||
|
||
// Modified from https://github.com/GeyserMC/Geyser/blob/ca2312c7f68c54f32314c40c2c1db5d9cda5a0b2/core/build.gradle.kts#L111-L143 | ||
class GitInfo(indraGit: IndraGitExtension) { | ||
val branch: String | ||
val commit: String | ||
val commitAbbrev: String | ||
|
||
val gitVersion: String | ||
val version: String | ||
val buildNumber: Int | ||
|
||
val commitMessage: String | ||
val repository: String | ||
|
||
init { | ||
branch = indraGit.branchName() ?: "DEV" | ||
|
||
val commit = indraGit.commit() | ||
this.commit = commit?.name ?: "0".repeat(40) | ||
commitAbbrev = commit?.name?.substring(0, 7) ?: "0".repeat(7) | ||
|
||
gitVersion = "git-${branch}-${commitAbbrev}" | ||
buildNumber = (System.getenv("BUILD_NUMBER"))?.let { Integer.parseInt(it) } ?: -1 | ||
|
||
if (buildNumber == -1) { | ||
version = "DEV ($gitVersion)" | ||
} else { | ||
version = "build ${buildNumber} ($gitVersion)" | ||
} | ||
|
||
val git = indraGit.git() | ||
commitMessage = git?.commit()?.message ?: "" | ||
repository = git?.repository?.config?.getString("remote", "origin", "url") ?: "" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
core/src/main/java-templates/com/rtm516/mcxboxbroadcast/core/BuildData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.rtm516.mcxboxbroadcast.core; | ||
|
||
// Replaced at compile time by blossom | ||
public class BuildData { | ||
public static final String VERSION = "{{ version }}"; | ||
public static final String GIT_VERSION = "{{ gitVersion }}"; | ||
public static final String BUILD_NUMBER = "{{ buildNumber }}"; | ||
public static final String BRANCH = "{{ branch }}"; | ||
public static final String COMMIT = "{{ commit }}"; | ||
public static final String REPOSITORY = "{{ repository }}"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
core/src/main/java/com/rtm516/mcxboxbroadcast/core/models/friend/BlockRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.rtm516.mcxboxbroadcast.core.models.friend; | ||
|
||
public record BlockRequest (String xuid) { | ||
} |
2 changes: 1 addition & 1 deletion
2
...ast/core/models/FriendModifyResponse.java → ...e/models/friend/FriendModifyResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ast/core/models/FriendStatusResponse.java → ...e/models/friend/FriendStatusResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters