-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (58 loc) · 1.79 KB
/
main.yaml
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Main
on:
push:
branches: [main]
jobs:
check-code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- run: pnpm i
- run: pnpm run lint:check
- run: pnpm run format:check
- run: pnpm run type:check
stable-release:
needs: [check-code]
if: ${{ needs.check-code.result == 'success' }}
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
hasChangesets: ${{ steps.changesets.outputs.hasChangesets }}
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- run: pnpm i
- name: Changesets version or deploy and publish on @latest
id: changesets
uses: changesets/action@v1
with:
commit: 'chore(release): version packages'
title: 'chore(release): version packages'
publish: pnpm release:stable
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
next-release:
needs: [stable-release]
if: ${{ needs.stable-release.result == 'success' && needs.stable-release.outputs.hasChangesets == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- run: pnpm i
- run: pnpm changeset version --snapshot next
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish
run: |
pnpm build:packages
pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
pnpm changeset publish --tag next
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}