File tree 2 files changed +23
-8
lines changed 2 files changed +23
-8
lines changed Original file line number Diff line number Diff line change 5
5
branches :
6
6
- main
7
7
8
- concurrency : ${{ github.workflow }}-${{ github.ref }}
9
-
8
+ permissions : {}
10
9
jobs :
11
10
release :
11
+ # prevents this action from running on forks
12
+ if : github.repository == 'sveltejs/svelte-json-tree'
13
+ permissions :
14
+ contents : write # to create release (changesets/action)
15
+ id-token : write # OpenID Connect token needed for provenance
16
+ pull-requests : write # to create pull request (changesets/action)
12
17
name : Release
13
18
runs-on : ubuntu-latest
14
19
steps :
15
20
- name : Checkout Repo
16
21
uses : actions/checkout@v4
17
-
18
- - name : Setup Node.js 20
22
+ with :
23
+ # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
24
+ fetch-depth : 0
25
+ - uses : pnpm/action-setup@v4.0.0
26
+ - name : Setup Node.js
19
27
uses : actions/setup-node@v4
20
28
with :
21
- node-version : 20
29
+ node-version : 22.x
30
+ cache : pnpm
22
31
23
- - uses : pnpm/action-setup@v4.0.0
32
+ - run : pnpm install --frozen-lockfile
24
33
25
- - name : Create Release Pull Request
34
+ - name : Create Release Pull Request or Publish to npm
35
+ id : changesets
26
36
uses : changesets/action@v1
37
+ with :
38
+ publish : pnpm changeset:publish
27
39
env :
28
- GITHUB_TOKEN : ${{ secrets.NPM_TOKEN }}
40
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
41
+ NPM_CONFIG_PROVENANCE : true
42
+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change 20
20
"build" : " vite build && npm run package" ,
21
21
"build:standalone" : " BUILD_MODE=standalone vite build" ,
22
22
"build:bundled" : " BUILD_MODE=bundled vite build" ,
23
+ "changeset:publish" : " changeset publish" ,
23
24
"preview" : " vite preview" ,
24
25
"package" : " svelte-kit sync && svelte-package -i src/lib/svelte-json-tree -o dist/lib && pnpm build:standalone && pnpm build:bundled && publint" ,
25
26
"prepublishOnly" : " npm run package" ,
You can’t perform that action at this time.
0 commit comments