Skip to content

feat: add auto release job for NPM (JS) package (#82) #1

feat: add auto release job for NPM (JS) package (#82)

feat: add auto release job for NPM (JS) package (#82) #1

Workflow file for this run

name: Release
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./npm
permissions:
contents: write
issues: write
pull-requests: write
environment: NPM
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Install Dependencies
run: npm install
- name: Build Packages
run: npm build
- name: Create Release Pull Request or Publish to NPM
# use changesets/action to create PR and auto release
uses: changesets/action@v1
with:
publish: npm release
commit: "chore(release): publish packages"
title: "Publish packages"
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ github.token }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}