Skip to content

Nightly Build

Nightly Build #245

Workflow file for this run

name: Nightly Build
env:
VER_MAJOR: 24
VER_MINOR: 10
VER_PATCH: 1
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@v2
- 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]
steps:
- 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