Skip to content

Commit 4cfe973

Browse files
committed
chore: simplify release publishing
Remove crates.io and npm publishing from the release workflow so tags only produce GitHub Release artifacts. Document cargo install --git as the supported install path, remove the npm wrapper package, and bump termviz to 0.2.1 for the simplified release.
1 parent e7d9fbc commit 4cfe973

12 files changed

Lines changed: 31 additions & 296 deletions

File tree

.github/workflows/release.yml

Lines changed: 0 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,9 @@ jobs:
4747
run: |
4848
set -euo pipefail
4949
version="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n 1)"
50-
npm_version="$(node -p "require('./npm/termviz/package.json').version")"
5150
tag="${RELEASE_TAG#v}"
5251
5352
test "$version" = "$tag"
54-
test "$npm_version" = "$version"
5553
5654
echo "version=$version" >> "$GITHUB_OUTPUT"
5755
echo "tag=$RELEASE_TAG" >> "$GITHUB_OUTPUT"
@@ -154,123 +152,3 @@ jobs:
154152
--title "$TAG" \
155153
--notes-file "$NOTES_FILE"
156154
fi
157-
158-
crates-io:
159-
runs-on: ubuntu-latest
160-
needs: build-linux-x64
161-
env:
162-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
163-
steps:
164-
- uses: actions/checkout@v5
165-
with:
166-
ref: ${{ needs.build-linux-x64.outputs.tag }}
167-
- uses: dtolnay/rust-toolchain@stable
168-
169-
- name: Check crates.io package version
170-
id: crates-published
171-
env:
172-
VERSION: ${{ needs.build-linux-x64.outputs.version }}
173-
shell: bash
174-
run: |
175-
set -euo pipefail
176-
status="$(
177-
curl -sS -o /tmp/crate-version.json -w '%{http_code}' \
178-
-H "User-Agent: termviz-release (https://github.com/siriusctrl/termviz)" \
179-
"https://crates.io/api/v1/crates/termviz/$VERSION"
180-
)"
181-
case "$status" in
182-
200)
183-
echo "published=true" >> "$GITHUB_OUTPUT"
184-
;;
185-
404)
186-
echo "published=false" >> "$GITHUB_OUTPUT"
187-
;;
188-
*)
189-
echo "crates.io version check failed with HTTP $status"
190-
sed -n '1,120p' /tmp/crate-version.json
191-
exit 1
192-
;;
193-
esac
194-
195-
- name: Dry-run crates.io package
196-
run: cargo publish --dry-run --locked
197-
198-
- name: Publish to crates.io
199-
if: env.CARGO_REGISTRY_TOKEN != '' && steps.crates-published.outputs.published != 'true'
200-
run: cargo publish --locked --token "$CARGO_REGISTRY_TOKEN"
201-
202-
- name: Skip already published crates.io version
203-
if: steps.crates-published.outputs.published == 'true'
204-
run: echo "termviz ${{ needs.build-linux-x64.outputs.version }} is already published on crates.io."
205-
206-
- name: Skip crates.io publish
207-
if: env.CARGO_REGISTRY_TOKEN == '' && steps.crates-published.outputs.published != 'true'
208-
run: echo "CARGO_REGISTRY_TOKEN is not configured; skipped crates.io publish."
209-
210-
npm:
211-
runs-on: ubuntu-latest
212-
needs:
213-
- build-linux-x64
214-
- crates-io
215-
permissions:
216-
contents: read
217-
id-token: write
218-
env:
219-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
220-
steps:
221-
- uses: actions/checkout@v5
222-
with:
223-
ref: ${{ needs.build-linux-x64.outputs.tag }}
224-
225-
- uses: actions/download-artifact@v8
226-
with:
227-
name: termviz-linux-x64
228-
path: dist
229-
230-
- uses: actions/setup-node@v6
231-
with:
232-
node-version: "24"
233-
registry-url: "https://registry.npmjs.org"
234-
235-
- name: Check npm package version
236-
id: npm-published
237-
env:
238-
VERSION: ${{ needs.build-linux-x64.outputs.version }}
239-
shell: bash
240-
run: |
241-
set -euo pipefail
242-
status=0
243-
npm view "termviz@$VERSION" version >/tmp/npm-version.txt 2>/tmp/npm-view.err || status=$?
244-
if [ "$status" = "0" ]; then
245-
echo "published=true" >> "$GITHUB_OUTPUT"
246-
elif grep -q "E404" /tmp/npm-view.err; then
247-
echo "published=false" >> "$GITHUB_OUTPUT"
248-
else
249-
sed -n '1,120p' /tmp/npm-view.err
250-
exit "$status"
251-
fi
252-
253-
- name: Prepare npm package
254-
if: steps.npm-published.outputs.published != 'true'
255-
shell: bash
256-
run: |
257-
set -euo pipefail
258-
mkdir -p npm/termviz/vendor
259-
cp dist/termviz npm/termviz/vendor/termviz
260-
cp LICENSE npm/termviz/LICENSE
261-
chmod 755 npm/termviz/vendor/termviz
262-
node npm/termviz/bin/termviz.js --version
263-
npm pack --dry-run ./npm/termviz
264-
265-
- name: Publish to npm
266-
if: env.NODE_AUTH_TOKEN != '' && steps.npm-published.outputs.published != 'true'
267-
working-directory: npm/termviz
268-
run: npm publish --provenance --access public
269-
270-
- name: Skip already published npm version
271-
if: steps.npm-published.outputs.published == 'true'
272-
run: echo "termviz ${{ needs.build-linux-x64.outputs.version }} is already published on npm."
273-
274-
- name: Skip npm publish
275-
if: env.NODE_AUTH_TOKEN == '' && steps.npm-published.outputs.published != 'true'
276-
run: echo "NPM_TOKEN is not configured; skipped npm publish."

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
/.DS_Store
33
*.swp
44
*.swo
5-
/npm/termviz/LICENSE
6-
/npm/termviz/vendor/

CHANGELOG.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@ matching `## [X.Y.Z]` section before the release tag is pushed.
88

99
## [Unreleased]
1010

11+
## [0.2.1] - 2026-06-16
12+
13+
### Changed
14+
15+
- Simplify releases to GitHub Release artifacts plus `cargo install --git`.
16+
crates.io and npm publishing are no longer part of the release path.
17+
1118
## [0.2.0] - 2026-06-16
1219

1320
### Added
1421

15-
- Add a Linux x64 npm package wrapper that ships a prebuilt static `termviz`
16-
binary for `npm install -g termviz`.
1722
- Add a tag-driven release workflow that builds a static Linux x64 artifact,
18-
publishes GitHub Release assets, runs a crates.io dry-run, and publishes npm
19-
and crates.io when registry tokens are configured.
23+
publishes GitHub Release assets, and validates the Rust package locally.
2024
- Default redirected/export output to PNG when no `--output-format` is provided,
2125
while still inferring JSON/ANSI/SVG/PNG from optional `--output` extensions
2226
when they are recognized.
@@ -179,5 +183,5 @@ matching `## [X.Y.Z]` section before the release tag is pushed.
179183
- Interactive image viewing remains eager-decoded and not tile-based; the safety
180184
guard blocks very large rasters by default and provides a clear CLI error.
181185
- Explicit raster export paths still decode the full image.
182-
- crates.io publishing remains a release task until completed. npm prebuilt
183-
binaries are deliberately out of scope for 0.1.0.
186+
- Registry publishing is not part of the release path. Install from GitHub with
187+
`cargo install --git`.

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "termviz"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
edition = "2024"
55
rust-version = "1.85"
66
description = "Terminal-first viewer for images and plots"
@@ -9,7 +9,7 @@ repository = "https://github.com/siriusctrl/termviz"
99
readme = "README.md"
1010
keywords = ["terminal", "image", "plot", "viewer", "cli"]
1111
categories = ["command-line-utilities", "visualization"]
12-
exclude = [".github/", "npm/"]
12+
exclude = [".github/"]
1313

1414
[dependencies]
1515
ab_glyph = "0.2.32"

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ metadata and explicit exports.
1111
Install with Cargo:
1212

1313
```sh
14-
cargo install termviz
14+
cargo install --git https://github.com/siriusctrl/termviz
1515
```
1616

17-
Linux x64 users can also install the prebuilt static binary wrapper from npm:
17+
To install a tagged version:
1818

1919
```sh
20-
npm install -g termviz
20+
cargo install --git https://github.com/siriusctrl/termviz --tag v0.2.1
2121
```
2222

2323
```sh

docs/INDEX.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Read these when the task matches:
2020
- version and tag policy
2121
- changelog and release notes policy
2222
- GitHub Release artifacts and checksums
23-
- crates.io and npm publishing
23+
- `cargo install --git` install path
2424
- `docs/visual-verification.md`
2525
- PTY recording artifacts
2626
- keyframe/contact-sheet inspection

docs/releasing.md

Lines changed: 14 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ requirements.
88
## Release Rules
99

1010
- Use semantic versioning.
11-
- Keep version numbers aligned across all package manifests.
11+
- Keep the `Cargo.toml` version aligned with the release tag.
1212
- Add a `CHANGELOG.md` entry before tagging or publishing.
1313
- Never publish with placeholder release notes.
1414
- Use Conventional Commits with explanatory bodies.
@@ -63,71 +63,29 @@ Before publishing:
6363
2. Confirm GitHub Actions pass for formatting, tests, Clippy, and any release
6464
artifact jobs that exist.
6565
3. For tagged releases or manual dispatches, confirm the release workflow builds
66-
`termviz-linux-x64.tar.gz`, `sha256sums.txt`, and the npm vendor binary.
66+
`termviz-linux-x64.tar.gz` and `sha256sums.txt`.
6767
4. If CI is missing or incomplete for the release, record the local verification
6868
commands and results in the release PR or release notes.
6969

7070
## Release Artifacts
7171

7272
Release artifacts are a Linux x64 static binary tarball plus SHA-256 checksum.
73-
The same static binary is used as the npm package's `vendor/termviz` payload.
7473
The release workflow verifies that the binary has no glibc runtime interpreter
75-
before packaging, so `npm install -g termviz` installs a self-contained CLI
76-
tool for Linux x64 users.
74+
before packaging, so Linux x64 users can download a self-contained CLI from the
75+
GitHub Release page.
7776

78-
## crates.io
77+
## Install From Git
7978

80-
Run a dry-run before publishing:
79+
The supported package-manager-free install path is Cargo from GitHub:
8180

8281
```sh
83-
cargo publish --dry-run --locked
84-
```
85-
86-
Inspect the packaged contents before publishing if the dry-run output is
87-
surprising:
88-
89-
```sh
90-
cargo package --list --locked
91-
```
92-
93-
Publish only after the changelog entry, local checks, and CI are complete:
94-
95-
```sh
96-
cargo publish --locked
97-
```
98-
99-
After publishing, verify the crate page and install path:
100-
101-
```sh
102-
cargo install termviz --version X.Y.Z
82+
cargo install --git https://github.com/siriusctrl/termviz --tag vX.Y.Z
10383
termviz --version
10484
```
10585

106-
## npm
107-
108-
The npm package lives under `npm/termviz`. It is a binary distribution wrapper:
109-
`bin/termviz.js` validates `linux-x64`, then execs `vendor/termviz`.
110-
111-
The release workflow builds `x86_64-unknown-linux-musl`, copies the static
112-
binary into `npm/termviz/vendor/termviz`, copies `LICENSE`, runs the wrapper's
113-
`--version` command, runs `npm pack --dry-run`, and publishes when `NPM_TOKEN`
114-
is configured.
115-
116-
For a local smoke check before tagging:
117-
118-
```sh
119-
cargo build --release --locked
120-
mkdir -p npm/termviz/vendor
121-
cp target/release/termviz npm/termviz/vendor/termviz
122-
cp LICENSE npm/termviz/LICENSE
123-
chmod 755 npm/termviz/vendor/termviz
124-
npm pack --dry-run ./npm/termviz
125-
npm install --prefix /tmp/termviz-npm-smoke ./npm/termviz
126-
/tmp/termviz-npm-smoke/node_modules/.bin/termviz --version
127-
```
128-
129-
Prefer the release workflow for publishing so npm and GitHub Release artifacts
130-
use the same checked static binary.
86+
For local validation before tagging, run `scripts/release-verify.sh`. The script
87+
also runs `cargo package --locked --allow-dirty` as a non-publish packaging
88+
safety check.
13189

13290
## GitHub Release
13391

@@ -140,15 +98,15 @@ use the same checked static binary.
14098

14199
2. Create a GitHub Release for `vX.Y.Z`.
142100
3. Use the matching `CHANGELOG.md` section as the release notes.
143-
4. Attach `termviz-linux-x86_64.tar.gz` and its `.sha256` file if the release
144-
artifact workflow produced them.
101+
4. Attach `termviz-linux-x64.tar.gz` and `sha256sums.txt` if the release
102+
workflow produced them.
145103
5. Do not publish a GitHub Release with placeholder text such as "TBD",
146104
"initial release", or copied internal implementation phases.
147105

148106
## Post-Release
149107

150-
1. Confirm the GitHub Release, crates.io page, and install command point to the
151-
same version.
108+
1. Confirm the GitHub Release and `cargo install --git --tag vX.Y.Z` install
109+
command point to the same version.
152110
2. Confirm `CHANGELOG.md` still has an `Unreleased` section ready for future
153111
user-facing changes.
154112
3. If anything failed after publishing, document the follow-up in the next

npm/termviz/README.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

npm/termviz/bin/termviz.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)