ci: added git commit short reference

Signed-off-by: moonleay <contact@moonleay.net>
This commit is contained in:
moonleay 2024-05-08 01:07:12 +02:00
parent 714976cd74
commit 0d775f1252
Signed by: moonleay
GPG key ID: 82667543CCD715FB
2 changed files with 18 additions and 3 deletions

View file

@ -8,6 +8,13 @@ jobs:
- uses: actions/checkout@v3
name: Checkout
- name: Set short git commit reference
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Check outputs
run: echo
- uses: https://github.com/actions/setup-java@v4
name: Setup Java
with:
@ -16,18 +23,26 @@ jobs:
- uses: https://github.com/gradle/actions/setup-gradle@v3
name: Setup Gradle
env:
GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }}
- run: ./gradlew runDatagen
name: Generate assets
env:
GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }}
- run: ./gradlew build
name: Build project
env:
GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }}
- run: ./gradlew publish
name: Upload
env:
GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }}
PACKAGE_REPO_KEY: ${{ secrets.PACKAGE_REPO_KEY }}
- run: ./gradlew modrinth
name: Publish to Modrinth
env:
GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}