Skip to content

Commit 8b466e6

Browse files
committed
chore: release v0.2.2 — fix sync-go tag force-push, fix workflow bash expansion
1 parent 9cd1b19 commit 8b466e6

11 files changed

Lines changed: 165 additions & 13 deletions

File tree

.dockerignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Build artifacts — by far the largest directory, never needed in the image
2+
target/
3+
4+
# Development scratch files
5+
scratch/
6+
7+
# Documentation and specs — not needed at build time
8+
docs/
9+
specs/
10+
notes/
11+
12+
# npm / wasm packages
13+
npm/
14+
15+
# Go bindings
16+
# (if you ever add a vastlint-go subdirectory here)
17+
*.go
18+
*.h
19+
20+
# Editor and OS noise
21+
.DS_Store
22+
.idea/
23+
.vscode/
24+
*.code-workspace
25+
26+
# Git
27+
.git/
28+
.github/
29+
30+
# Secrets / env
31+
.env
32+
.env.*
33+
secrets/
34+
35+
# Test fixtures already embedded in the crate — scratch XMLs not needed
36+
scratch/*.xml

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ jobs:
353353
run: |
354354
TAG="${{ github.ref_name }}"
355355
cd vastlint-go
356-
git tag "$TAG"
357-
git push origin "$TAG"
356+
# Force-overwrite in case the tag was pushed manually before this job ran.
357+
git tag -f "$TAG"
358+
git push origin "$TAG" --force
358359

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# ─────────────────────────────────────────────────────────────────────────────
2+
# Stage 1 — build a fully-static musl binary
3+
#
4+
# rust:alpine is the right base for musl static builds: Alpine ships a native
5+
# musl toolchain so crates with C code (ring, via ureq/rustls) compile cleanly.
6+
# The debian-slim + musl-tools approach breaks ring because that musl-gcc
7+
# wrapper does not support the -m64 flag that ring's build script passes.
8+
# ─────────────────────────────────────────────────────────────────────────────
9+
FROM rust:alpine AS builder
10+
11+
# Alpine's native musl + build essentials for crates with C dependencies (ring)
12+
RUN apk add --no-cache musl-dev gcc make perl
13+
14+
WORKDIR /build
15+
16+
# Cache dependency compilation separately from source changes.
17+
# Copy manifests first so this layer is only invalidated when deps change.
18+
COPY Cargo.toml Cargo.lock ./
19+
COPY crates/vastlint-cli/Cargo.toml crates/vastlint-cli/Cargo.toml
20+
COPY crates/vastlint-core/Cargo.toml crates/vastlint-core/Cargo.toml
21+
COPY crates/vastlint-ffi/Cargo.toml crates/vastlint-ffi/Cargo.toml
22+
COPY crates/vastlint-wasm/Cargo.toml crates/vastlint-wasm/Cargo.toml
23+
24+
# Stub out every crate so Cargo can resolve and compile all dependencies
25+
# without the real source. The stubs are replaced by the real COPY below.
26+
RUN for crate in vastlint-cli vastlint-core vastlint-ffi vastlint-wasm; do \
27+
mkdir -p crates/$crate/src; \
28+
echo 'fn main() {}' > crates/$crate/src/main.rs; \
29+
echo '' > crates/$crate/src/lib.rs; \
30+
done
31+
32+
RUN cargo build --release --bin vastlint 2>/dev/null || true
33+
34+
# Now copy the real source and rebuild only what changed
35+
COPY crates/ crates/
36+
37+
RUN touch crates/vastlint-cli/src/main.rs \
38+
&& cargo build --release --bin vastlint
39+
40+
# ─────────────────────────────────────────────────────────────────────────────
41+
# Stage 2 — final image: scratch + the static binary only
42+
#
43+
# "scratch" is the absolute minimum: zero OS, zero shell, zero attack surface.
44+
# The binary is fully self-contained so nothing else is needed.
45+
# ─────────────────────────────────────────────────────────────────────────────
46+
FROM scratch
47+
48+
# Copy the static binary
49+
COPY --from=builder \
50+
/build/target/release/vastlint \
51+
/vastlint
52+
53+
# /data is the conventional mount point for XML files
54+
VOLUME ["/data"]
55+
56+
# Default: read from stdin, output plain text.
57+
# Override at runtime:
58+
# docker run --rm vastlint vastlint check /data/tag.xml --format json
59+
ENTRYPOINT ["/vastlint"]
60+
CMD ["check", "-"]

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,41 @@ CLI crate on crates.io: [crates.io/crates/vastlint](https://crates.io/crates/vas
3030

3131
Or download a pre-built binary from the [releases page](https://github.com/aleksUIX/vastlint/releases).
3232

33+
## Docker
34+
35+
Pull the image from Docker Hub:
36+
37+
```sh
38+
docker pull vastlint/vastlint
39+
```
40+
41+
**Validate a file:**
42+
43+
```sh
44+
docker run --rm -v "$(pwd)":/data vastlint/vastlint check /data/tag.xml
45+
```
46+
47+
**Pipe from stdin:**
48+
49+
```sh
50+
cat tag.xml | docker run --rm -i vastlint/vastlint check -
51+
```
52+
53+
**JSON output:**
54+
55+
```sh
56+
docker run --rm -v "$(pwd)":/data vastlint/vastlint check /data/tag.xml --format json
57+
```
58+
59+
**Validate a whole directory:**
60+
61+
```sh
62+
docker run --rm -v "$(pwd)/tags":/data vastlint/vastlint check /data/*.xml
63+
```
64+
65+
The image is built `FROM scratch` — a fully-static musl binary with no OS layer.
66+
Compressed size is under 5 MB. Cold-start to first result is under 10 ms.
67+
3368
## Usage
3469

3570
```

crates/vastlint-cli/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "vastlint-cli"
3-
version = "0.2.1"
3+
version = "0.2.2"
44
edition = "2021"
55
rust-version = "1.75"
66
authors = ["Aleks <aleks@vastlint.org>"]
@@ -17,7 +17,7 @@ name = "vastlint"
1717
path = "src/main.rs"
1818

1919
[dependencies]
20-
vastlint-core = { path = "../vastlint-core", version = "0.2.1" }
20+
vastlint-core = { path = "../vastlint-core", version = "0.2.2" }
2121
# Argument parsing
2222
clap = { version = "4", features = ["derive"] }
2323
# Coloured terminal output

crates/vastlint-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "vastlint-core"
3-
version = "0.2.1"
3+
version = "0.2.2"
44
edition = "2021"
55
rust-version = "1.75"
66
authors = ["Aleks <aleks@vastlint.org>"]

crates/vastlint-ffi/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "vastlint-ffi"
3-
version = "0.2.1"
3+
version = "0.2.2"
44
edition = "2021"
55
rust-version = "1.75"
66
authors = ["Aleks <aleks@vastlint.org>"]

crates/vastlint-wasm/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "vastlint-wasm"
3-
version = "0.2.1"
3+
version = "0.2.2"
44
edition = "2021"
55
rust-version = "1.75"
66
authors = ["Aleks <aleks@vastlint.org>"]
@@ -15,7 +15,7 @@ categories = ["parser-implementations", "wasm"]
1515
crate-type = ["cdylib"]
1616

1717
[dependencies]
18-
vastlint-core = { path = "../vastlint-core", version = "0.2.1" }
18+
vastlint-core = { path = "../vastlint-core", version = "0.2.2" }
1919
wasm-bindgen = "0.2"
2020
serde = { version = "1", features = ["derive"] }
2121
serde-wasm-bindgen = "0.6"

docker-compose.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# docker-compose.yml — local build and test helper
2+
#
3+
# Build: docker compose build
4+
# Run: docker compose run --rm vastlint check /data/tag.xml
5+
# Stdin: cat tag.xml | docker compose run --rm -T vastlint check -
6+
# JSON: docker compose run --rm vastlint check /data/tag.xml --format json
7+
8+
services:
9+
vastlint:
10+
build:
11+
context: .
12+
dockerfile: Dockerfile
13+
image: vastlint:local
14+
# Mount a local directory of XML files at /data inside the container.
15+
# Change ./scratch to any directory containing your VAST XML files.
16+
volumes:
17+
- ./scratch:/data:ro
18+
# Keep stdin open so `check -` (piped input) works.
19+
stdin_open: true
20+
tty: false

0 commit comments

Comments
 (0)