From 3c993ab15048c87d9dbf293e583c1e32ac4c6e01 Mon Sep 17 00:00:00 2001 From: cedoor Date: Wed, 13 Mar 2024 16:36:15 +0000 Subject: [PATCH] chore: update release workflow to auto-publish npm packages re #698 Former-commit-id: 38d434083f6653084f2d0deed5fffd8b27c9ccd3 --- .github/workflows/release.yml | 12 ++++++++++++ README.md | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d2d89c28..11937278 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,10 +22,22 @@ jobs: with: node-version: 20 cache: yarn + registry-url: "https://registry.npmjs.org" + + - name: Authentication + run: | + echo npmAuthToken: "$NODE_AUTH_TOKEN" >> ./.yarnrc.yml + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Install dependencies run: yarn + - name: Publish packages + run: yarn version:publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - run: yarn version:release env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/README.md b/README.md index ae555879..8bdb0d47 100644 --- a/README.md +++ b/README.md @@ -379,3 +379,15 @@ yarn docs ``` The output will be placed on the `docs` folder. + +### Releases + +Bump a new version with: + +```bash +yarn version:bump +# e.g. yarn version:bump 2.0.0 +``` + +It will create a commit and a git tag that will need to pushed on the main branch. A workflow will be triggered and will +publish the Semaphore packages on [npm](https://www.npmjs.com/) and release a new version on Github with its changelogs automatically.