diff --git a/.claude/commands/release.md b/.claude/skills/release/SKILL.md similarity index 97% rename from .claude/commands/release.md rename to .claude/skills/release/SKILL.md index e40f975..c734389 100644 --- a/.claude/commands/release.md +++ b/.claude/skills/release/SKILL.md @@ -1,3 +1,9 @@ +--- +name: release +description: Release +user_invocable: true +--- + # Release Prepare a release PR for initium. This command handles version bumping, changelog updates, and PR creation. The release is published automatically when the PR merges (CI detects the version bump and creates the tag, which triggers the release workflow). diff --git a/CHANGELOG.md b/CHANGELOG.md index e0267e6..1892414 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed +- Docker dependency cache now survives version-only bumps by normalizing the root package version in a preparatory build stage. + +## [1.3.0] - 2026-03-12 + ### Added - Auto-tag workflow: CI automatically creates a git tag when `Cargo.toml` version changes on main, triggering the release workflow. - `/release` skill for Claude Code: guided release preparation with version determination, confirmation, and PR creation. - `ignore_columns` option for reconcile mode tables: columns listed in `ignore_columns` are included in the initial INSERT but excluded from change detection, UPDATE statements, and content hash computation. Useful for timestamps, tokens, or values managed by database triggers. +### Changed +- Moved `/release` from Claude Code command to skill (directory-based `SKILL.md` format). + ### Fixed - Replaced Dockerfile `--mount=type=cache` with dependency layer caching ("empty main" trick) for reliable Docker build caching in GitHub Actions, where `--mount=type=cache` does not persist across runners. diff --git a/Cargo.lock b/Cargo.lock index 5f1842c..dbb6c8a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -989,7 +989,7 @@ dependencies = [ [[package]] name = "initium" -version = "1.2.0" +version = "1.3.0" dependencies = [ "base64 0.22.1", "clap", diff --git a/Cargo.toml b/Cargo.toml index bd3cd7d..6926259 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "initium" -version = "1.2.0" +version = "1.3.0" edition = "2021" rust-version = "1.88" authors = ["Kitstream "] diff --git a/Dockerfile b/Dockerfile index 50428e5..c52bafc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,17 @@ +# Normalize root package version so the dependency cache survives version-only bumps. +# BuildKit uses content-based caching for COPY --from; the sed output is identical +# when only the version changed, so the expensive cargo build layer stays cached. +FROM rust:1.88-alpine AS deps +WORKDIR /src +COPY Cargo.toml Cargo.lock ./ +RUN sed -i '/^name = "initium"/{n;s/^version = ".*"/version = "0.0.0"/;}' Cargo.toml && \ + sed -i '/^name = "initium"/{n;s/^version = ".*"/version = "0.0.0"/;}' Cargo.lock + FROM rust:1.88-alpine AS builder ARG VERSION=dev RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static perl WORKDIR /src -COPY Cargo.toml Cargo.lock ./ +COPY --from=deps /src/Cargo.toml /src/Cargo.lock ./ RUN mkdir src && echo 'fn main() {}' > src/main.rs && \ cargo build --release && \ rm -rf src target/release/deps/initium* target/release/initium* diff --git a/jyq.Dockerfile b/jyq.Dockerfile index 63e5c07..fad0f12 100644 --- a/jyq.Dockerfile +++ b/jyq.Dockerfile @@ -1,8 +1,17 @@ +# Normalize root package version so the dependency cache survives version-only bumps. +# BuildKit uses content-based caching for COPY --from; the sed output is identical +# when only the version changed, so the expensive cargo build layer stays cached. +FROM rust:1.88-alpine AS deps +WORKDIR /src +COPY Cargo.toml Cargo.lock ./ +RUN sed -i '/^name = "initium"/{n;s/^version = ".*"/version = "0.0.0"/;}' Cargo.toml && \ + sed -i '/^name = "initium"/{n;s/^version = ".*"/version = "0.0.0"/;}' Cargo.lock + FROM rust:1.88-alpine AS builder ARG VERSION=dev RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static perl WORKDIR /src -COPY Cargo.toml Cargo.lock ./ +COPY --from=deps /src/Cargo.toml /src/Cargo.lock ./ RUN mkdir src && echo 'fn main() {}' > src/main.rs && \ cargo build --release && \ rm -rf src target/release/deps/initium* target/release/initium*