Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/release-on-npm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release on NPM

on:
push:
tags:
- 'v*.*.*'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be only for tags v2.*.* as you checkout the 2.x branch ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true, we can be more precise to prevent any issues


jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: 2.x

- name: Configure Git
run: |
git config --global user.email ""
git config --global user.name "Symfony"

- name: Extract version from tag
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV

- run: corepack enable
- uses: actions/setup-node@v4
with:
cache: 'yarn'
cache-dependency-path: |
yarn.lock
package.json
src/**/package.json
- run: yarn --immutable

- name: Update version of JS packages
run: yarn workspaces foreach -A version --immediate "${{ env.VERSION }}"

- name: Commit changes
run: |
git add .
git commit -m "Update versions to ${{ env.VERSION }}"

- name: Publish on NPM
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
run: yarn workspaces foreach -A --no-private npm publish --access public --tolerate-republish

- name: Push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: git push origin 2.x
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
nodeLinker: node-modules
npmAuthToken: ${NPM_AUTH_TOKEN-}
Loading