更新build.yml和publish-mods.yml,升级GitHub Actions到v5 #733
Workflow file for this run
This file contains hidden or 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: Build | |
| on: | |
| push: | |
| paths-ignore: | |
| - .github/** | |
| - .idea/** | |
| - .gitignore | |
| - CHANGELOG.md | |
| - README.md | |
| pull_request: | |
| paths-ignore: | |
| - .github/** | |
| - .idea/** | |
| - .gitignore | |
| - CHANGELOG.md | |
| - README.md | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v5 | |
| - name: Get Java Version | |
| id: java_version | |
| run: echo "version=$(grep '^javaVersion=' gradle.properties | cut -d'=' -f2)" >> $GITHUB_OUTPUT | |
| - name: Setup Java | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: ${{ steps.java_version.outputs.version }} | |
| cache: gradle | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: Grant execute permission to gradlew | |
| run: chmod +x ./gradlew | |
| - name: Run Gradle build | |
| run: ./gradlew build | |
| shell: bash | |
| - uses: actions/upload-artifact@v5 | |
| with: | |
| name: Artifacts | |
| path: build/libs/ |