Skip to content

Commit 81311fe

Browse files
authored
feat: move app to sdk (#2902)
2 parents 412194d + 9aec302 commit 81311fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3358
-6844
lines changed
+6-100
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish TypeScript SDK
1+
name: 'Publish TypeScript SDK'
22

33
on:
44
push:
@@ -19,116 +19,22 @@ defaults:
1919
shell: bash
2020

2121
env:
22-
NIX_VERSION: nix-2.13.2
23-
NIXPKGS_CHANNEL: nixos-22.11
2422
NODE_OPTIONS: '--no-warnings'
2523
ACTIONS_RUNNER_DEBUG: true
2624

2725
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'
3528
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
7429
permissions:
7530
contents: read
31+
# The OIDC ID token is used for authentication with JSR.
7632
id-token: write
77-
packages: write
78-
runs-on: ['ubuntu-latest']
7933
steps:
8034
- name: 'Checkout'
8135
uses: actions/checkout@v4
8236

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'
11038
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
11639
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

app/app.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{
1010
packages = {
1111
app = unstablePkgs.buildNpmPackage {
12-
npmDepsHash = "sha256-VRPczr/PHVSjiJpTmVHVQxXGkmPhqn5bEQ8qVarYcz8=";
12+
npmDepsHash = "sha256-o0iMZ4VvEDlj0OEoieLzZG4J2eeTF4EMRWrYI15e2RY=";
1313
src = ./.;
1414
sourceRoot = "app";
1515
npmFlags = [ "--legacy-peer-deps" ];

0 commit comments

Comments
 (0)