1
- name : Publish TypeScript SDK
1
+ name : ' Publish TypeScript SDK'
2
2
3
3
on :
4
4
push :
@@ -19,116 +19,22 @@ defaults:
19
19
shell : bash
20
20
21
21
env :
22
- NIX_VERSION : nix-2.13.2
23
- NIXPKGS_CHANNEL : nixos-22.11
24
22
NODE_OPTIONS : ' --no-warnings'
25
23
ACTIONS_RUNNER_DEBUG : true
26
24
27
25
jobs :
28
- publish-npm :
29
- # manually temporarily disabled
30
- if : false
31
- name : ' Publish NPM Registry'
32
- permissions :
33
- id-token : write
34
- contents : write
26
+ publish-jsr :
27
+ name : ' Publish JSR'
35
28
runs-on : ['ubuntu-latest']
36
- steps :
37
- - name : ' Checkout'
38
- uses : actions/checkout@v4
39
-
40
- # This is needed to do npm authentication
41
- - name : ' Setup Node.js'
42
- uses : actions/setup-node@v4
43
- with :
44
- node-version : ' lts/*'
45
- registry-url : ' https://registry.npmjs.org'
46
-
47
- - name : ' Install Nix'
48
- uses : cachix/install-nix-action@v25
49
- with :
50
- nix_path : nixpkgs=channel:${{ env.NIXPKGS_CHANNEL }}
51
- github_access_token : ${{ github.token }}
52
- - run : |
53
- nix-channel --add https://nixos.org/channels/${{ env.NIXPKGS_CHANNEL }} nixpkgs
54
- nix-channel --update
55
-
56
- - name : ' Build SDK'
57
- working-directory : ' ./typescript-sdk'
58
- run : |
59
- nix build .#typescript-sdk -o dist
60
-
61
- - name : ' Publish to NPM'
62
- working-directory : ' ./typescript-sdk'
63
- env :
64
- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
65
- # https://docs.npmjs.com/generating-provenance-statements
66
- NPM_CONFIG_PROVENANCE : true
67
- run : |
68
- npm publish --access='public' --no-git-checks
69
-
70
- publish-github :
71
- name : ' Publish GitHub Package Registry'
72
- # manually temporarily disabled
73
- if : false
74
29
permissions :
75
30
contents : read
31
+ # The OIDC ID token is used for authentication with JSR.
76
32
id-token : write
77
- packages : write
78
- runs-on : ['ubuntu-latest']
79
33
steps :
80
34
- name : ' Checkout'
81
35
uses : actions/checkout@v4
82
36
83
- # This is needed to do npm authentication
84
- - name : ' Setup Node.js'
85
- uses : actions/setup-node@v4
86
- with :
87
- node-version : ' lts/*'
88
- registry-url : ' https://npm.pkg.github.com'
89
-
90
- - name : ' Install Nix'
91
- uses : cachix/install-nix-action@v25
92
- with :
93
- github_access_token : ${{ github.token }}
94
- nix_path : nixpkgs=channel:${{ env.NIXPKGS_CHANNEL }}
95
- - run : |
96
- nix-channel --add https://nixos.org/channels/${{ env.NIXPKGS_CHANNEL }} nixpkgs
97
- nix-channel --update
98
-
99
- - name : ' Update ~/.npmrc'
100
- working-directory : ' ./typescript-sdk'
101
- run : |
102
- echo "//npm.pkg.github.com:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
103
-
104
- - name : ' Build SDK'
105
- working-directory : ' ./typescript-sdk'
106
- run : |
107
- nix build .#typescript-sdk -o dist
108
-
109
- - name : ' Publish to GitHub Package Registry'
37
+ - name : ' Publish to JSR'
110
38
working-directory : ' ./typescript-sdk'
111
- env :
112
- NPM_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
113
- NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
114
- # https://docs.npmjs.com/generating-provenance-statements
115
- NPM_CONFIG_PROVENANCE : true
116
39
run : |
117
- yarn publish --access='public' --registry='https://npm.pkg.github.com' --no-git-checks
118
-
119
- changelog :
120
- # manually temporarily disabled
121
- if : false
122
- name : ' Generate Changelog'
123
- runs-on : ['ubuntu-latest']
124
- needs : ['publish-npm']
125
- steps :
126
- - name : ' Checkout'
127
- uses : actions/checkout@v4
128
- with :
129
- fetch-depth : 0
130
-
131
- - name : ' Generate Changelog'
132
- run : npm_config_yes=true npx changelogithub
133
- env :
134
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
40
+ npm_config_yes=true npx jsr publish --allow-slow-types
0 commit comments