-
Notifications
You must be signed in to change notification settings - Fork 312
48 lines (40 loc) · 1.19 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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