test pr for pkg.pr.new #13
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: Publish Release | |
| on: | |
| pull_request: | |
| types: | |
| - closed | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| # Only run if PR is merged and comes from 'release' branch (from the same repo), or if manually triggered | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| (github.event.pull_request.merged == true && | |
| github.event.pull_request.head.label == 'requestly:release') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - name: Release PR info | |
| if: github.event_name != 'workflow_dispatch' | |
| run: | | |
| echo "π Release PR merged!" | |
| echo "π PR #${{ github.event.number }}" | |
| echo "πΏ Branch: ${{ github.event.pull_request.head.ref }}" | |
| - uses: actions/checkout@v6 | |
| - name: Configure git | |
| run: | | |
| git config user.name "${GITHUB_ACTOR}" | |
| git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| registry-url: 'https://registry.npmjs.org/' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build package | |
| run: npm run build | |
| - name: Get package version | |
| id: package-version | |
| run: echo "current-version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| - name: Extract release notes | |
| id: extract-release-notes | |
| uses: ffurrer2/extract-release-notes@v3 | |
| ############# TAG RELEASE ############## | |
| - name: "Push tag v${{ steps.package-version.outputs.current-version }}" | |
| uses: rickstaa/action-create-tag@v1 | |
| id: tag_version | |
| with: | |
| tag: "v${{ steps.package-version.outputs.current-version }}" | |
| ############# GITHUB RELEASE ############## | |
| - name: Create GitHub Release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: "v${{ steps.package-version.outputs.current-version }}" | |
| name: "v${{ steps.package-version.outputs.current-version }}" | |
| body: ${{ steps.extract-release-notes.outputs.release_notes }} | |
| ############# NPM RELEASE ############## | |
| - name: Publish to NPM | |
| run: npm publish --provenance --access public # Add npm --tag (dist-tag) later | |
| - name: Success notification | |
| run: | | |
| echo "::notice::β Successfully published @requestly/requestly-proxy@${{ steps.package-version.outputs.current-version }}" | |
| echo "" | |
| echo "ββββββββββββββββββββββββββββββββββββββββ" | |
| echo "β¨ Release v${{ steps.package-version.outputs.current-version }} Published!" | |
| echo "ββββββββββββββββββββββββββββββββββββββββ" | |
| echo "" | |
| echo "π¦ NPM Package:" | |
| echo " https://www.npmjs.com/package/@requestly/requestly-proxy" | |
| echo "" | |
| echo "π·οΈ Git Tag:" | |
| echo " v${{ steps.package-version.outputs.current-version }}" | |
| echo "" | |
| echo "π GitHub Release:" | |
| echo " https://github.com/${{ github.repository }}/releases/tag/v${{ steps.package-version.outputs.current-version }}" | |
| echo "" | |
| echo "ββββββββββββββββββββββββββββββββββββββββ" | |