Skip to content

Publish (alpha / beta) #37

Publish (alpha / beta)

Publish (alpha / beta) #37

name: Publish (alpha / beta)
on:
workflow_dispatch:
inputs:
channel:
type: choice
description: NPM channel
options:
- alpha
- beta
permissions:
contents: write
jobs:
publish-npm:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
registry-url: https://registry.npmjs.org/
cache-dependency-path: ./package-lock.json
- run: npx lerna@6 bootstrap
- run: npx lerna@6 run build
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
RELEASE_TAG=v$(node -p "require('./lerna.json').version")
gh release create --prerelease $RELEASE_TAG --target=$GITHUB_SHA --title="$RELEASE_TAG" --generate-notes
- name: Publish to npmjs
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: npx lerna publish from-package --yes --dist-tag ${{ github.event.inputs.channel }} --pre-dist-tag ${{ github.event.inputs.channel }}