-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Zondax/ci_npm
Ci publish npm
- Loading branch information
Showing
8 changed files
with
54 additions
and
1 deletion.
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,53 @@ | ||
name: "Publish js packages" | ||
|
||
on: | ||
release: | ||
types: | ||
- created | ||
tags: | ||
- "npm_v[0-9]+(\\.[0-9]+)*" | ||
|
||
jobs: | ||
publish_npm_package: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
- name: Install node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14.17.0' | ||
registry-url: "https://registry.npmjs.org" | ||
scope: "@zondax" | ||
- name: Install yarn | ||
run: npm install -g yarn | ||
- name: Build package | ||
run: | | ||
cd js | ||
yarn install | ||
yarn build | ||
- name: Get latest release version number | ||
id: get_version | ||
uses: battila7/get-version-action@v2 | ||
- name: Show version | ||
run: echo ${{ steps.get_version.outputs.version }} | ||
- name: Clean latest release version number | ||
id: get_version_cleaned | ||
uses: bhowell2/github-substring-action@v1 | ||
with: | ||
output_name: version | ||
value: ${{ steps.get_version.outputs.version }} | ||
index_of_str: "npm_" | ||
- name: Update tag | ||
run: | | ||
cd js | ||
echo Publishing as ${{ steps.get_version_cleaned.outputs.version }} | ||
npm --allow-same-version --no-git-tag-version version ${{ steps.get_version_cleaned.outputs.version }} | ||
- name: Publish package | ||
run: | | ||
cd js | ||
npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_PUBLISH_AUTO }} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.