Skip to content

Commit

Permalink
Fail GitHub release when Tags Clash (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
TechLord22 authored Jul 13, 2022
1 parent 8ff40e5 commit 26538aa
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/github_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,23 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Get Mod Version
id: get_version
run: echo ::set-output name=version::$(sed -n 's/^modVersion = \(.*\)/\1/p' < gradle.properties*)

- name: Get Previous tag
id: previous_tag
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: ${{ github.repository }}

# 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) }}
uses: actions/github-script@v6
with:
script: core.setFailed("A version bump from ${{ steps.previous_tag.outputs.release }} is required!")

- name: Set up JDK 8
uses: actions/setup-java@v2
with:
Expand All @@ -35,10 +52,6 @@ jobs:
chmod +x gradlew
./gradlew build
- name: Get Mod Version
id: get_version
run: echo ::set-output name=version::$(sed -n 's/^modVersion = \(.*\)/\1/p' < gradle.properties*)

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
Expand Down

0 comments on commit 26538aa

Please sign in to comment.