-
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.
- Loading branch information
1 parent
2b2d4fa
commit 5db8d2f
Showing
2 changed files
with
45 additions
and
12 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,45 @@ | ||
name: Publish SDK package on NPM | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
wait: | ||
name: "Wait for tests" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Wait for tests to succeed | ||
uses: lewagon/wait-on-check-action@v1.3.4 | ||
with: | ||
ref: ${{ github.ref }} | ||
running-workflow-name: 'Test' | ||
check-regexp: Setup and test.* | ||
publish: | ||
name: Publish | ||
runs-on: ubuntu-latest | ||
needs: wait | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
cache: 'npm' | ||
- name: publish to npm | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_PUBLIC }} | ||
run: | | ||
REG_TAG_PART="v[[:digit:]]+([[:punct:]]+[[:digit:]]){2}" | ||
REG_TAG="^$REG_TAG_PART$" | ||
REG_TAG_ALPHA="^$REG_TAG_PART-alpha[[:punct:]][[:digit:]]+$" | ||
npm ci && npm run build | ||
npm version $BRANCH_NAME | ||
if [[ $BRANCH_NAME =~ $REG_TAG ]]; then | ||
npm publish | ||
elif [[ $BRANCH_NAME =~ $REG_TAG_ALPHA ]]; then | ||
npm publish --tag alpha | ||
else | ||
echo invalid tag name: $BRANCH_NAME | ||
exit 1 | ||
fi |
This file was deleted.
Oops, something went wrong.