Skip to content

Commit

Permalink
multiversion release setup
Browse files Browse the repository at this point in the history
  • Loading branch information
rfresh2 committed Jan 30, 2025
1 parent 0ed47d0 commit 3e5c88d
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 13 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,13 @@ jobs:

- name: Build Plugin
run: ./gradlew build

- name: Get Version
run: echo "PLUGIN_VERSION=$(./gradlew -q getPluginVersion)" >> $GITHUB_ENV

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ContainerTweaks-${{ env.PLUGIN_VERSION }}
path: build/libs/*.jar
if-no-files-found: error
25 changes: 18 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,22 @@ jobs:
- name: Build Plugin
run: ./gradlew build

- name: Release Artifact
uses: "marvinpinto/action-automatic-releases@latest"
- name: Get Version
run: echo "PLUGIN_VERSION=$(./gradlew -q getPluginVersion)" >> $GITHUB_ENV

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ContainerTweaks-${{ env.PLUGIN_VERSION }}
path: build/libs/*.jar
if-no-files-found: error

- name: Github Release
uses: ncipollo/release-action@v1
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ github.ref_name }}"
prerelease: false
files: |
build/libs/ContainerTweaks-rusherhack-*.jar
tag: ${{ env.PLUGIN_VERSION }}
commit: mainline
artifacts: "build/libs/ContainerTweaks-*.jar"
allowUpdates: true
makeLatest: true
omitBodyDuringUpdate: true
10 changes: 10 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ tasks.register("copyPluginToRunDir", Copy) {
into file("run/rusherhack/plugins")
}

tasks.register("getPluginVersion") {
doLast {
println(project.mod_version)
}
}

loom {
//apply accesswidener from rusherhack-api
for (final def f in zipTree(this.project.configurations.rusherhackApi.singleFile)) {
Expand Down Expand Up @@ -131,6 +137,10 @@ jar {
}
}

remapJar {
archiveVersion = "$project.version+$project.minecraft_version_range"
}


processResources {
inputs.property "mod_version", project.mod_version
Expand Down
5 changes: 3 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ org.gradle.jvmargs=-Xmx1G

#properties
minecraft_version = 1.20.4
mod_version = 1.10
minecraft_version_range = 1.20-1.21.1
mod_version = 1.11
maven_group = ct
archives_base_name = ContainerTweaks-rusherhack
archives_base_name = ContainerTweaks
5 changes: 1 addition & 4 deletions src/main/resources/rusherhack-plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
"1.20.4",
"1.20.6",
"1.21",
"1.21.1",
"1.21.2",
"1.21.3",
"1.21.4"
"1.21.1"
]
}

0 comments on commit 3e5c88d

Please sign in to comment.