v26.08.00 #3
Workflow file for this run
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: Archive C ABI Baseline for Release | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version tag to archive baseline for (e.g., v26.02.00)' | |
| required: true | |
| type: string | |
| jobs: | |
| archive-baseline: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: read | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| with: | |
| persist-credentials: false | |
| - name: Download main baseline artifact | |
| uses: dawidd6/action-download-artifact@8a338493df3d275e4a7a63bcff3b8fe97e51a927 # v19 | |
| with: | |
| name: c-abi-baseline-main | |
| workflow: check-c-abi.yaml | |
| branch: main | |
| path: baseline/ | |
| - name: Archive baseline with release version | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: c-abi-baseline-${{ github.event.release.tag_name || inputs.version }} | |
| path: baseline/c_abi.json.gz | |
| retention-days: 400 # ~13 months | |
| - name: Commit baseline to repository (for long-term storage) | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| # Create a baselines branch if it doesn't exist | |
| git fetch origin baselines:baselines 2>/dev/null || git checkout --orphan baselines | |
| git checkout baselines 2>/dev/null || true | |
| # Copy the baseline file with version name | |
| mkdir -p c-abi-baselines | |
| cp baseline/c_abi.json.gz c-abi-baselines/c_abi_$RELEASE_TAG_NAME.json.gz | |
| # Authenticate for push (persist-credentials is disabled on checkout) | |
| git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | |
| # Commit and push | |
| git add c-abi-baselines/ | |
| git commit -m "Archive C ABI baseline for $RELEASE_TAG_NAME" | |
| git push origin baselines | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| RELEASE_TAG_NAME: ${{ github.event.release.tag_name || inputs.version }} | |
| - name: Create release comment | |
| if: github.event_name == 'release' | |
| uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7 | |
| with: | |
| script: | | |
| const tagName = context.payload.release.tag_name; | |
| github.rest.repos.createCommitComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| commit_sha: context.payload.release.target_commitish, | |
| body: | | |
| `✅ C ABI baseline archived for release ${tagName} | |
| This baseline has been archived from the main branch and will be available for historical reference. | |
| The baseline is stored in: | |
| - Artifact: \`c-abi-baseline-${tagName}\` (available for ~13 months) | |
| - Branch: \`baselines\` (permanent storage)` | |
| }); |