|
| 1 | +name: Lirael Action CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - "**" |
| 7 | + paths: |
| 8 | + - ".github/workflows/**/**.yml" |
| 9 | + - "lirael-api/**/*" |
| 10 | + - "lirael-server/**/*" |
| 11 | + - "scripts/**/*" |
| 12 | + - "gradle.properties" |
| 13 | + |
| 14 | +jobs: |
| 15 | + build: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + environment: default |
| 18 | + |
| 19 | + steps: |
| 20 | + - name: Checkout Git Repository |
| 21 | + uses: actions/checkout@v6 |
| 22 | + |
| 23 | + - name: Setup Gradle |
| 24 | + uses: gradle/actions/setup-gradle@v5 |
| 25 | + |
| 26 | + - name: Set up JDK |
| 27 | + uses: actions/setup-java@v5 |
| 28 | + with: |
| 29 | + distribution: 'zulu' |
| 30 | + java-version: '21' |
| 31 | + |
| 32 | + - name: Config Git |
| 33 | + run: | |
| 34 | + git config --global user.email "no-reply@github.com" |
| 35 | + git config --global user.name "Github Actions" |
| 36 | +
|
| 37 | + - name: Grant execute permission for gradlew |
| 38 | + run: | |
| 39 | + chmod +x gradlew |
| 40 | +
|
| 41 | + - name: Apply Patches |
| 42 | + run: | |
| 43 | + ./gradlew applyAllPatches |
| 44 | +
|
| 45 | + - name: CreateJar |
| 46 | + run: | |
| 47 | + ./gradlew createMojmapPaperclipJar |
| 48 | +
|
| 49 | + - name : SetENV |
| 50 | + run: | |
| 51 | + sh scripts/SetENV.sh |
| 52 | +
|
| 53 | + - name: Get build info |
| 54 | + id: build-info |
| 55 | + run: | |
| 56 | + BUILD_DATE=$(date -u +'%Y-%m-%d %H:%M:%S UTC') |
| 57 | + echo "build_date=$BUILD_DATE" >> $GITHUB_ENV |
| 58 | + |
| 59 | + - name: Create Release |
| 60 | + if: github.event_name != 'pull_request' |
| 61 | + uses: ncipollo/release-action@v1 |
| 62 | + with: |
| 63 | + tag: ${{ env.tag }} |
| 64 | + name: ${{ env.project_id_b }} ${{ env.mcversion }} - ${{ env.commit_id }} |
| 65 | + body: | |
| 66 | + ### 📦 Version: `${{ env.mcversion }}` | Commit: [${{ env.commit_id }}](https://github.com/${{ github.repository }}/commit/${{ env.commit_id }}) |
| 67 | + [](https://github.com/CoderFrish/${{ env.project_id }}/releases/download/${{ env.tag }}/${{ env.jar }}) |
| 68 | +
|
| 69 | + > This release is automatically built by GitHub Actions. |
| 70 | +
|
| 71 | + #### 📜 Latest Commit Message: |
| 72 | + ${{ env.commit_msg }} |
| 73 | +
|
| 74 | + #### 📊 Build Information: |
| 75 | + - **Build Status**: ✅ Success |
| 76 | + - **Build Date**: ${{ env.build_date }} |
| 77 | + artifacts: ${{ env.jar_dir }} |
| 78 | + generateReleaseNotes: true |
| 79 | + prerelease: ${{ env.pre }} |
| 80 | + makeLatest: ${{ env.make_latest }} |
| 81 | + token: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments