-
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/3.0.1' into main
- Loading branch information
Showing
4 changed files
with
60 additions
and
13 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,54 @@ | ||
name: Publish NPM package | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set tag | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Get npm cache directory | ||
id: npm-cache-dir | ||
shell: bash | ||
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | ||
|
||
- uses: actions/cache@v3 | ||
id: npm-cache | ||
with: | ||
path: ${{ steps.npm-cache-dir.outputs.dir }} | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Install NPM dependencies | ||
if: steps.npm-cache.outputs.cache-hit != 'true' | ||
run: npm install | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Prep .npmrc for publishing | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_ACCESS_TOKEN }}" >> ~/.npmrc | ||
echo "registry=https://registry.npmjs.org/" >> ~/.npmrc | ||
echo "always-auth=true" >> ~/.npmrc | ||
- name: Publish NPM package | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} | ||
run: | | ||
npm pkg set version="${{ env.RELEASE_VERSION }}" | ||
npm publish |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Release | ||
name: Release on GitHub | ||
|
||
on: | ||
push: | ||
|
@@ -40,17 +40,6 @@ jobs: | |
- name: Build | ||
run: npm run build | ||
|
||
- name: Prep .npmrc for publishing | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=${NPM_ACCESS_TOKEN}" >> ~/.npmrc | ||
echo "registry=https://registry.npmjs.org/" >> ~/.npmrc | ||
echo "always-auth=true" >> ~/.npmrc | ||
- name: Publish NPM package | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} | ||
run: npm publish | ||
|
||
- uses: montudor/[email protected] | ||
if: (!startsWith(github.ref, 'refs/heads/release') && !startsWith(github.ref, 'refs/heads/hotfix')) | ||
with: | ||
|
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
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