-
Notifications
You must be signed in to change notification settings - Fork 2
[MS-1505] Add release dashboard promotion workflows #1747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| name: "[Reusable] Update Release Dashboard" | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| environment: | ||
| description: "Target environment: production_ready | delivery_testing | production" | ||
| type: string | ||
| required: true | ||
| version: | ||
| description: "Version name (e.g. 2026.2.0)" | ||
| type: string | ||
| required: true | ||
| apk_url: | ||
| description: "Direct APK download URL" | ||
| type: string | ||
| required: false | ||
| default: "" | ||
| release_url: | ||
| description: "GitHub Release page URL" | ||
| type: string | ||
| required: false | ||
| default: "" | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| concurrency: | ||
| group: update-release-dashboard-gh-pages | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| update: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout gh-pages branch | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| ref: gh-pages | ||
|
|
||
| - name: Update status.json | ||
| env: | ||
| ENVIRONMENT: ${{ inputs.environment }} | ||
| VERSION: ${{ inputs.version }} | ||
| APK_URL: ${{ inputs.apk_url }} | ||
| RELEASE_URL: ${{ inputs.release_url }} | ||
| run: | | ||
| UPDATED_AT="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" | ||
| jq \ | ||
| --arg env "$ENVIRONMENT" \ | ||
| --arg version "$VERSION" \ | ||
| --arg updated_at "$UPDATED_AT" \ | ||
| --arg apk_url "$APK_URL" \ | ||
| --arg release_url "$RELEASE_URL" \ | ||
| '.[$env] = {version: $version, updated_at: $updated_at, apk_url: $apk_url, release_url: $release_url}' \ | ||
| status.json > status.json.tmp | ||
| mv status.json.tmp status.json | ||
|
|
||
| - name: Commit and push | ||
| env: | ||
| ENVIRONMENT: ${{ inputs.environment }} | ||
| VERSION: ${{ inputs.version }} | ||
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| git add status.json | ||
| git diff --cached --quiet && echo "No changes" && exit 0 | ||
| git commit -m "dashboard: update ${ENVIRONMENT} → ${VERSION}" | ||
| git push | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| name: "Sync Release Stage Version Dropdown" | ||
| # Keeps the `version` choice list in update-release-stage.yml in sync with actual | ||
| # GitHub Release tags, since workflow_dispatch choice options must be static and | ||
| # can't be populated dynamically at trigger time. | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
| workflow_dispatch: {} | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| sync: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ github.event.repository.default_branch }} | ||
|
|
||
| - name: Regenerate version list | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| WORKFLOW_FILE=".github/workflows/update-release-stage.yml" | ||
| OPTIONS_FILE="$(mktemp)" | ||
| LIMIT=15 | ||
|
|
||
| # Fetch published (non-draft) release tags, newest first by semantic version. | ||
| gh release list --repo "${{ github.repository }}" --limit 60 \ | ||
| --json tagName,isDraft \ | ||
| --jq '.[] | select(.isDraft==false) | .tagName' \ | ||
| | sed 's/^v//' \ | ||
| | sort -t. -k1,1nr -k2,2nr -k3,3nr \ | ||
| | head -n "$LIMIT" \ | ||
| | sed 's/^/ - /' > "$OPTIONS_FILE" | ||
|
|
||
| # Replace the block between the marker comments with the freshly generated options. | ||
| awk -v optfile="$OPTIONS_FILE" ' | ||
| /# AUTO-GENERATED-VERSIONS-START/ { print; while ((getline line < optfile) > 0) print line; skip=1; next } | ||
| /# AUTO-GENERATED-VERSIONS-END/ { skip=0 } | ||
| skip != 1 { print } | ||
| ' "$WORKFLOW_FILE" > "$WORKFLOW_FILE.tmp" | ||
| mv "$WORKFLOW_FILE.tmp" "$WORKFLOW_FILE" | ||
| rm -f "$OPTIONS_FILE" | ||
|
|
||
| - name: Commit and push | ||
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| git add .github/workflows/update-release-stage.yml | ||
| git diff --cached --quiet && echo "No changes" && exit 0 | ||
| git commit -m "chore: sync release stage version dropdown" | ||
| git push |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| name: "Promote Release Stage" | ||
| # Manually record that a version has reached Beta (Production Ready), Delivery Testing, or Production. | ||
| # Looks up the GitHub Release for that version to find the APK download URL automatically. | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| stage: | ||
| description: "Stage to promote to" | ||
| type: choice | ||
| required: true | ||
| options: | ||
| - production_ready | ||
| - delivery_testing | ||
| - production | ||
| version: | ||
| description: "Version to promote" | ||
| type: choice | ||
| required: true | ||
| options: | ||
| # AUTO-GENERATED-VERSIONS-START (kept in sync by .github/workflows/sync-release-stage-versions.yml) | ||
| - 2026.2.1 | ||
| - 2026.2.0 | ||
| - 2026.1.0 | ||
| - 2025.4.2 | ||
| - 2025.4.0 | ||
| - 2025.3.1 | ||
| - 2025.3.0 | ||
| - 2025.2.1 | ||
| - 2025.2.0 | ||
| - 2025.1.0 | ||
| - 2024.2.2 | ||
| - 2024.2.1 | ||
| - 2024.2.0 | ||
| - 2024.1.5 | ||
| - 2024.1.4 | ||
| # AUTO-GENERATED-VERSIONS-END | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| resolve-release-info: | ||
|
Copilot marked this conversation as resolved.
|
||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| apk_url: ${{ steps.info.outputs.apk_url }} | ||
| release_url: ${{ steps.info.outputs.release_url }} | ||
|
|
||
| steps: | ||
| - name: Resolve GitHub Release info | ||
| id: info | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| VERSION: ${{ inputs.version }} | ||
| run: | | ||
| TAG="v${VERSION}" | ||
| RELEASE_URL="https://github.com/${{ github.repository }}/releases/tag/$TAG" | ||
| echo "release_url=$RELEASE_URL" >> "$GITHUB_OUTPUT" | ||
|
|
||
| APK_URL=$(gh release view "$TAG" \ | ||
| --repo "${{ github.repository }}" \ | ||
| --json assets \ | ||
| --jq '[.assets[] | select(.name | endswith(".apk")) | .browserDownloadUrl] | first // ""' \ | ||
| 2>/dev/null || echo "") | ||
| echo "apk_url=$APK_URL" >> "$GITHUB_OUTPUT" | ||
|
|
||
| update-dashboard: | ||
| needs: resolve-release-info | ||
| uses: ./.github/workflows/reusable-update-dashboard.yml | ||
| with: | ||
| environment: ${{ inputs.stage }} | ||
| version: ${{ inputs.version }} | ||
| apk_url: ${{ needs.resolve-release-info.outputs.apk_url }} | ||
| release_url: ${{ needs.resolve-release-info.outputs.release_url }} | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.