-
Notifications
You must be signed in to change notification settings - Fork 902
57 lines (47 loc) · 1.38 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
49
50
51
52
53
54
55
56
57
name: Publish packages to NPM
on:
push:
branches:
- 'master'
paths:
- 'packages/*/package.json'
env:
NODE_VERSION: 14.21.3
permissions:
contents: read
jobs:
publish:
permissions:
contents: none
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: '${{ secrets.SPINNAKERBOT_PERSONAL_ACCESS_TOKEN }}'
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: git - tag bumped packages
id: tag
run: |
git config user.name spinnakerbot
git config user.email [email protected]
scripts/gha_tag_bumped_packages.sh
- name: yarn
if: ${{ steps.tag.outputs.tagged == 'true' }}
run: yarn --frozen-lockfile
- name: build all packages
if: ${{ steps.tag.outputs.tagged == 'true' }}
run: npx lerna run build
env:
NODE_ENV: production
- name: publish packages to npm
if: ${{ steps.tag.outputs.tagged == 'true' }}
run: |
npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN
# Publish all changed packages, but do not build a second time
npx lerna publish from-git --yes --ignore-scripts
env:
CI: true
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}