Skip to content

Commit

Permalink
Change the way to shorten sha again
Browse files Browse the repository at this point in the history
This one should work tho
  • Loading branch information
ErdbeerbaerLP authored Jun 10, 2024
1 parent 6f9d29f commit a88d016
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ jobs:
uses: actions/checkout@v4
with:
ref: 'jda5'

- name: Set short git commit SHA
id: vars
run: |
calculatedSha=$(git rev-parse --short ${{ github.sha }})
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
Expand All @@ -30,13 +37,13 @@ jobs:
run: mvn --batch-mode --update-snapshots verify

- name: Rename jar
run: mv target/*-All.jar JMusicBot-${{ github.sha::7 }}.jar
run: mv target/*-All.jar JMusicBot-${{ env.COMMIT_SHORT_SHA }}.jar

- name: Upload jar
uses: actions/upload-artifact@v3
with:
name: jar
path: JMusicBot-${{ github.sha::7 }}.jar
path: JMusicBot-${{ env.COMMIT_SHORT_SHA }}.jar
if-no-files-found: error

create_release:
Expand All @@ -50,6 +57,12 @@ jobs:
ref: 'jda5'
fetch-depth: '0'

- name: Set short git commit SHA
id: vars
run: |
calculatedSha=$(git rev-parse --short ${{ github.sha }})
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
- name: Download a Build Artifact
uses: actions/[email protected]
with:
Expand All @@ -71,8 +84,8 @@ jobs:
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.sha::7 }}
name: Version ${{ github.sha::7 }}
tag: ${{ env.COMMIT_SHORT_SHA }}
name: Version ${{ env.COMMIT_SHORT_SHA }}
draft: true
prerelease: false
artifacts: "*.jar"
Expand All @@ -84,4 +97,4 @@ jobs:
### Setup
https://jmusicbot.com/setup
https://jmusicbot.com/config
# Download: [JMusicBot-${{ github.sha::7 }}.jar](https://github.com/ErdbeerbaerLP/MusicBot/releases/download/${{ github.sha::7 }}/JMusicBot-${{ github.sha::7 }}.jar)
# Download: [JMusicBot-${{ env.COMMIT_SHORT_SHA }}.jar](https://github.com/ErdbeerbaerLP/MusicBot/releases/download/${{ env.COMMIT_SHORT_SHA }}/JMusicBot-${{ env.COMMIT_SHORT_SHA }}.jar)

0 comments on commit a88d016

Please sign in to comment.