Upgrade MCreator's version #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Java CI with Gradle | |
on: | |
push: | |
branches: [ "*" ] | |
pull_request: | |
branches: [ "*" ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Environment (PR) | |
if: ${{ github.event_name == 'pull_request' }} | |
shell: bash | |
run: | | |
calculatedSha=$(git rev-parse --short ${{ github.event.pull_request.head.sha }}) | |
echo "LAST_COMMIT_SHA=$calculatedSha" >> ${GITHUB_ENV} | |
- name: Setup Environment (Push) | |
if: ${{ github.event_name == 'push' }} | |
shell: bash | |
run: | | |
calculatedSha=$(git rev-parse --short ${{ github.sha }}) | |
echo "LAST_COMMIT_SHA=$calculatedSha" >> ${GITHUB_ENV} | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Set executable | |
shell: bash | |
run: | | |
chmod 777 gradlew | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 | |
with: | |
arguments: build | |
- name: Rename | |
run: mv build/libs/modid-1.0.jar build/libs/genshin-nature-${{ env.LAST_COMMIT_SHA }}.jar | |
- name: Upload JAR file | |
uses: actions/upload-artifact@v3 | |
with: | |
name: genshin-nature-${{ env.LAST_COMMIT_SHA }} | |
path: | | |
build/libs/*.jar | |
!build/libs/*-sources.jar |