Skip to content

Commit bb3c1da

Browse files
committed
chore: prepare 0.3.1 release
Bump version metadata, add tag-triggered trusted pub.dev publishing workflow, and restructure docs with a user-focused README plus separate maintainer guide.
1 parent 44e2d27 commit bb3c1da

6 files changed

Lines changed: 155 additions & 175 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Publish pub.dev
2+
3+
on:
4+
push:
5+
tags:
6+
- "v[0-9]+.[0-9]+.[0-9]+"
7+
8+
jobs:
9+
publish:
10+
permissions:
11+
id-token: write
12+
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## 0.3.1
2+
3+
- Add installer one-liner smoke tests across Linux/macOS/Windows on `x64` and `arm64`.
4+
- Expand CI and binary release workflows to include Intel macOS and ARM Linux/Windows.
5+
- Improve installer workflow reliability with stronger local server startup/readiness checks.
6+
- Refresh docs/examples with validated signed and unsigned GitHub CLI command examples.
7+
- Add tag-triggered pub.dev trusted-publishing workflow (`publish-pubdev.yml`) using GitHub OIDC.
8+
- Refocus README for end users and move maintainer instructions to `doc/maintainers.md`.
9+
110
## 0.3.0
211

312
- Rename package and CLI naming to `drx`.
@@ -14,8 +23,6 @@
1423
- Add `--json` output mode for cache and versions commands.
1524
- Support global utility flags before command verbs (for example `--json versions`).
1625
- Add GH version-list fallback to repository tags when releases are absent.
17-
- Add one-liner installer smoke tests across Linux/macOS/Windows.
18-
- Expand binary build matrix to include Intel macOS and ARM Linux/Windows.
1926

2027
## 0.1.0
2128

README.md

Lines changed: 56 additions & 171 deletions
Original file line numberDiff line numberDiff line change
@@ -1,221 +1,106 @@
11
# drx
22

3-
`drx` is a Dart-first `npx`/`uvx`-style tool runner.
3+
`drx` runs CLI tools on demand, similar to `npx` / `uvx`.
44

5-
- `pub` source: runs Dart package executables.
6-
- `gh` source: runs precompiled binaries from public GitHub Releases.
7-
(language-agnostic: Go/Rust/C/C++/etc. all work)
5+
- Use `pub.dev` packages when Dart SDK is available.
6+
- Use GitHub release binaries when Dart SDK is not available.
87

9-
## Command Forms
8+
## Install
109

11-
Default source is `pub`:
12-
13-
```bash
14-
drx <package[@version]> [--] [args...]
15-
drx <package:executable[@version]> [--] [args...]
16-
```
17-
18-
Explicit source:
19-
20-
```bash
21-
drx --from pub:<package[@version]> <command> [--] [args...]
22-
drx --from gh:<owner>/<repo[@tag]> <command> [--] [args...]
23-
drx cache [list|clean|prune] [--json]
24-
drx versions <package|pub:pkg|gh:owner/repo> [--limit N] [--json]
25-
```
26-
27-
Examples:
10+
### With Dart SDK (pub.dev)
2811

2912
```bash
30-
drx melos -- --version
31-
drx mason_cli:mason -- --help
32-
drx --from pub:very_good_cli very_good -- --help
33-
drx --from gh:cli/cli@v2.70.0 gh -- version
34-
drx --from gh:BurntSushi/ripgrep rg -- --version
35-
drx --from gh:junegunn/fzf fzf -- --version
36-
drx --from gh:charmbracelet/gum gum -- --version
37-
drx --allow-unsigned --from gh:sharkdp/fd fd -- --version
38-
drx --allow-unsigned --from gh:sharkdp/bat bat -- --version
39-
drx --allow-unsigned --from gh:dandavison/delta delta -- --version
40-
drx versions melos --limit 5
41-
drx versions gh:cli/cli --limit 10
42-
drx cache list
43-
drx cache prune --max-age-days 30 --max-size-mb 2048
13+
dart pub global activate drx
14+
drx --version
4415
```
4516

46-
Note: some repositories do not publish checksums. Those require
47-
`--allow-unsigned` as shown above.
48-
49-
## Cross-Platform Support
50-
51-
- Linux: `x64`, `arm64`
52-
- macOS: `x64` (Intel), `arm64` (Apple Silicon)
53-
- Windows: `x64`, `arm64`
54-
55-
`drx` handles Windows executable resolution (`.exe`, `.cmd`, `.bat`) and
56-
Unix executable permissions for downloaded binaries.
57-
58-
## Flags
59-
60-
- `--runtime auto|jit|aot`: runtime mode for pub executables.
61-
- `--refresh`: refresh cached artifacts.
62-
- `--isolated`: use temporary, non-persistent caches.
63-
- `--asset <name>`: force a specific GitHub asset name.
64-
- `--allow-unsigned`: allow GH assets without checksum manifests.
65-
- `--json`: machine-readable output for `cache` and `versions`.
66-
- `--verbose`: enable verbose logging (currently minimal).
67-
68-
## Cache And Version Commands
69-
70-
- `drx cache list`: show cache location, entry counts, and size.
71-
- `drx cache clean`: remove all cached artifacts and lock files.
72-
- `drx cache prune`: remove old cache entries and optionally enforce size limits.
73-
- `--max-age-days N`: remove entries older than N days (default: 30 for prune).
74-
- `--max-size-mb N`: keep cache under N MB by removing oldest entries.
75-
- `--json`: output prune/list/clean results as JSON.
76-
- `drx versions <target>`: list available versions from pub.dev or GH releases.
77-
- falls back to repository tags when GH releases are not present.
78-
- `--json`: output version list as JSON.
79-
- pub targets: `melos`, `pub:melos`, `mason_cli:mason`
80-
- gh targets: `gh:cli/cli`
81-
82-
## Runtime Behavior
83-
84-
- `jit`: uses `dart run package:executable`.
85-
- `aot`: compiles with `dart compile exe` and runs cached native output.
86-
- `auto`: prefers AOT, falls back to JIT when AOT is unsupported or fails.
87-
88-
`package:cli_launcher` wrappers (for example, recent `melos`) are not compatible
89-
with reliable AOT execution in this model. In `auto` mode, drx falls back to JIT.
90-
91-
When run without arguments, `drx` shows the help screen.
92-
93-
Global flags can be placed before utility commands, for example:
17+
If PATH is not set for pub executables:
9418

9519
```bash
96-
drx --json versions gh:cli/cli
97-
drx --verbose cache list
20+
dart pub global run drx:drx --version
9821
```
9922

100-
## Security Policy
101-
102-
- GH asset checksum verification is required by default.
103-
- If no checksum manifest is present, execution is blocked.
104-
- `--allow-unsigned` explicitly bypasses that block.
105-
106-
## Make Your Tool drx-Compatible
107-
108-
See the maintainer guide:
109-
[`doc/compatibility.md`](https://github.com/leehack/drx/blob/main/doc/compatibility.md).
110-
111-
It covers:
112-
113-
- pub.dev executable compatibility requirements
114-
- GitHub Releases binary compatibility requirements
115-
- checksum formats and naming conventions
116-
- validation commands for both `pub` and `gh` sources
117-
118-
## Publish To pub.dev
23+
### Without Dart SDK (precompiled binary)
11924

120-
Dry-run validation:
25+
Linux / macOS:
12126

12227
```bash
123-
dart pub publish --dry-run
28+
curl -fsSL "https://raw.githubusercontent.com/leehack/drx/main/tool/install.sh" | DRX_REPO=leehack/drx sh
12429
```
12530

126-
Publish:
31+
Windows (PowerShell):
12732

128-
```bash
129-
dart pub publish
33+
```powershell
34+
$env:DRX_REPO = "leehack/drx"
35+
iwr "https://raw.githubusercontent.com/leehack/drx/main/tool/install.ps1" -UseBasicParsing | iex
13036
```
13137

132-
`drx` is intended as the publish name on pub.dev.
38+
Both installers verify checksums before installing.
13339

134-
## Install With Dart SDK (pub.dev)
40+
## Quick Usage
13541

136-
Install globally with pub:
42+
Default source is `pub`:
13743

13844
```bash
139-
dart pub global activate drx
45+
drx <package[@version]> [--] [args...]
46+
drx <package:executable[@version]> [--] [args...]
14047
```
14148

142-
Install a specific version:
49+
Explicit source selection:
14350

14451
```bash
145-
dart pub global activate drx 0.3.0
52+
drx --from pub:<package[@version]> <command> [--] [args...]
53+
drx --from gh:<owner>/<repo[@tag]> <command> [--] [args...]
14654
```
14755

148-
Run it:
56+
Examples:
14957

15058
```bash
151-
drx --version
152-
```
59+
drx melos -- --version
60+
drx mason_cli:mason -- --help
61+
drx --from pub:very_good_cli very_good -- --help
15362

154-
If your PATH is not configured for pub global executables:
63+
drx --from gh:cli/cli@v2.70.0 gh -- version
64+
drx --from gh:BurntSushi/ripgrep rg -- --version
65+
drx --from gh:junegunn/fzf fzf -- --version
66+
drx --from gh:charmbracelet/gum gum -- --version
15567

156-
```bash
157-
dart pub global run drx:drx --version
68+
# Some repos do not publish checksums:
69+
drx --allow-unsigned --from gh:sharkdp/fd fd -- --version
15870
```
15971

160-
Uninstall:
72+
## Useful Commands
16173

16274
```bash
163-
dart pub global deactivate drx
164-
```
165-
166-
## Install Without Dart SDK (Binary Options)
167-
168-
For users without Dart installed, publish precompiled binaries in GitHub
169-
Releases and provide platform-specific one-liner installers.
170-
171-
Recommended options:
172-
173-
1. `curl | sh` installer for Linux/macOS
174-
2. PowerShell installer for Windows
175-
3. Package managers (Homebrew tap, Scoop, winget, apt/rpm) as follow-ups
176-
177-
Typical one-liner patterns:
75+
drx cache list
76+
drx cache clean
77+
drx cache prune --max-age-days 30 --max-size-mb 2048
17878

179-
```bash
180-
# Linux/macOS
181-
curl -fsSL "https://raw.githubusercontent.com/leehack/drx/main/tool/install.sh" | DRX_REPO=leehack/drx sh
182-
```
79+
drx versions melos --limit 5
80+
drx versions gh:cli/cli --limit 10
18381

184-
```powershell
185-
# Windows PowerShell
186-
$env:DRX_REPO = "leehack/drx"
187-
iwr "https://raw.githubusercontent.com/leehack/drx/main/tool/install.ps1" -UseBasicParsing | iex
82+
drx --json versions gh:cli/cli
83+
drx --json cache list
18884
```
18985

190-
Install scripts download and verify the matching `.sha256` checksum before
191-
installing binaries.
86+
## Runtime Modes (pub source)
19287

193-
The repository includes ready workflows for CI and binary release publishing:
88+
- `--runtime auto` (default): prefer AOT, fallback to JIT
89+
- `--runtime jit`: `dart run`
90+
- `--runtime aot`: compile and run native executable
19491

195-
- `.github/workflows/ci.yml`
196-
- `.github/workflows/installer-smoke.yml`
197-
- `.github/workflows/release-binaries.yml`
92+
## Security Defaults
19893

199-
`release-binaries.yml` runs on pushed tags (`v*`) and also supports manual
200-
dispatch with a required `tag` input.
94+
- GitHub assets require checksum verification by default.
95+
- Unsigned assets are blocked unless you pass `--allow-unsigned`.
20196

202-
`installer-smoke.yml` validates one-liner install scripts on Linux/macOS/Windows
203-
across `x64` and `arm64` runners.
204-
205-
## Development
206-
207-
```bash
208-
dart pub get
209-
dart analyze
210-
dart test
211-
```
97+
## Platform Support
21298

213-
### Coverage
99+
- Linux: `x64`, `arm64`
100+
- macOS: `x64` (Intel), `arm64` (Apple Silicon)
101+
- Windows: `x64`, `arm64`
214102

215-
```bash
216-
dart test --coverage=coverage
217-
dart run coverage:format_coverage --packages=.dart_tool/package_config.json --report-on=lib --in=coverage --out=coverage/lcov.info --lcov --fail-under=80
218-
dart run tool/check_coverage.dart 80 coverage/lcov.info
219-
```
103+
## More Docs
220104

221-
The repository enforces 80%+ line coverage for `lib/`.
105+
- Tool maintainer compatibility guide: [`doc/compatibility.md`](https://github.com/leehack/drx/blob/main/doc/compatibility.md)
106+
- Project maintenance / release notes: [`doc/maintainers.md`](https://github.com/leehack/drx/blob/main/doc/maintainers.md)

doc/maintainers.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# drx Maintainer Guide
2+
3+
This document is for project maintainers and contributors.
4+
5+
## Local Development
6+
7+
```bash
8+
dart pub get
9+
dart analyze
10+
dart test
11+
```
12+
13+
Coverage check:
14+
15+
```bash
16+
dart test --coverage=coverage
17+
dart run coverage:format_coverage --packages=.dart_tool/package_config.json --report-on=lib --in=coverage --out=coverage/lcov.info --lcov --fail-under=80
18+
dart run tool/check_coverage.dart 80 coverage/lcov.info
19+
```
20+
21+
## CI and Release Workflows
22+
23+
- `/.github/workflows/ci.yml`
24+
- analyze + tests on Linux/macOS/Windows (`x64`, `arm64`) and coverage gate.
25+
- `/.github/workflows/installer-smoke.yml`
26+
- validates one-liner install scripts on Linux/macOS/Windows (`x64`, `arm64`).
27+
- `/.github/workflows/publish-pubdev.yml`
28+
- publishes to pub.dev when a tag like `vX.Y.Z` is pushed.
29+
- `/.github/workflows/release-binaries.yml`
30+
- builds and uploads release binaries/checksums for `v*` tags.
31+
32+
## pub.dev Trusted Publishing Setup
33+
34+
Configure once on pub.dev package admin page:
35+
36+
1. Enable **Automated publishing from GitHub Actions**.
37+
2. Repository: `leehack/drx`.
38+
3. Tag pattern: `v{{version}}`.
39+
40+
No `PUB_TOKEN` is required when trusted publishing is configured correctly.
41+
42+
## Release Checklist
43+
44+
1. Update version in:
45+
- `pubspec.yaml`
46+
- `lib/src/engine.dart`
47+
2. Add release notes to `CHANGELOG.md`.
48+
3. Validate:
49+
- `dart analyze`
50+
- `dart test`
51+
- `dart pub publish --dry-run`
52+
4. Commit and push `main`.
53+
5. Create and push tag:
54+
55+
```bash
56+
git tag vX.Y.Z
57+
git push origin vX.Y.Z
58+
```
59+
60+
Tag push triggers:
61+
62+
- pub.dev publish (`publish-pubdev.yml`)
63+
- binary release (`release-binaries.yml`)
64+
65+
## Manual Binary Rebuild for Existing Tag
66+
67+
Use workflow dispatch on `Release Binaries` with input tag, for example `v0.3.1`.
68+
69+
This is useful if a previous binary job failed and source code fixes were applied
70+
without changing the package version.
71+
72+
## Installer Smoke Testing Notes
73+
74+
- Installer scripts support `DRX_DOWNLOAD_BASE` override for local/test payloads.
75+
- This is used by installer smoke workflow to test the one-liner flow end-to-end
76+
without depending on external GitHub release artifacts.

lib/src/engine.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import 'pub_runner.dart';
1414
import 'version_lister.dart';
1515

1616
/// Current drx CLI version.
17-
const String drxVersion = '0.3.0';
17+
const String drxVersion = '0.3.1';
1818

1919
/// Command engine that coordinates parsing, resolution, and execution.
2020
final class DrxEngine {

0 commit comments

Comments
 (0)