Bump version & publish to NPM #39
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
# trigger only when packages code modified are merged on main branch | |
name: Bump version & publish to NPM | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'packages/next-youtube-livechat/**' | |
workflow_dispatch: {} | |
jobs: | |
release: | |
name: Release | |
if: ${{ github.repository_owner == 'sawaYch' }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # to create release (changesets/action) | |
issues: write # to post issue comments (changesets/action) | |
pull-requests: write # to create pull request (changesets/action) | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Restore dependencies | |
run: npx ci | |
- name: Build the package next-youtube-livechat | |
run: npm run build | |
working-directory: packages/next-youtube-livechat | |
- name: Lint check | |
run: npm run lint | |
working-directory: packages/next-youtube-livechat | |
- name: Code format check | |
run: npm run format | |
working-directory: packages/next-youtube-livechat | |
- name: Typescript check | |
run: npm run typecheck | |
working-directory: packages/next-youtube-livechat | |
- name: Create Release Pull Request or Publish to npm | |
uses: changesets/action@v1 | |
with: | |
publish: npm run release | |
version: npm run version | |
commit: 'chore: new release' | |
title: 'chore: new release candidate' | |
createGithubReleases: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |