release #15
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: release | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - "*-v*.*.*" | |
| jobs: | |
| release: | |
| permissions: | |
| contents: write | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| lfs: true | |
| - name: Parse tag | |
| id: tag | |
| run: | | |
| TAG="${GITHUB_REF_NAME}" | |
| PACKAGE="${TAG%-v*}" | |
| VERSION="${TAG#"${PACKAGE}-"}" | |
| echo "package=${PACKAGE}" >> "$GITHUB_OUTPUT" | |
| echo "version=${VERSION}" >> "$GITHUB_OUTPUT" | |
| - name: Find previous release tag for this package | |
| id: prev_tag | |
| run: | | |
| PREV=$(git tag --list "${{ steps.tag.outputs.package }}-v*" \ | |
| --sort=-version:refname \ | |
| | grep -v "^${GITHUB_REF_NAME}$" \ | |
| | head -1) | |
| echo "tag=${PREV}" >> "$GITHUB_OUTPUT" | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24.x | |
| - name: Generate release notes | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PACKAGE: ${{ steps.tag.outputs.package }} | |
| CURRENT_TAG: ${{ github.ref_name }} | |
| PREV_TAG: ${{ steps.prev_tag.outputs.tag }} | |
| REPO: ${{ github.repository }} | |
| OUTPUT_FILE: release_notes.md | |
| run: node scripts/generateReleaseNotes.mts | |
| - name: Release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| name: "@pitter-patter/${{ steps.tag.outputs.package }} ${{ steps.tag.outputs.version }}" | |
| body_path: release_notes.md | |
| tag_name: ${{ github.ref_name }} | |
| publish: | |
| permissions: | |
| contents: read | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| lfs: true | |
| - name: Parse tag | |
| id: tag | |
| run: | | |
| TAG="${GITHUB_REF_NAME}" | |
| PACKAGE="${TAG%-v*}" | |
| echo "package=${PACKAGE}" >> "$GITHUB_OUTPUT" | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24.x | |
| - name: Install corepack | |
| run: npm i -g corepack | |
| - name: Install dependencies | |
| run: yarn | |
| - name: Publish to npm | |
| run: yarn workspace @pitter-patter/${{ steps.tag.outputs.package }} npm publish |