Nightly Beta Releases #11
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 Beta Releases | |
| on: | |
| schedule: | |
| - cron: '5 6 * * *' | |
| workflow_dispatch: | |
| permissions: | |
| actions: write | |
| contents: write | |
| concurrency: | |
| group: nightly-beta-release | |
| cancel-in-progress: false | |
| jobs: | |
| tag: | |
| name: Create beta tag when app changed | |
| runs-on: windows-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Validate planner | |
| shell: pwsh | |
| run: | | |
| ./.github/scripts/Test-WorkflowSyntax.ps1 | |
| ./.github/scripts/Test-NightlyBetaPlan.ps1 | |
| ./.github/scripts/Test-ResolveReleaseBaseTag.ps1 | |
| ./.github/scripts/Test-ReleaseVersionSequence.ps1 | |
| - name: Plan nightly beta | |
| id: plan | |
| shell: pwsh | |
| run: | | |
| git fetch --tags --force | |
| ./.github/scripts/Get-NightlyBetaPlan.ps1 | |
| - name: Report no changes | |
| if: ${{ steps.plan.outputs.has_changes != 'true' }} | |
| shell: pwsh | |
| run: Write-Host "No app changes since the latest release tag." | |
| - name: Create beta tag and dispatch release | |
| if: ${{ steps.plan.outputs.has_changes == 'true' }} | |
| shell: pwsh | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAG_NAME: ${{ steps.plan.outputs.next_tag }} | |
| COMMIT_COUNT: ${{ steps.plan.outputs.commit_count }} | |
| run: | | |
| if ([string]::IsNullOrWhiteSpace($env:GH_TOKEN)) { | |
| throw "GITHUB_TOKEN is required to push and dispatch beta releases." | |
| } | |
| if ([string]::IsNullOrWhiteSpace($env:TAG_NAME)) { | |
| throw "Planner did not return a beta tag." | |
| } | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git tag -a $env:TAG_NAME -m "Handoff nightly beta $env:TAG_NAME" | |
| if ($LASTEXITCODE -ne 0) { throw "Could not create beta tag $env:TAG_NAME" } | |
| $remote = "https://x-access-token:$env:GH_TOKEN@github.com/${{ github.repository }}.git" | |
| git push $remote "refs/tags/$env:TAG_NAME" | |
| if ($LASTEXITCODE -ne 0) { throw "Could not push beta tag $env:TAG_NAME" } | |
| gh workflow run release.yml --repo "${{ github.repository }}" --ref main --field "tag=$env:TAG_NAME" | |
| if ($LASTEXITCODE -ne 0) { throw "Could not dispatch release workflow for $env:TAG_NAME" } | |
| Write-Host "Pushed $env:TAG_NAME for $env:COMMIT_COUNT commit(s)." |