-
Notifications
You must be signed in to change notification settings - Fork 41
59 lines (49 loc) · 1.97 KB
/
release.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
name: Release
on: [workflow_dispatch]
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 20
# setting this should create the npmrc with $NODE_AUTH_TOKEN
registry-url: 'https://registry.npmjs.org'
- name: Config git user
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git remote set-url origin https://${{ github.actor }}:${{ secrets.GH_NODE_TOKEN }}@github.com/${{ github.repository }}
- name: Bootstrap lerna
run: yarn
- name: Build packages
run: yarn build
- name: Bump release
if: github.ref == 'refs/heads/main'
run: yarn version:release
env:
GH_TOKEN: ${{ secrets.GH_NODE_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Bump prerelease
if: github.ref != 'refs/heads/main'
run: yarn version:prerelease
env:
GH_TOKEN: ${{ secrets.GH_NODE_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Publish packages
run: yarn publish:ci
env:
GH_TOKEN: ${{ secrets.GH_NODE_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: merge main -> next
uses: actions/setup-node@v3
with:
type: now
from_branch: main
target_branch: next
github_token: ${{ secrets.GH_NODE_TOKEN }}