chore: cut CHANGELOG for v0.2.0 release #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
| # Release workflow — runs on tag push (v*). | |
| # | |
| # Composer packages on Packagist auto-sync from the configured Git repository, | |
| # so this workflow's primary job is to (1) re-run the CI gates on the tagged | |
| # commit and (2) create a GitHub release pointing at the changelog entry. | |
| # | |
| # Packagist Trusted Publishing (OIDC) is TBD pending an audit of Packagist's | |
| # OIDC support relative to fs-packages' npm Trusted Publishing setup. Until | |
| # then, Packagist relies on the standard repo-webhook auto-update path. | |
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| verify: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: ['8.4'] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup PHP ${{ matrix.php }} | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| coverage: none | |
| tools: composer:v2 | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress --no-interaction | |
| - name: Format check | |
| run: composer format:check | |
| - name: Static analysis | |
| run: composer phpstan | |
| - name: Tests | |
| run: composer test | |
| release: | |
| needs: verify | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Extract changelog for tag | |
| id: changelog | |
| run: | | |
| set -euo pipefail | |
| TAG="${GITHUB_REF#refs/tags/}" | |
| VERSION="${TAG#v}" | |
| awk -v ver="$VERSION" ' | |
| /^## \[/ { | |
| if (found) exit | |
| if ($0 ~ "\\[" ver "\\]") found = 1 | |
| next | |
| } | |
| found { print } | |
| ' CHANGELOG.md > release-notes.md | |
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | |
| - name: Create GitHub release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release create "${{ steps.changelog.outputs.tag }}" \ | |
| --title "${{ steps.changelog.outputs.tag }}" \ | |
| --notes-file release-notes.md |