publish #84
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 | |
on: | |
workflow_dispatch: # manually run | |
inputs: | |
packages: | |
description: 'Comma-separated list of packages to publish' | |
required: true | |
default: '*' | |
graduate: | |
description: 'Graduate from prerelease' | |
required: false | |
default: 'false' | |
releaseTag: | |
description: 'Tag the release (next, latest)' | |
required: false | |
default: 'next' | |
env: | |
CI: true | |
jobs: | |
publish: | |
name: Publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Authenticate with Registry | |
run: | | |
yarn logout | |
echo "always-auth=true" > .npmrc | |
echo "@joystream:registry=https://registry.npmjs.org/" >> .npmrc | |
echo "registry=https://registry.npmjs.org/" >> .npmrc | |
echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" >> .npmrc | |
npm whoami | |
env: | |
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
- name: Install | |
run: | | |
yarn install --frozen-lockfile | |
git config --global user.name 'github-actions' | |
git config --global user.email 'github-actions@github.com' | |
- name: Lerna graduate and publish | |
if: github.event.inputs.graduate == 'true' | |
run: | | |
yarn lerna version --conventional-commits --conventional-graduate '${{ github.event.inputs.packages }}' --yes | |
yarn lerna publish from-git --dist-tag $RELEASE_TAG --yes --conventional-commits | |
env: | |
RELEASE_TAG: ${{ github.event.inputs.releaseTag }} | |
- name: Lerna publish current package | |
if: github.event.inputs.graduate == 'false' | |
run: | | |
yarn lerna publish from-package --dist-tag $RELEASE_TAG --yes --conventional-commits --conventional-prerelease '${{ github.event.inputs.packages }}' | |
env: | |
RELEASE_TAG: ${{ github.event.inputs.releaseTag }} |