-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpipeline.ts
More file actions
209 lines (207 loc) · 5.83 KB
/
Copy pathpipeline.ts
File metadata and controls
209 lines (207 loc) · 5.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
import { definePipeline, env, job, sh, task, trigger } from "@async/pipeline";
const publishPackage = "packages/web";
export default definePipeline({
name: "async-web",
cache: "file:local",
triggers: {
pr: trigger.github({ events: ["pull_request"] }),
main: trigger.github({ events: ["push"], branches: ["main"] }),
release: trigger.github({ events: ["release"] }),
manual: trigger.manual()
},
sync: {
github: {
nodeVersion: 24,
packagePreviews: {
package: publishPackage,
target: "pack"
},
pages: { target: "docs.site" }
},
tasks: {
prefix: "pipeline",
runners: ["package"],
targets: "root",
jobs: "all",
tasks: [
"api-ledger",
"api-surface",
"docs.site",
"pack"
],
scripts: {
"github:check": "github check",
"sync:check": "sync check",
"sync:generate": "sync generate",
"github:generate": "github generate",
"api-surface": "run-task api-surface",
"api:surface:generate": "run-task api-ledger",
"pages": "run-task docs.site",
"publish:github:main": "publish github main --package packages/web",
"publish:github:pr": "publish github pr --package packages/web",
"publish:github:release": "publish github release --package packages/web",
"publish:npm": "publish npm --package packages/web",
"release:doctor": "release doctor --package packages/web",
"release:ensure": "release ensure --package packages/web",
"verify:force": "run verify --force"
}
}
},
namedInputs: {
source: [
"packages/*/src/**/*",
"packages/*/tests/**/*",
"packages/*/scripts/**/*",
"packages/*/package.json",
"packages/*/tsconfig*.json",
"packages/*/vitest.config.ts",
"docs/**/*.md",
"scripts/**/*.js",
"README.md",
"CHANGELOG.md",
"API_SURFACE.md",
"api-contract.json",
"package.json",
"pnpm-lock.yaml",
"pnpm-workspace.yaml",
"tsconfig.base.json",
"tsconfig.json"
]
},
tasks: {
typecheck: task({
inputs: ["source"],
cache: true,
run: sh`pnpm typecheck`
}),
lint: task({
inputs: ["source"],
cache: true,
run: sh`pnpm lint`
}),
test: task({
dependsOn: ["typecheck"],
inputs: ["source"],
cache: true,
run: sh`pnpm run test`
}),
build: task({
dependsOn: ["test"],
inputs: ["source"],
outputs: ["packages/*/dist/**"],
cache: true,
run: sh`pnpm run build`
}),
pack: task({
dependsOn: ["build"],
inputs: ["source"],
cache: false,
run: sh`pnpm --dir packages/web pack:check`
}),
"api-manifest": task({
inputs: ["api-contract.json"],
cache: true,
run: sh`pnpm api-contract check --manifest api-contract.json`
}),
"api-ledger": task({
dependsOn: ["api-manifest"],
inputs: ["api-contract.json"],
outputs: ["API_SURFACE.md"],
cache: false,
run: sh`pnpm api-contract ledger --manifest api-contract.json --out API_SURFACE.md`
}),
"api-surface": task({
dependsOn: ["api-manifest"],
inputs: ["api-contract.json", "API_SURFACE.md"],
cache: true,
run: sh`pnpm api-contract ledger --manifest api-contract.json --check API_SURFACE.md`
}),
"docs.site": task({
description: "Build the standardized GitHub Pages documentation site.",
inputs: ["README.md", "docs/**/*.md", "scripts/build-pages.js"],
outputs: [".async/pages/**"],
cache: false,
run: sh`node scripts/build-pages.js`
}),
"github-main-snapshot": task({
dependsOn: ["pack"],
inputs: ["source"],
cache: false,
run: sh`pnpm async-pipeline publish github main --package ${publishPackage}`
}),
"stable-release": task({
dependsOn: ["release-ensure"],
inputs: ["source"],
cache: false,
run: [
sh`pnpm async-pipeline publish github release --package ${publishPackage}`,
sh`pnpm async-pipeline publish npm --package ${publishPackage}`,
sh`pnpm async-pipeline release doctor --package ${publishPackage}`
]
}),
"release-doctor": task({
description: "Verify the published package, GitHub release, and registry state.",
inputs: ["source"],
cache: false,
run: sh`pnpm async-pipeline release doctor --package ${publishPackage}`
}),
"release-ensure": task({
description: "Create or verify the release tag and GitHub Release before package publishing.",
dependsOn: ["pack"],
inputs: ["source"],
cache: false,
run: sh`pnpm async-pipeline release ensure --package ${publishPackage}`
})
},
jobs: {
verify: job({
target: ["pack", "api-surface", "docs.site"],
trigger: ["pr", "main"]
}),
"main-snapshot": job({
target: "github-main-snapshot",
trigger: ["main"],
env: {
GITHUB_TOKEN: env.secret("GITHUB_TOKEN")
},
github: {
permissions: {
contents: "read",
packages: "write"
}
}
}),
"stable-release": job({
target: "stable-release",
trigger: ["manual", "release"],
environment: "npm-publish",
env: {
GITHUB_TOKEN: env.secret("GITHUB_TOKEN"),
NODE_AUTH_TOKEN: env.secret("NPM_TOKEN")
},
requires: {
provenance: true
},
github: {
permissions: {
contents: "write",
idToken: "write",
packages: "write"
}
}
}),
"release-doctor": job({
target: "release-doctor",
trigger: ["manual"],
env: {
GITHUB_TOKEN: env.secret("GITHUB_TOKEN")
},
github: {
permissions: {
contents: "read",
packages: "read"
}
}
}),
}
});