Skip to content
Open
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
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release

on:
release:
types: [published]

env:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}

Choose a reason for hiding this comment

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

yarn publish expects a NODE_AUTH_TOKEN, not NPM_TOKEN
Change to:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}


permissions:
contents: read

Choose a reason for hiding this comment

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

we may need to change the permission to write, for commit to work

id-token: write

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set Node
uses: actions/setup-node@v3
with:
node-version: '18.x'

Choose a reason for hiding this comment

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

we can add .npmrc to repo or we can add this after line 27:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'


- name: Install
run: yarn

- name: Build
run: |
yarn build

- name: Package Version Bump
run: |
yarn version ${{ github.event.release.tag_name }}

Choose a reason for hiding this comment

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

refer this for syntax: https://classic.yarnpkg.com/lang/en/docs/cli/version/
yarn version --new-version "${{ github.event.release.tag_name }}"


- name: Commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'chore: bump version ${{ github.event.release.tag_name }}'
branch: master

- name: Publish
run: |
yarn publish --tag latest