Skip to content

Commit

Permalink
fix github release action again
Browse files Browse the repository at this point in the history
  • Loading branch information
TechLord22 committed Aug 19, 2022
1 parent 37a4a11 commit bc23dd5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/curseforge_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:

- name: Get Mod Version
id: get_version
run: echo ::set-output name=version::$(./gradlew getVersionFromJava --q)

- name: Get Mod Version without Extra
id: get_version_no_extra
run: echo ::set-output name=version::$(./gradlew getVersionFromJavaNoExtra --q)

- name: Retrieve Jar from Latest Release
Expand All @@ -34,7 +38,7 @@ jobs:
game_versions: "Minecraft 1.12:1.12.2,Java 8,Forge"
game_endpoint: "minecraft"
release_type: "release"
changelog: "Changelog is available [here](https://github.com/${{ github.repository }}/releases/tag/v${{ steps.get_version.outputs.version }})."
changelog: "Changelog is available [here](https://github.com/${{ github.repository }}/releases/tag/v${{ steps.get_version_no_extra.outputs.version }})."
changelog_type: "markdown"
relations: "codechicken-lib-1-8:requiredDependency,gregtechce:incompatible,gregtech-chill-edition:incompatible"
file_path: "$gregtech-1.12.2-${{ steps.get_version.outputs.version }}.jar"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/github_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v3

- name: Get Mod Version
id: get_version
id: get_version_no_extra
run: echo ::set-output name=version::$(./gradlew getVersionFromJavaNoExtra --q)

- name: Get Previous tag
Expand All @@ -32,7 +32,7 @@ jobs:

# exit CI early as a failure if creating this release clashes with the previous version
- name: Check if Version Bump is Needed
if: ${{ format('v{0}', steps.get_version.outputs.version) == (steps.previous_tag.outputs.release) }}
if: ${{ format('v{0}', steps.get_version_no_extra.outputs.version) == (steps.previous_tag.outputs.release) }}
uses: actions/github-script@v6
with:
script: core.setFailed("A version bump from ${{ steps.previous_tag.outputs.release }} is required!")
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.get_version.outputs.version }}
tag_name: v${{ steps.get_version_no_extra.outputs.version }}
files: build/libs/*.jar
body: "**${{ github.event.inputs.label }}${{ inputs.hotfix && ' (HOTFIX)' || '' }}**\n"
generate_release_notes: true
6 changes: 6 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ task<Exec>("getVersionFromJavaNoExtra") {
commandLine("echo", getVersionFromJavaNoExtra(file("src/main/java/gregtech/GregTechVersion.java")))
}


// used for GitHub Actions CI releases
task<Exec>("getVersionFromJava") {
commandLine("echo", getVersionFromJava(file("src/main/java/gregtech/GregTechVersion.java")))
}

fun getVersionFromJava(file: File): String {
var version = getVersionFromJavaNoExtra(file)
var extra = ""
Expand Down

0 comments on commit bc23dd5

Please sign in to comment.