Update readme #16
Workflow file for this run
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
name: Publish | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
- 'v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+' | |
- 'v[0-9]+.[0-9]+.[0-9]+-leman.[0-9]+' | |
workflow_dispatch: | |
jobs: | |
get_dist_tag: | |
runs-on: ubuntu-latest | |
outputs: | |
DIST_TAG: ${{ steps.get_tag.outputs.DIST_TAG }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Get the tag name | |
id: get_tag | |
run: | | |
tag=$(echo ${GITHUB_REF/refs\/tags\//} | cut -c 2-) | |
dist_tag=$([[ $tag =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && echo latest || echo "") | |
dist_tag=$([[ $tag =~ ^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$ ]] && echo rc || echo $dist_tag) | |
dist_tag=$([[ $tag =~ ^[0-9]+\.[0-9]+\.[0-9]+-leman\.[0-9]+$ ]] && echo leman || echo $dist_tag) | |
[ -z "$dist_tag" ] && echo "Distribution tag is not set to latest nor to rc nor to leman" && exit 1 | |
echo ::set-output name=DIST_TAG::$dist_tag | |
shell: bash | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
registry-url: 'https://registry.npmjs.org' | |
- name: Publish to npm | |
run: | | |
cd js | |
npm ci | |
npm run pub | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |