Update version (#26) #22
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 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 | |
- name: Build package | |
run: | | |
npm ci | |
npm run build:alpha | |
- name: Publish package | |
run: | | |
npm version ${{ env.VERSION }}-alpha.${{ env.COMMIT_HASH }} --no-git-tag-version | |
npm publish --tag alpha --access public | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |