chore: version packages (#1762) #210
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: | |
push: | |
branches: | |
- main | |
tags-ignore: | |
- '**' | |
paths-ignore: | |
- '**.md' | |
workflow_dispatch: | |
jobs: | |
pre-run: | |
uses: ./.github/workflows/pre-run.yml | |
secrets: inherit | |
publish: | |
runs-on: ubuntu-latest | |
needs: pre-run | |
if: "needs.pre-run.outputs.is-not-fork == 'true' && (github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, 'chore: version packages'))" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: npm | |
- run: npm install -g npm@latest | |
- run: npm ci | |
- run: npm run build | |
- run: git config --local user.email '[email protected]' | |
- run: git config --local user.name 'GitHub Action' | |
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish | |
run: | | |
npx lerna publish from-package --no-verify-access --yes | |
RELEASE=$(cat lerna.json | jq -r '.version') | |
git tag -a v$RELEASE -m v$RELEASE | |
git push origin v$RELEASE |