-
Notifications
You must be signed in to change notification settings - Fork 3
66 lines (55 loc) · 1.97 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
58
59
60
61
62
63
64
65
66
name: publish
on:
push:
branches:
- master
- canary
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Fetch all git history
run: git fetch --prune --unshallow
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Configure git
run: |
git config --local user.name "GitHub Action"
git config --local user.email "[email protected]"
- name: Publish prerelease
run: |
yarn lerna publish --yes --canary --force-publish --no-verify-access --pre-dist-tag=canary --preid=canary
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
if: github.ref == 'refs/heads/canary'
- name: Up version in package.json and create github release
run: yarn lerna version --conventional-commits --conventional-graduate --allow-branch=master --yes --create-release github
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: github.ref == 'refs/heads/master'
- name: Publish release to npm
run: yarn lerna publish from-package --yes --no-verify-access
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
if: github.ref == 'refs/heads/master'
- name: Create .npmrc for github registry auth
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://npm.pkg.github.com'
cache: yarn
if: github.ref == 'refs/heads/master'
- name: Publish release to GitHub registry
run: yarn lerna publish from-package --yes --registry https://npm.pkg.github.com/CSSSR
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: github.ref == 'refs/heads/master'