Skip to content

Commit 33b0423

Browse files
authored
JSR Migration (#57)
* Get JSR publish dry-run clean, add to CI * Work on using bare imports for saved files, JSR for v0.5 * Break out ApiFactory definition * Update extras a lil * Nit csv * Reset lockfile on old deno CIs * use deno 2.4 for publish ci * Clean up backend dev story * One more https import * Move generation deps up for deno deploy classic * Fix import tag
1 parent adf09f1 commit 33b0423

68 files changed

Lines changed: 720 additions & 854 deletions

Some content is hidden

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

.github/workflows/deno-ci.yml

Lines changed: 54 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,16 @@ jobs:
2929
with:
3030
deno-version: ${{ matrix.deno-version }}
3131

32-
- name: Cache https:// deps
32+
- name: Cache Deno deps
3333
uses: actions/cache@v4
3434
with:
35-
path: |
36-
~/.cache/deno/deps/https
37-
~/.cache/deno/remote/https
35+
path: ~/.cache/deno
3836
key: deno/${{ matrix.deno-version }}-https/v1-${{ github.sha }}
3937
restore-keys: deno/${{ matrix.deno-version }}-https/v1-
4038

39+
- name: 'Possibly reset lockfile'
40+
run: deno install || rm deno.lock
41+
4142
- name: Check client/mod.ts
4243
if: always()
4344
run: time deno check lib/client/mod.ts
@@ -56,6 +57,42 @@ jobs:
5657
lib/encoding/
5758
lib/extras/
5859
60+
check-publish:
61+
runs-on: ubuntu-latest
62+
name: Check JSR Publish
63+
64+
steps:
65+
- uses: actions/checkout@v5
66+
67+
- uses: denoland/setup-deno@v2
68+
with:
69+
deno-version: v2.4
70+
71+
- name: Check publish rules
72+
run: deno publish --dry-run --allow-dirty
73+
74+
publish:
75+
runs-on: ubuntu-latest
76+
name: JSR Publish
77+
needs:
78+
- build
79+
- check-publish
80+
if: github.event_name == 'push'
81+
82+
permissions:
83+
contents: read
84+
id-token: write
85+
86+
steps:
87+
- uses: actions/checkout@v5
88+
89+
- uses: denoland/setup-deno@v2
90+
with:
91+
deno-version: v2.4
92+
93+
- name: Publish now
94+
run: deno publish
95+
5996
build-web-service:
6097
runs-on: ubuntu-latest
6198

@@ -78,18 +115,19 @@ jobs:
78115
with:
79116
deno-version: ${{ matrix.deno-version }}
80117

81-
- name: Cache https:// deps
118+
- name: Cache Deno deps
82119
uses: actions/cache@v4
83120
with:
84-
path: |
85-
~/.cache/deno/deps/https
86-
~/.cache/deno/remote/https
121+
path: ~/.cache/deno
87122
key: deno/${{ matrix.deno-version }}-https/v1-${{ github.sha }}
88123
restore-keys: deno/${{ matrix.deno-version }}-https/v1-
89124

125+
- name: 'Possibly reset lockfile'
126+
run: deno install || rm deno.lock
127+
90128
- name: Check generation/deploy/mod.ts
91129
if: always()
92-
run: time deno check --allow-import=cdn.skypack.dev,deno.land generation/deploy/mod.ts
130+
run: time deno check generation/deploy/mod.ts
93131

94132
validate-codegen:
95133
runs-on: ubuntu-latest
@@ -116,15 +154,16 @@ jobs:
116154
with:
117155
deno-version: ${{ matrix.deno-version }}
118156

119-
- name: Cache https:// deps
157+
- name: Cache Deno deps
120158
uses: actions/cache@v4
121159
with:
122-
path: |
123-
~/.cache/deno/deps/https
124-
~/.cache/deno/remote/https
160+
path: ~/.cache/deno
125161
key: deno/${{ matrix.deno-version }}-https/v1-${{ github.sha }}
126162
restore-keys: deno/${{ matrix.deno-version }}-https/v1-
127163

164+
- name: 'Possibly reset lockfile'
165+
run: deno install || rm deno.lock
166+
128167
- name: Validate aws-sdk fixtures
129168
if: always()
130169
run: time deno run -A generation/script/validate-fixtures.ts
@@ -156,12 +195,10 @@ jobs:
156195
with:
157196
deno-version: ${{ matrix.deno-version }}
158197

159-
- name: Cache https:// deps
198+
- name: Cache Deno deps
160199
uses: actions/cache@v4
161200
with:
162-
path: |
163-
~/.cache/deno/deps/https
164-
~/.cache/deno/remote/https
201+
path: ~/.cache/deno
165202
key: deno/${{ matrix.deno-version }}-https/v1-${{ github.sha }}
166203
restore-keys: deno/${{ matrix.deno-version }}-https/v1-
167204

deno.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"tasks": {
3+
"deploy:dev": "deno run --watch --allow-env --allow-sys --allow-read --allow-net='[::]:8000,otel.devmode.cloud,api.github.com,raw.githubusercontent.com' generation/deploy/mod.ts"
4+
},
5+
"workspace": [
6+
"./generation",
7+
"./lib"
8+
],
9+
"imports": {
10+
"@cloudydeno/jmespath": "jsr:@cloudydeno/jmespath@^1",
11+
"@cloudydeno/opentelemetry": "jsr:@cloudydeno/opentelemetry@^0.10",
12+
"@std/assert": "jsr:@std/assert@^1",
13+
"@std/cache": "jsr:@std/cache@^0.2",
14+
"@std/csv": "jsr:@std/csv@^1",
15+
"@std/html": "jsr:@std/html@^1",
16+
"@std/path": "jsr:@std/path@^1"
17+
}
18+
}

deno.lock

Lines changed: 220 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)