调整以修复1.20.1和1.21.1的构建(虽然没内容) #43
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: | |
| branches: [ '**' ] | |
| tags-ignore: [ '**' ] | |
| pull_request: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Java 25 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: zulu | |
| java-version: 25 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Build | |
| run: chmod +x gradlew && ./gradlew build | |
| - name: Read mod version | |
| id: props | |
| run: | | |
| version=$(grep -E '^mod_version' gradle.properties | cut -d'=' -f2 | tr -d ' ') | |
| echo "mod_version=$version" >> "$GITHUB_OUTPUT" | |
| - name: Upload 1.12.2 artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ github.event.repository.name }}-1.12.2-${{ steps.props.outputs.mod_version }} | |
| path: versions/1.12.2/build/libs/*.jar | |
| if-no-files-found: error | |
| - name: Upload 1.20.1 artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ github.event.repository.name }}-1.20.1-${{ steps.props.outputs.mod_version }} | |
| path: versions/1.20.1/build/libs/*.jar | |
| if-no-files-found: error | |
| - name: Upload 1.21.1 artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ github.event.repository.name }}-1.21.1-${{ steps.props.outputs.mod_version }} | |
| path: versions/1.21.1/build/libs/*.jar | |
| if-no-files-found: error |