Update BC Artifact Version #56
This file contains 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: Update BC Artifact Version | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '55 5 * * *' # Daily at 05:55 UTC | |
defaults: | |
run: | |
shell: powershell | |
jobs: | |
GetBranches: | |
name: Get Branches | |
runs-on: windows-latest | |
outputs: | |
UpdateBranches: ${{ steps.GetBranches.outputs.UpdateBranches }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get Branches | |
id: GetBranches | |
run: | | |
git fetch | |
$branches = @(git for-each-ref --format="'%(refname:short)'" refs/remotes/origin/releases/ | % { $_ -replace 'origin/', '' }) | |
$branches += "'main'" | |
$branchMatrix = "[$($branches -join ',')]" | |
Write-Host "Updating branches: $branchMatrix" | |
Add-Content -Path $env:GITHUB_OUTPUT -Value "UpdateBranches=$branchMatrix" | |
UpdateBCArtifactVersion: | |
name: "[${{ matrix.branch }}] Update BC Artifact Version" | |
permissions: | |
contents: write | |
environment: Official-Build | |
runs-on: windows-latest | |
needs: GetBranches | |
strategy: | |
matrix: | |
branch: ${{ fromJson(needs.GetBranches.outputs.UpdateBranches) }} | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ matrix.branch }} | |
- name: Update BC Artifact Version | |
env: | |
GH_TOKEN: ${{ secrets.GHTOKENWORKFLOW }} | |
run: | | |
build/scripts/UpdateBCArtifactVersion.ps1 -Repository $ENV:GITHUB_REPOSITORY -TargetBranch ${{ matrix.branch }} -Actor $env:GITHUB_ACTOR |