Skip to content

publish

publish #84

Workflow file for this run

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 }}