Skip to content

Package ver fixes (#48) #43

Package ver fixes (#48)

Package ver fixes (#48) #43

Workflow file for this run

name: 'Publish alpha release'
on:
push:
branches:
- main
jobs:
publish:
name: Publish to NPM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 22
registry-url: https://registry.npmjs.org/
- name: Set hash and version variable
# To generate unique hashes for each alpha release without having to change version in package.json
run: |
echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "VERSION=$(npm view ./ version)" >> $GITHUB_ENV
echo "RELEASE_VERSION=$(npm view ./ version)-alpha.$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Build package
run: |
npm ci
npm run build:alpha
- name: Publish package
run: |
npm version ${{ env.RELEASE_VERSION }} --no-git-tag-version
npm publish --tag alpha --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}