name: Daily Alpha Release # Every day at 00:00 Beijing time (16:00 UTC), build an alpha from the newest # `fix:` / `fix(scope):` commit on main. Nothing is built when that commit is # already in a stable release or already has a published alpha. GitHub may # start scheduled runs some minutes late under load. on: schedule: - cron: "0 16 * * *" workflow_dispatch: inputs: dry_run: description: "Only report which commit and tag would be used" type: boolean default: false permissions: contents: read concurrency: group: alpha-release cancel-in-progress: false jobs: plan: runs-on: ubuntu-latest permissions: contents: write outputs: build: ${{ steps.resolve.outputs.build }} tag: ${{ steps.resolve.outputs.tag }} steps: - uses: actions/checkout@v4 with: ref: main fetch-depth: 0 - name: Find newest fix commit and alpha tag id: resolve env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: pwsh run: ./scripts/resolve-alpha-build.ps1 -Repo $env:GITHUB_REPOSITORY - name: Push alpha tag if: steps.resolve.outputs.build == 'true' && steps.resolve.outputs.new_tag == 'true' && !inputs.dry_run env: TAG: ${{ steps.resolve.outputs.tag }} COMMIT: ${{ steps.resolve.outputs.commit }} shell: pwsh run: | $ErrorActionPreference = 'Stop' # Tags pushed with GITHUB_TOKEN do not trigger the tag-push release run, # so the release job below is the only build for this tag. git tag $env:TAG $env:COMMIT if ($LASTEXITCODE -ne 0) { throw "git tag $env:TAG failed ($LASTEXITCODE)" } git push origin "refs/tags/$env:TAG" if ($LASTEXITCODE -ne 0) { throw "git push refs/tags/$env:TAG failed ($LASTEXITCODE)" } release: needs: plan if: needs.plan.outputs.build == 'true' && !inputs.dry_run permissions: contents: write uses: ./.github/workflows/release.yml with: tag: ${{ needs.plan.outputs.tag }}