-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add in js publishing workflows
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 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,28 @@ | ||
name: Publish dev package | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: build | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: "18.x" | ||
registry-url: "https://registry.npmjs.org" | ||
- run: git config --global user.email "[email protected]" | ||
- run: git config --global user.name "GitHub Action" | ||
- run: yarn | ||
- run: yarn test | ||
- run: yarn build | ||
- run: npm pack --dry-run | ||
- name: Publish dev package to npm | ||
run: yarn publish --access public --tag dev --new-version $(npm run --silent vsn)-$(echo ${GITHUB_SHA} | cut -c1-8) | ||
env: | ||
CI: true | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Publish to npm registry (manual) | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: build | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: "18.x" | ||
registry-url: "https://registry.npmjs.org" | ||
- run: git config --global user.email "[email protected]" | ||
- run: git config --global user.name "GitHub Action" | ||
- run: yarn | ||
- run: yarn test | ||
- run: yarn build | ||
- run: npm pack --dry-run | ||
- name: Publish production package to npm | ||
run: yarn publish --access public --tag latest --new-version $(npm run --silent vsn) | ||
env: | ||
CI: true | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} |