Nightly Build #1
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: Nightly Build | |
| on: | |
| schedule: | |
| - cron: '0 20 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Validate Gradle wrapper | |
| uses: gradle/actions/wrapper-validation@v4 | |
| - name: Setup JDK 25 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '25' | |
| distribution: 'zulu' | |
| - name: Make Gradle wrapper executable | |
| run: chmod +x ./gradlew | |
| - name: Build | |
| run: ./gradlew build | |
| - name: Get current date | |
| run: | | |
| echo "BUILD_TIME=$(TZ='Asia/Shanghai' date +'%Y-%m-%d %H:%M')" >> $GITHUB_ENV | |
| - name: Upload NeoForge Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: neoforge-artifacts | |
| path: neoforge/build/libs/*.jar | |
| if-no-files-found: warn | |
| - name: Upload Fabric Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: fabric-artifacts | |
| path: fabric/build/libs/*.jar | |
| if-no-files-found: warn | |
| - uses: "marvinpinto/action-automatic-releases@latest" | |
| if: ${{ runner.os == 'Linux' }} | |
| with: | |
| repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
| automatic_release_tag: "nightly" | |
| title: "Nightly Build (${{ env.BUILD_TIME }})" | |
| prerelease: true | |
| files: | | |
| neoforge/build/libs/*.jar | |
| fabric/build/libs/*.jar |