1
- name : Release
1
+ name : Snapshot Release
2
2
on :
3
3
push :
4
+ paths :
5
+ - " .changeset/**"
4
6
branches :
5
7
- snapshot
6
-
7
- concurrency : ${{ github.workflow }}-${{ github.ref }}
8
-
8
+ pull_request :
9
+ paths :
10
+ - " .changeset/**"
11
+ branches : [master, main, release]
9
12
env :
10
13
CI : true
11
14
jobs :
12
- version :
13
- timeout-minutes : 15
15
+ snapshot-release :
16
+ # Only repo owner can publish snapshot version when create pr target master
17
+ if : ${{ github.triggering_actor == github.repository_owner }}
14
18
runs-on : ubuntu-latest
15
- permissions :
16
- contents : write
17
- packages : write
18
- pull-requests : write
19
19
steps :
20
20
- name : checkout code repository
21
- uses : actions/checkout@v2
21
+ uses : actions/checkout@v4
22
22
with :
23
23
fetch-depth : 0
24
24
- name : setup node.js
25
- uses : actions/setup-node@v2
25
+ uses : actions/setup-node@v4
26
26
with :
27
- node-version : 14
27
+ node-version : 18
28
28
- uses : pnpm/action-setup@v2
29
29
name : Install pnpm
30
30
id : pnpm-install
@@ -34,23 +34,37 @@ jobs:
34
34
id : pnpm-cache
35
35
shell : bash
36
36
run : |
37
- echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
37
+ echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_ENV
38
38
- uses : actions/cache@v3
39
39
name : setup pnpm cache
40
40
with :
41
- path : ${{ steps.pnpm-cache.outputs .STORE_PATH }}
41
+ path : ${{ env .STORE_PATH }}
42
42
key : ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
43
43
restore-keys : |
44
44
${{ runner.os }}-pnpm-store-
45
45
- name : install dependencies
46
46
run : pnpm install --frozen-lockfile=false
47
+ - name : Creating .npmrc
48
+ run : |
49
+ cat << EOF > "$HOME/.npmrc"
50
+ //registry.npmjs.org/:_authToken=$NPM_TOKEN
51
+ EOF
52
+ env :
53
+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
54
+ # enable it if develop swc plugin
55
+ # - name: install Rust
56
+ # uses: actions-rs/toolchain@v1
57
+ # with:
58
+ # profile: minimal
59
+ # - name: install wasm target
60
+ # shell: bash
61
+ # run: |
62
+ # rustup target add wasm32-wasi
47
63
- name : create and publish versions
48
- uses : changesets/action@v1
49
- with :
50
- version : pnpm ci:snapshot
51
- commit : " chore: update versions"
52
- title : " chore: update versions"
53
- publish : pnpm ci:prerelease
64
+ run : |
65
+ pnpm ci:snapshot
66
+ pnpm changeset pre enter snapshot
67
+ pnpm ci:prerelease
54
68
env :
55
69
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
56
- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
70
+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments