Promote Release #2
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: Promote Release | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| promote-release: | |
| name: Promote RC to Official Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| fetch-depth: 0 | |
| - name: Find latest rc release | |
| id: version | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| RC_TAG=$(gh release list --json tagName,isPrerelease \ | |
| --jq '[.[] | select(.isPrerelease == true) | .tagName | select(test("^v[0-9]+\\.[0-9]+\\.[0-9]+-rc\\.[0-9]+$"))] | .[0] // empty') | |
| if [ -z "$RC_TAG" ]; then | |
| echo "Error: No rc releases found" | |
| exit 1 | |
| fi | |
| OFFICIAL="${RC_TAG%-rc.*}" | |
| echo "rc_tag=$RC_TAG" >> $GITHUB_OUTPUT | |
| echo "official=$OFFICIAL" >> $GITHUB_OUTPUT | |
| echo "Promoting $RC_TAG -> $OFFICIAL" | |
| - name: Create and push tag | |
| run: | | |
| OFFICIAL="${{ steps.version.outputs.official }}" | |
| git tag "$OFFICIAL" | |
| git push origin "$OFFICIAL" | |
| - name: Create official release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| OFFICIAL="${{ steps.version.outputs.official }}" | |
| gh release create "$OFFICIAL" \ | |
| --title "$OFFICIAL" \ | |
| --generate-notes \ | |
| --latest |