Nightly Build #445
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: Nightly Build | |
| env: | |
| VER_MAJOR: 25 | |
| VER_MINOR: 4 | |
| VER_PATCH: 0 | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| workflow_dispatch: | |
| jobs: | |
| # https://stackoverflow.com/questions/63014786/how-to-schedule-a-github-actions-nightly-build-but-run-it-only-when-there-where | |
| check_date: | |
| runs-on: ubuntu-latest | |
| name: Check latest commit | |
| outputs: | |
| should_run: ${{ steps.should_run.outputs.should_run }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: print latest_commit | |
| run: echo ${{ github.sha }} | |
| - id: should_run | |
| continue-on-error: true | |
| name: check latest commit is less than a day | |
| if: ${{ github.event_name == 'schedule' }} | |
| run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false" | |
| nightly-build: | |
| needs: check_date | |
| if: ${{ needs.check_date.outputs.should_run != 'false' }} | |
| uses: ./.github/workflows/ci.yml | |
| with: | |
| nightly: true | |
| code-signing: | |
| needs: [nightly-build] | |
| uses: ./.github/workflows/code-signing.yml | |
| with: | |
| signing-policy-slug: test-signing | |
| github-artifact-id: ${{ needs.nightly-build.outputs.unsigned-artifact-id }} | |
| secrets: | |
| api-token: ${{ secrets.SIGNPATH_API_TOKEN }} | |
| nightly-release: | |
| runs-on: ubuntu-latest | |
| name: Nightly Release | |
| if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} | |
| needs: [code-signing] | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download Installer Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: Installer Artifact | |
| path: build/installer | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: Signed Installer | |
| path: dist | |
| - name: Upload Nightly Release | |
| uses: andelf/nightly-release@46e2d5f80828ecc5c2c3c819eb31186a7cf2156c # main | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: nightly | |
| prerelease: true | |
| name: 最新測試版 ${{env.VER_MAJOR}}.${{env.VER_MINOR}}.${{env.VER_PATCH}}.${{github.run_number}} | |
| body: | | |
| 這是開發中的測試用版本。若不確定,請使用最新的穩定版。 | |
| files: | | |
| dist/windows-chewing-tsf.msi | |
| dist/windows-chewing-tsf.msi.sha256 | |
| build/installer/chewing-editor.exe | |
| installer/windows-chewing-tsf-debug.bat |