@bensandee/tooling 0.54.1 → 0.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -0
- package/dist/bin.mjs +1065 -811
- package/package.json +3 -3
- package/tooling.schema.json +27 -0
package/README.md
CHANGED
|
@@ -124,6 +124,44 @@ tooling release:simple --release-as major --prerelease beta # → 2.0.0-beta.0
|
|
|
124
124
|
|
|
125
125
|
The generated release workflow exposes these as optional `workflow_dispatch` inputs (`bump` and `prerelease`), so bumps can also be controlled from the CI UI.
|
|
126
126
|
|
|
127
|
+
#### Release assets
|
|
128
|
+
|
|
129
|
+
Upload arbitrary build artifacts (tarballs, binaries, zips, etc.) to each release.
|
|
130
|
+
|
|
131
|
+
**Convention (zero config):** Add a `build:release-assets` script to any `package.json` and have it write artifacts into a `release-assets/` directory alongside the script:
|
|
132
|
+
|
|
133
|
+
```json
|
|
134
|
+
{
|
|
135
|
+
"scripts": {
|
|
136
|
+
"build:release-assets": "mkdir -p release-assets && tar -czf release-assets/app.tar.gz dist"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
On `repo:sync`, `release-assets/` is added to `.gitignore` and a notice is printed confirming the convention was detected. In CI, the generated release workflow runs `tooling release:assets`, which builds every detected package and uploads every file in each `release-assets/` directory to the current tag's release. The script runs from the package directory, so monorepo packages can each emit their own set of artifacts.
|
|
142
|
+
|
|
143
|
+
If the script runs but writes no files to `release-assets/`, `release:assets` fails with an actionable error rather than silently skipping the upload.
|
|
144
|
+
|
|
145
|
+
**Override (non-conventional layouts):** For artifacts that don't fit the convention, declare them explicitly in `.tooling.json`:
|
|
146
|
+
|
|
147
|
+
```json
|
|
148
|
+
{
|
|
149
|
+
"releaseAssets": [
|
|
150
|
+
{ "file": "dist/app.tar.gz", "command": ["pnpm", "build"], "name": "app.tar.gz" }
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
| Field | Description |
|
|
156
|
+
| --------- | ---------------------------------------------------------------------------------------- |
|
|
157
|
+
| `file` | Path to the artifact, relative to the project root (required). |
|
|
158
|
+
| `command` | argv run before upload (optional; omit for pre-built files). Not interpreted by a shell. |
|
|
159
|
+
| `name` | Asset name in the release (optional; defaults to the file's basename). |
|
|
160
|
+
|
|
161
|
+
Convention and overrides coexist — a repo can use both.
|
|
162
|
+
|
|
163
|
+
Works for both `changesets` and `simple` release strategies, on Forgejo (via API upload) and GitHub (via `gh release upload --clobber`). The asset step in the workflow is gated on the release itself having published/pushed, so failed releases never upload stale artifacts.
|
|
164
|
+
|
|
127
165
|
### Docker
|
|
128
166
|
|
|
129
167
|
| Command | Description |
|