File tree 6 files changed +111
-52
lines changed
6 files changed +111
-52
lines changed Original file line number Diff line number Diff line change
1
+ name : " Setup Dependencies"
2
+ runs :
3
+ using : " composite"
4
+ steps :
5
+ - run : corepack enable pnpm
6
+ shell : bash
7
+
8
+ - name : Setup Node.js LTS
9
+ uses : actions/setup-node@v4
10
+ with :
11
+ node-version : lts/*
12
+ registry-url : " https://registry.npmjs.org"
13
+ cache : pnpm
14
+
15
+ - name : Install Dependencies
16
+ run : pnpm install
17
+ shell : bash
Original file line number Diff line number Diff line change 13
13
steps :
14
14
- uses : actions/checkout@main
15
15
16
- - name : Set Node.js 22.x
17
- uses : actions/setup-node@main
18
- with :
19
- node-version : 22.x
20
-
21
- - name : Install pnpm
22
- run : corepack enable pnpm
23
-
24
- - name : Install Dependencies
25
- run : pnpm i
16
+ - uses : ./.github/actions/setup-deps
26
17
27
18
- name : Check Types
28
19
run : pnpm run types
32
23
steps :
33
24
- uses : actions/checkout@main
34
25
35
- - name : Set Node.js 22.x
36
- uses : actions/setup-node@main
37
- with :
38
- node-version : 22.x
39
-
40
- - name : Install pnpm
41
- run : corepack enable pnpm
42
-
43
- - name : Install Dependencies
44
- run : pnpm i
26
+ - uses : ./.github/actions/setup-deps
45
27
46
28
- name : Linting
47
29
run : pnpm run lint
51
33
steps :
52
34
- uses : actions/checkout@main
53
35
54
- - name : Set Node.js 22.x
55
- uses : actions/setup-node@main
56
- with :
57
- node-version : 22.x
58
-
59
- - name : Install pnpm
60
- run : corepack enable pnpm
61
-
62
- - name : Install Dependencies
63
- run : pnpm i
36
+ - uses : ./.github/actions/setup-deps
64
37
65
38
- name : Tests
66
39
run : pnpm run test
Original file line number Diff line number Diff line change
1
+ name : Publish
2
+
3
+ on :
4
+ workflow_dispatch :
5
+
6
+ permissions :
7
+ contents : write
8
+ id-token : write
9
+
10
+ jobs :
11
+ publish :
12
+ name : Publish
13
+ runs-on : ubuntu-latest
14
+ environment : release
15
+ steps :
16
+ - uses : actions/checkout@main
17
+ with :
18
+ fetch-depth : 0
19
+ persist-credentials : true # needed for git push
20
+
21
+ - uses : ./.github/actions/setup-deps
22
+
23
+ - run : pnpm build
24
+
25
+ - name : git config
26
+ run : |
27
+ git config --global user.name 'Thinkmill Release Bot'
28
+ git config --global user.email '[email protected] '
29
+
30
+ - name : npm publish, git tag
31
+ run : pnpm changeset publish
32
+ env :
33
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
34
+ NPM_CONFIG_PROVENANCE : true
35
+
36
+ - run : git push origin --follow-tags
Original file line number Diff line number Diff line change
1
+ name : Publish (Snapshot)
2
+
3
+ on :
4
+ workflow_dispatch :
5
+
6
+ permissions :
7
+ contents : write
8
+ id-token : write
9
+
10
+ jobs :
11
+ publish_snapshot :
12
+ name : Publish (Snapshot)
13
+ runs-on : ubuntu-latest
14
+ environment : release
15
+ steps :
16
+ - uses : actions/checkout@main
17
+ with :
18
+ persist-credentials : true # needed for git push
19
+
20
+ - uses : ./.github/actions/setup-deps
21
+
22
+ - name : version packages
23
+ run : pnpm changeset version --snapshot ${{ inputs.tag }}
24
+ env :
25
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
26
+
27
+ - name : git commit
28
+ run : |
29
+ git config --global user.name 'Thinkmill Release Bot'
30
+ git config --global user.email '[email protected] '
31
+ git commit -a -m 'snapshot release'
32
+
33
+ - run : pnpm build
34
+
35
+ - name : npm publish, git tag
36
+ run : pnpm changeset publish --tag test
37
+ env :
38
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
39
+ NPM_CONFIG_PROVENANCE : true
40
+
41
+ # reset, then push the dangling commit
42
+ - name : git push
43
+ run : |
44
+ git reset HEAD~1 --hard
45
+ git push origin --tags
Original file line number Diff line number Diff line change 1
- name : Release
1
+ name : Version Packages
2
2
3
3
on :
4
4
push :
5
5
branches :
6
6
- main
7
+ workflow_dispatch :
7
8
8
9
jobs :
9
- release :
10
- name : Release
10
+ versioning :
11
+ name : Pull Request
11
12
runs-on : ubuntu-latest
12
13
steps :
13
- - name : Checkout Repo
14
- uses : actions/checkout@main
14
+ - uses : actions/checkout@main
15
15
with :
16
16
fetch-depth : 0
17
+ persist-credentials : false
17
18
18
- - name : Set Node.js 22.x
19
- uses : actions/setup-node@main
20
- with :
21
- node-version : 22.x
22
-
23
- - name : Install pnpm
24
- run : corepack enable pnpm
25
-
26
- - name : Install Dependencies
27
- run : pnpm i
19
+ - uses : ./.github/actions/setup-deps
28
20
29
- - name : " Create Pull Request or Publish to npm"
30
- uses : changesets/action@master
21
+ - uses : changesets/action@v1
31
22
with :
32
- publish : pnpm run release
33
- version : pnpm run version
23
+ version : pnpm run version-packages
34
24
env :
35
25
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
36
- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change 26
26
},
27
27
"scripts" : {
28
28
"postinstall" : " preconstruct dev && manypkg check" ,
29
- "release" : " preconstruct build && changeset publish" ,
30
- "version" : " changeset version && pnpm i --frozen-lockfile=false" ,
29
+ "version-packages" : " changeset version && pnpm i --frozen-lockfile=false" ,
31
30
"test" : " jest" ,
32
31
"types" : " tsc" ,
33
32
"lint" : " eslint ." ,
You can’t perform that action at this time.
0 commit comments