chore: bump the npm_and_yarn group with 2 updates #57
Workflow file for this run
This file contains 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: Create Tag and Publish Package | |
on: | |
pull_request: | |
branches: | |
- main | |
types: | |
- closed | |
permissions: | |
contents: write | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NODE_VERSION: 20.13.1 | |
jobs: | |
tag-and-publish-package: | |
name: Create Tag and Publish Package | |
runs-on: ubuntu-latest | |
# Only run this job if an actual publishing should be made | |
if: ${{ (github.event.pull_request.merged == true) && | |
(startsWith(github.event.pull_request.head.ref, 'release/')) && | |
(contains(github.event.pull_request.labels.*.name, 'release')) }} | |
steps: | |
- name: Extract package from head ref | |
id: extract_package | |
# yamllint disable-line rule:line-length | |
run: echo "package=$(echo ${{ github.event.pull_request.head.ref }} | grep -oP '(?<=release/)[^@]+(?=@)')" >> "$GITHUB_OUTPUT" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
filter: 'blob:none' | |
fetch-depth: 0 | |
fetch-tags: true | |
- name: Configure git User | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
cache: npm | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Install dependencies | |
run: npm ci | |
- name: Create tag | |
run: | | |
npx nx release version \ | |
--projects=${{ steps.extract_package.outputs.package }} \ | |
--git-commit=false \ | |
--git-tag=true | |
- name: Publish package | |
run: | | |
npx nx release publish \ | |
--projects=${{ steps.extract_package.outputs.package }} | |
- name: Push tags | |
run: git push origin --follow-tags |