-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add auto release job for NPM (JS) package (#82)
- Loading branch information
Showing
3 changed files
with
4,276 additions
and
2,066 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
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 }} |
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
Oops, something went wrong.