Skip to content

Update examples and change absolute paths to relative #22

Update examples and change absolute paths to relative

Update examples and change absolute paths to relative #22

name: Release to NPM
on:
workflow_dispatch:
release:
types: [published]
permissions:
contents: read
jobs:
release:
name: Release
runs-on: [self-hosted, Linux, medium, ephemeral]
steps:
- name: Checkout repository
uses: actions/checkout@v3 # pin@v3
- name: Install JQ and SED
run: |
if ! command -v jq >/dev/null 2>&1; then
echo "::group::Setup JQ Command"
sudo apt update
sudo apt install -y jq
echo "::endgroup::"
fi
if ! command -v sed >/dev/null 2>&1; then
echo "::group::Setup SED Command"
sudo apt update
sudo apt install -y sed
echo "::endgroup::"
fi
- name: Verify package version
run: |
PACKAGE_VERSION=$(jq -r .version package.json)
RELEASE_VERSION=$(echo $GITHUB_REF_NAME | sed 's/v\.\|v//')
[[ "$PACKAGE_VERSION" == "$RELEASE_VERSION" ]] && echo "Versions match $RELEASE_VERSION" || (echo "Package version is: $PACKAGE_VERSION and Release tag is: $RELEASE_VERSION"; exit 1)
- name: Setup Node 20
uses: actions/setup-node@v4 # pin@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
- name: Install packages
run: npm ci
- name: Build packages
run: npm run build
- name: Publish to NPM
run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}