⏰ Scheduled nightly build #909
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 builds | |
| run-name: | | |
| ${{ github.event_name == 'schedule' && '⏰ Scheduled nightly build' || '' }} | |
| ${{ github.event_name == 'workflow_dispatch' && '👷 Triggered nightly build' || '' }} | |
| # Create nightly builds at the end of every day | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| # This can be used to allow manually triggering nightlies from the web interface | |
| workflow_dispatch: | |
| inputs: | |
| forceRun: | |
| type: boolean | |
| description: Force build and publish nightly packages to GitHub | |
| default: false | |
| required: false | |
| jobs: | |
| # Check if latest commit is less than 1 day old | |
| check: | |
| name: 🔀 Check latest commit | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_run: ${{ steps.check_latest_commit.outputs.code_changes_since_yesterday }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| id: checkout | |
| - name: ⬇ Check if latest commit is less than 1 day old | |
| id: check_latest_commit | |
| continue-on-error: true | |
| run: | | |
| if [[ -n "$(git rev-list --after="24 hours" ${{ steps.checkout.outputs.commit }})" ]]; then | |
| echo "code_changes_since_yesterday=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "code_changes_since_yesterday=false" >> $GITHUB_OUTPUT | |
| fi | |
| # Build Debian Bullseye Artifacts | |
| linux: | |
| name: 🐧 Debian Bullseye | |
| if: ${{ needs.check.outputs.should_run == 'true' || inputs.forceRun }} | |
| needs: [check] | |
| uses: ./.github/workflows/debian.yml | |
| secrets: inherit | |
| with: | |
| codename: 'bullseye' | |
| publish: true | |
| nightly: true | |
| # Build macOS Artifacts | |
| macos: | |
| name: 🍏 macOS | |
| if: ${{ needs.check.outputs.should_run == 'true' || inputs.forceRun }} | |
| needs: [check] | |
| uses: ./.github/workflows/macos.yml | |
| secrets: inherit | |
| with: | |
| publish: true | |
| nightly: true | |
| # Build Windows Artifacts | |
| windows: | |
| name: 🪟 Windows | |
| if: ${{ needs.check.outputs.should_run == 'true' || inputs.forceRun }} | |
| needs: [check] | |
| uses: ./.github/workflows/windows.yml | |
| secrets: inherit | |
| with: | |
| publish: true | |
| nightly: true | |
| # Publish to GitHub | |
| nightly: | |
| name: 🚀 Publish to GitHub | |
| if: ${{ needs.check.outputs.should_run == 'true' || inputs.forceRun }} | |
| needs: [check, linux, macos, windows] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: 💾 Download artifacts | |
| uses: actions/download-artifact@v5 | |
| with: | |
| pattern: artifact-* | |
| merge-multiple: true | |
| - name: 📑 Read nightly template | |
| uses: markpatterson27/markdown-to-output@v1 | |
| id: nightly_template | |
| with: | |
| filepath: ./.github/nightly.md | |
| - name: 📦 Upload Nightly builds | |
| uses: andelf/nightly-release@main | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: nightly | |
| name: 'Nightly build $$' | |
| prerelease: true | |
| body: ${{ steps.nightly_template.outputs.body }} | |
| files: | | |
| *.deb | |
| *.tar.gz | |
| *.exe | |
| *.zip | |
| *.dmg | |
| - name: 🧹 Cleanup | |
| uses: geekyeggo/delete-artifact@v5 | |
| with: | |
| name: artifact-* | |
| failOnError: false |