Skip to content

v0.12.6

v0.12.6 #485

Workflow file for this run

name: Deploy to NPM
on:
release:
types: [published]
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # Required for trusted publishing (OIDC)
steps:
- uses: actions/checkout@v1
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- name: Upgrade npm
run: npm install -g npm@latest
- name: Install packages
if: success() && startsWith(github.ref, 'refs/tags/v')
run: |
npm install
- name: Build and deploy
if: success() && startsWith(github.ref, 'refs/tags/v')
env:
GITHUB_REF_TAG: ${{ github.ref }}
run: |
echo "Extracting version from GITHUB_REF_TAG: $GITHUB_REF_TAG"
export VERSION=$(echo "$GITHUB_REF_TAG" | sed -e "s#^refs/tags/##")
echo "Version is $VERSION"
npm version --no-git-tag-version "${VERSION}"
npm run build
[ $(echo "${VERSION}" | grep rc) ] && echo "publishing with next tag to npm - ${VERSION}" || echo "publishing with latest tag to npm - ${VERSION}"
[ $(echo "${VERSION}" | grep rc) ] && npm publish --access public --tag next --provenance || npm publish --access public --provenance
echo "Published to npm registry"
tar -cvzf /tmp/dist.tar.gz dist/
- name: Create artifacts
if: success() && startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@master
with:
name: dist.tar.gz
path: /tmp/dist.tar.gz