@omnidist/omnidist-linux-x64 0.1.16 → 0.1.18
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 +374 -0
- package/bin/omnidist +0 -0
- package/package.json +3 -2
package/README.md
ADDED
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
# omnidist
|
|
2
|
+
|
|
3
|
+
[](https://goreportcard.com/report/github.com/metalagman/omnidist)
|
|
4
|
+
[](https://github.com/metalagman/omnidist/actions/workflows/lint.yml)
|
|
5
|
+
[](https://github.com/metalagman/omnidist/actions/workflows/test.yml)
|
|
6
|
+
[](https://codecov.io/github/metalagman/omnidist)
|
|
7
|
+
[](https://github.com/metalagman/omnidist/releases)
|
|
8
|
+
[](https://www.npmjs.com/package/@omnidist/omnidist)
|
|
9
|
+
[](https://pypi.org/project/omnidist/)
|
|
10
|
+
[](LICENSE)
|
|
11
|
+
|
|
12
|
+
Run your Go CLI everywhere with `npx` and `uvx`, without requiring Go on end-user machines.
|
|
13
|
+
|
|
14
|
+
`omnidist` turns one Go project into cross-platform npm and uv distributions with prebuilt binaries, then stages, verifies, and publishes them in a deterministic release flow.
|
|
15
|
+
|
|
16
|
+
Release flow: `build -> stage -> verify -> publish` so users can run your tool from JavaScript and Python ecosystems out of the box.
|
|
17
|
+
|
|
18
|
+
For project background, packaging model details, migration notes, and contributor-oriented repo layout, see [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
19
|
+
|
|
20
|
+
## Requirements
|
|
21
|
+
|
|
22
|
+
- Go 1.25+
|
|
23
|
+
- Node.js + npm (for npm distribution commands)
|
|
24
|
+
- `uv` (for uv distribution commands)
|
|
25
|
+
- `git` (when `version.source: git-tag`)
|
|
26
|
+
- `NPM_PUBLISH_TOKEN` for npm publish (unless `--dry-run`)
|
|
27
|
+
- `UV_PUBLISH_TOKEN` (or `--token`) for uv publish (unless `--dry-run`)
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
Run without installation first:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npx @omnidist/omnidist --help
|
|
35
|
+
uvx omnidist --help
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Install globally with npm:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm i -g @omnidist/omnidist
|
|
42
|
+
omnidist --help
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Install with Go toolchain:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
go install github.com/metalagman/omnidist/cmd/omnidist@latest
|
|
49
|
+
omnidist --help
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Build locally from source:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
go build -o ./bin/omnidist ./cmd/omnidist
|
|
56
|
+
./bin/omnidist --help
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Or run directly:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
go run ./cmd/omnidist --help
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Quick Start
|
|
66
|
+
|
|
67
|
+
1. Print repo-tailored onboarding/release commands:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
omnidist quickstart
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
2. Initialize config and distribution folder structure:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
omnidist init
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
This creates:
|
|
80
|
+
- `.omnidist/omnidist.yaml`
|
|
81
|
+
- `.omnidist/` workspace directories
|
|
82
|
+
- `.omnidist/.gitignore` for generated artifacts
|
|
83
|
+
|
|
84
|
+
3. Build binaries for configured targets:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
omnidist build
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
This also writes the resolved build version to `.omnidist/dist/VERSION`.
|
|
91
|
+
|
|
92
|
+
4. Stage and verify artifacts:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
omnidist stage
|
|
96
|
+
omnidist verify
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`omnidist uv stage` converts the resolved version to PEP 440 and writes
|
|
100
|
+
`.omnidist/uv/pyproject.toml` with that version.
|
|
101
|
+
It also recreates `.omnidist/uv/dist` to prevent stale wheel artifacts from previous runs.
|
|
102
|
+
|
|
103
|
+
5. Publish when verification passes:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
omnidist publish
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
6. Generate tag-triggered release workflow:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
omnidist ci
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Common Commands
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# Build binaries for configured targets and persist build version
|
|
119
|
+
omnidist build
|
|
120
|
+
|
|
121
|
+
# Print a quickstart command sequence for this repo
|
|
122
|
+
omnidist quickstart
|
|
123
|
+
|
|
124
|
+
# Show runtime version/build metadata
|
|
125
|
+
omnidist version
|
|
126
|
+
|
|
127
|
+
# Stage and verify both distributions (npm -> uv)
|
|
128
|
+
omnidist stage
|
|
129
|
+
omnidist verify
|
|
130
|
+
|
|
131
|
+
# Stage dev/pre-release artifacts
|
|
132
|
+
omnidist stage --dev
|
|
133
|
+
|
|
134
|
+
# Publish both distributions (fail-fast, npm -> uv)
|
|
135
|
+
omnidist publish
|
|
136
|
+
|
|
137
|
+
# Generate GitHub Actions workflow for tagged releases
|
|
138
|
+
omnidist ci
|
|
139
|
+
|
|
140
|
+
# Limit orchestration to one distribution
|
|
141
|
+
omnidist stage --only npm
|
|
142
|
+
omnidist verify --only uv
|
|
143
|
+
|
|
144
|
+
# Distribution-specific publishing options
|
|
145
|
+
omnidist npm publish --tag next --otp <6-digit-code>
|
|
146
|
+
omnidist uv publish --publish-url https://test.pypi.org/legacy/ --token <pypi-token>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Environment Variables and .env
|
|
150
|
+
|
|
151
|
+
`omnidist` loads `.env` automatically at startup (via `godotenv`) if present.
|
|
152
|
+
|
|
153
|
+
Supported variables:
|
|
154
|
+
|
|
155
|
+
- `OMNIDIST_VERSION`: used when `version.source: env`; also expanded in `build.ldflags` templates (for example `${OMNIDIST_VERSION}`).
|
|
156
|
+
`VERSION` is not used.
|
|
157
|
+
- `OMNIDIST_GIT_COMMIT`: optional ldflags template variable for build metadata; populated automatically by `omnidist build` when git metadata is available.
|
|
158
|
+
- `OMNIDIST_BUILD_DATE`: optional ldflags template variable for build metadata; populated automatically by `omnidist build` as UTC RFC3339.
|
|
159
|
+
- `NPM_PUBLISH_TOKEN`: required for npm publish commands when not using `--dry-run`
|
|
160
|
+
- `UV_PUBLISH_TOKEN`: used by uv publish when `--token` is not provided
|
|
161
|
+
|
|
162
|
+
Example `.env`:
|
|
163
|
+
|
|
164
|
+
```dotenv
|
|
165
|
+
OMNIDIST_VERSION=1.2.3
|
|
166
|
+
NPM_PUBLISH_TOKEN=npm_xxx
|
|
167
|
+
UV_PUBLISH_TOKEN=pypi-xxx
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Configuration
|
|
171
|
+
|
|
172
|
+
`.omnidist/omnidist.yaml`:
|
|
173
|
+
|
|
174
|
+
```yaml
|
|
175
|
+
tool:
|
|
176
|
+
name: omnidist
|
|
177
|
+
main: ./cmd/omnidist
|
|
178
|
+
|
|
179
|
+
version:
|
|
180
|
+
source: git-tag # git-tag | file | env
|
|
181
|
+
|
|
182
|
+
targets:
|
|
183
|
+
- os: darwin
|
|
184
|
+
arch: amd64
|
|
185
|
+
- os: darwin
|
|
186
|
+
arch: arm64
|
|
187
|
+
- os: linux
|
|
188
|
+
arch: amd64
|
|
189
|
+
- os: linux
|
|
190
|
+
arch: arm64
|
|
191
|
+
- os: windows
|
|
192
|
+
arch: amd64
|
|
193
|
+
|
|
194
|
+
build:
|
|
195
|
+
ldflags: -s -w
|
|
196
|
+
tags: []
|
|
197
|
+
cgo: false
|
|
198
|
+
|
|
199
|
+
distributions:
|
|
200
|
+
npm:
|
|
201
|
+
package: "@omnidist/omnidist"
|
|
202
|
+
registry: https://registry.npmjs.org
|
|
203
|
+
access: public # public | restricted
|
|
204
|
+
include-readme: true # include project README.md in staged packages when present
|
|
205
|
+
|
|
206
|
+
uv:
|
|
207
|
+
package: omnidist
|
|
208
|
+
index-url: https://upload.pypi.org/legacy/
|
|
209
|
+
linux-tag: manylinux2014 # manylinux2014 | musllinux_1_2
|
|
210
|
+
include-readme: true # include project README.md in staged wheels when present
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
`targets` use Go values (`GOOS`/`GOARCH`). Distribution workflows map them as needed (for example `windows/amd64` -> npm `win32/x64`).
|
|
214
|
+
|
|
215
|
+
For appkit version injection, configure `build.ldflags` in your project config:
|
|
216
|
+
|
|
217
|
+
```yaml
|
|
218
|
+
build:
|
|
219
|
+
ldflags: -s -w -X github.com/metalagman/appkit/version.version=${OMNIDIST_VERSION} -X github.com/metalagman/appkit/version.gitCommit=${OMNIDIST_GIT_COMMIT} -X github.com/metalagman/appkit/version.buildDate=${OMNIDIST_BUILD_DATE}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
With `version.source: git-tag`, release workflows require `HEAD` to be on an exact SemVer tag (`vX.Y.Z` or `X.Y.Z`).
|
|
223
|
+
|
|
224
|
+
## Command Reference
|
|
225
|
+
|
|
226
|
+
Top-level:
|
|
227
|
+
|
|
228
|
+
- `omnidist init`
|
|
229
|
+
- `omnidist build`
|
|
230
|
+
- `omnidist quickstart`
|
|
231
|
+
- `omnidist version`
|
|
232
|
+
- `omnidist ci [--force]`
|
|
233
|
+
- `omnidist stage [--dev] [--only npm|uv|npm,uv]`
|
|
234
|
+
- `omnidist verify [--only npm|uv|npm,uv]`
|
|
235
|
+
- `omnidist publish [--dry-run] [--only npm|uv|npm,uv]`
|
|
236
|
+
- `omnidist npm`
|
|
237
|
+
- `omnidist uv`
|
|
238
|
+
|
|
239
|
+
NPM subcommands:
|
|
240
|
+
|
|
241
|
+
- `omnidist npm stage [--dev]`
|
|
242
|
+
- `omnidist npm verify`
|
|
243
|
+
- `omnidist npm publish [--dry-run] [--tag <tag>] [--registry <url>] [--otp <code>]`
|
|
244
|
+
|
|
245
|
+
UV subcommands:
|
|
246
|
+
|
|
247
|
+
- `omnidist uv stage [--dev]`
|
|
248
|
+
- `omnidist uv verify`
|
|
249
|
+
- `omnidist uv publish [--dry-run] [--publish-url <url>] [--token <pypi-token>]`
|
|
250
|
+
|
|
251
|
+
## Usage Patterns
|
|
252
|
+
|
|
253
|
+
### Local development loop
|
|
254
|
+
|
|
255
|
+
Use this when iterating on the CLI binary and validating artifact generation locally:
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
omnidist build
|
|
259
|
+
omnidist stage
|
|
260
|
+
omnidist verify
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### Dev pre-release artifacts
|
|
264
|
+
|
|
265
|
+
Generate prerelease versions from git describe data:
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
omnidist stage --dev
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Unified multi-distribution orchestration
|
|
272
|
+
|
|
273
|
+
Top-level `stage`, `verify`, and `publish` run distributions in deterministic order:
|
|
274
|
+
`npm` first, then `uv`, and stop on first failure.
|
|
275
|
+
|
|
276
|
+
Select a subset with `--only`:
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
omnidist stage --only uv
|
|
280
|
+
omnidist verify --only npm
|
|
281
|
+
omnidist publish --dry-run --only npm,uv
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### CI bootstrap for tag releases
|
|
285
|
+
|
|
286
|
+
Generate `.github/workflows/omnidist-release.yml`:
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
omnidist ci
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
The generated workflow triggers on `v*` tag pushes and runs:
|
|
293
|
+
`build -> stage -> verify -> publish`.
|
|
294
|
+
|
|
295
|
+
If workflow already exists:
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
omnidist ci --force
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### npm publishing flow with custom options
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
omnidist npm publish --dry-run --tag next --registry https://registry.npmjs.org
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
Before npm commands run, omnidist writes `.omnidist/.npmrc` from `distributions.npm.registry` using:
|
|
308
|
+
`//<registry>/:_authToken=${NPM_PUBLISH_TOKEN}`.
|
|
309
|
+
If staged package version contains a `-dev` prerelease and `--tag` is not provided, omnidist auto-publishes with `--tag dev`.
|
|
310
|
+
|
|
311
|
+
If your npm account requires 2FA for publish operations:
|
|
312
|
+
|
|
313
|
+
```bash
|
|
314
|
+
omnidist npm publish --otp <6-digit-code>
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### uv publishing flow with custom index/auth
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
omnidist uv publish --publish-url https://upload.pypi.org/legacy/ --token <pypi-token>
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
`omnidist uv publish` uses token authentication.
|
|
324
|
+
Provide token via `--token` or `UV_PUBLISH_TOKEN` (required for non-dry-run).
|
|
325
|
+
`omnidist uv verify` and `omnidist uv publish` use the staged version from
|
|
326
|
+
`.omnidist/uv/pyproject.toml` when present.
|
|
327
|
+
For PyPI/TestPyPI, `omnidist uv verify` fails if the staged version contains local metadata (`+...`), since those indexes reject local versions.
|
|
328
|
+
|
|
329
|
+
TestPyPI dry-run style validation:
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
omnidist uv publish --dry-run --publish-url https://test.pypi.org/legacy/
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
## Usage Examples
|
|
336
|
+
|
|
337
|
+
### npm release path
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
git tag v1.2.0
|
|
341
|
+
omnidist build
|
|
342
|
+
omnidist npm stage
|
|
343
|
+
omnidist npm verify
|
|
344
|
+
omnidist npm publish
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
### uv release path
|
|
348
|
+
|
|
349
|
+
```bash
|
|
350
|
+
git tag v1.2.0
|
|
351
|
+
omnidist build
|
|
352
|
+
omnidist uv stage
|
|
353
|
+
omnidist uv verify
|
|
354
|
+
omnidist uv publish --publish-url https://upload.pypi.org/legacy/
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### uv dry-run publish
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
omnidist uv publish --dry-run --publish-url https://test.pypi.org/legacy/
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
### version from environment
|
|
364
|
+
|
|
365
|
+
```yaml
|
|
366
|
+
version:
|
|
367
|
+
source: env
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
```bash
|
|
371
|
+
export OMNIDIST_VERSION=2.0.0
|
|
372
|
+
omnidist npm stage
|
|
373
|
+
omnidist uv stage
|
|
374
|
+
```
|
package/bin/omnidist
CHANGED
|
Binary file
|
package/package.json
CHANGED