Skip to content

Commit cd5a389

Browse files
committed
more work
1 parent 1afef69 commit cd5a389

File tree

28 files changed

+3230
-188
lines changed

28 files changed

+3230
-188
lines changed

CLAUDE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,19 @@ This ensures we always get the latest compatible version and properly updates Ca
218218

219219
**CRITICAL**: Keep files small and modular. As soon as a file approaches 200-300 lines, break it up into modules and smaller files. DO NOT wait for the user to remind you. Proactively refactor large files into:
220220

221+
## Releases (GitHub + Docker)
222+
223+
1. Update versions:
224+
- `Cargo.toml`
225+
- `plugins/provider-circleci/Cargo.toml`
226+
- `plugins/provider-github/Cargo.toml`
227+
2. Run `cargo update -p cigen`.
228+
3. Commit the version bump and any release notes.
229+
4. Tag with `git tag vX.Y.Z` (push tag to trigger workflow) or trigger `.github/workflows/release.yml` manually.
230+
- The workflow builds archives for macOS/Linux and publishes them via `softprops/action-gh-release`.
231+
- It also builds/pushes `docspringcom/cigen:<version>` and `:latest` from the repository `Dockerfile`.
232+
5. Update `docker/ci-runner/Dockerfile` (if it depends on the version) and rebuild/push via `scripts/build-ci-runner.sh` + `docker push docspring/cigen-ci-runner:latest`.
233+
221234
- Separate modules for distinct functionality
222235
- Helper functions in their own files
223236
- Traits and implementations in separate files

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
members = [
33
".",
44
"plugins/provider-github",
5+
"plugins/provider-circleci",
56
]
67
resolver = "2"
78

docker/ci-runner/Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM rust:latest
22

3+
ARG CIGEN_VERSION=0.1.0
4+
35
# Install system dependencies required for GitHub Actions runners and cigen builds.
46
# We keep this minimal while covering:
57
# - Node/npm for JavaScript-based actions (actions/cache, download/upload-artifact)
@@ -26,6 +28,27 @@ RUN set -euxo pipefail \
2628
# additional installs in individual jobs.
2729
RUN corepack enable
2830

31+
ENV CIGEN_PLUGIN_DIR=/usr/local/lib/cigen/plugins
32+
33+
RUN set -euxo pipefail; \
34+
arch="$(uname -m)"; \
35+
case "$arch" in \
36+
x86_64) asset_suffix="linux_amd64" ;; \
37+
aarch64) asset_suffix="linux_arm64" ;; \
38+
*) echo "Unsupported architecture: $arch" >&2; exit 1 ;; \
39+
esac; \
40+
tarball="cigen_${CIGEN_VERSION}_${asset_suffix}.tar.gz"; \
41+
curl -fsSL -o "/tmp/${tarball}" "https://github.com/DocSpring/cigen/releases/download/v${CIGEN_VERSION}/${tarball}"; \
42+
curl -fsSL -o "/tmp/${tarball}.sha256" "https://github.com/DocSpring/cigen/releases/download/v${CIGEN_VERSION}/${tarball}.sha256"; \
43+
(cd /tmp && sha256sum -c "${tarball}.sha256"); \
44+
mkdir -p /tmp/cigen-dist; \
45+
tar -xzf "/tmp/${tarball}" -C /tmp/cigen-dist; \
46+
install -m0755 /tmp/cigen-dist/cigen /usr/local/bin/cigen; \
47+
mkdir -p "$CIGEN_PLUGIN_DIR"; \
48+
install -m0755 /tmp/cigen-dist/cigen-provider-circleci "$CIGEN_PLUGIN_DIR"/cigen-provider-circleci; \
49+
install -m0755 /tmp/cigen-dist/cigen-provider-github "$CIGEN_PLUGIN_DIR"/cigen-provider-github; \
50+
rm -rf /tmp/${tarball} /tmp/${tarball}.sha256 /tmp/cigen-dist
51+
2952
ENV RUSTUP_HOME=/usr/local/rustup \
3053
CARGO_HOME=/usr/local/cargo \
3154
PATH=/usr/local/cargo/bin:$PATH \

docker/cigen-bootstrap/Dockerfile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
ARG CIGEN_VERSION=0.1.0
2+
3+
FROM debian:bookworm-slim AS runtime
4+
5+
ARG CIGEN_VERSION
6+
ENV CIGEN_VERSION=${CIGEN_VERSION}
7+
ENV CIGEN_PLUGIN_DIR=/usr/local/lib/cigen/plugins
8+
9+
RUN set -euxo pipefail \
10+
&& apt-get update \
11+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
12+
bash \
13+
ca-certificates \
14+
curl \
15+
git \
16+
jq \
17+
tar \
18+
unzip \
19+
&& rm -rf /var/lib/apt/lists/*
20+
21+
RUN set -euxo pipefail; \
22+
arch="$(dpkg --print-architecture)"; \
23+
case "$arch" in \
24+
amd64) asset_suffix="linux_amd64" ;; \
25+
arm64) asset_suffix="linux_arm64" ;; \
26+
*) echo "Unsupported architecture: ${arch}" >&2; exit 1 ;; \
27+
esac; \
28+
tarball="cigen_${CIGEN_VERSION}_${asset_suffix}.tar.gz"; \
29+
curl -fsSL -o "/tmp/${tarball}" \
30+
"https://github.com/DocSpring/cigen/releases/download/v${CIGEN_VERSION}/${tarball}"; \
31+
curl -fsSL -o "/tmp/${tarball}.sha256" \
32+
"https://github.com/DocSpring/cigen/releases/download/v${CIGEN_VERSION}/${tarball}.sha256"; \
33+
(cd /tmp && sha256sum -c "${tarball}.sha256"); \
34+
mkdir -p /tmp/cigen-dist; \
35+
tar -xzf "/tmp/${tarball}" -C /tmp/cigen-dist; \
36+
install -m0755 /tmp/cigen-dist/cigen /usr/local/bin/cigen; \
37+
mkdir -p "${CIGEN_PLUGIN_DIR}"; \
38+
install -m0755 /tmp/cigen-dist/cigen-provider-circleci "${CIGEN_PLUGIN_DIR}/cigen-provider-circleci"; \
39+
install -m0755 /tmp/cigen-dist/cigen-provider-github "${CIGEN_PLUGIN_DIR}/cigen-provider-github"; \
40+
rm -rf /tmp/${tarball} /tmp/${tarball}.sha256 /tmp/cigen-dist
41+
42+
RUN adduser --disabled-password --gecos "" cigen \
43+
&& mkdir -p /workspace \
44+
&& chown -R cigen:cigen /workspace
45+
46+
USER cigen
47+
WORKDIR /workspace
48+
49+
ENTRYPOINT ["/bin/bash"]

docker/cigen-bootstrap/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# CIGen Bootstrap Image
2+
3+
This image packages a ready-to-run copy of `cigen` plus its provider plugins. The CircleCI
4+
setup workflow pulls this image so it can generate the continuation config and compute
5+
skip caches without compiling from source.
6+
7+
## Building
8+
9+
```
10+
# Build multi-arch image (requires buildx)
11+
docker buildx build \
12+
--platform linux/amd64,linux/arm64 \
13+
--build-arg CIGEN_VERSION=0.1.0 \
14+
-t docspringcom/cigen:0.1.0 \
15+
-f docker/cigen-bootstrap/Dockerfile \
16+
.
17+
```
18+
19+
## Pushing
20+
21+
```
22+
docker buildx build \
23+
--platform linux/amd64,linux/arm64 \
24+
--build-arg CIGEN_VERSION=0.1.0 \
25+
-t docspringcom/cigen:0.1.0 \
26+
-f docker/cigen-bootstrap/Dockerfile \
27+
--push \
28+
.
29+
```
30+
31+
Make sure you are logged in (`docker login`) before pushing.
32+
33+
The image installs `cigen` to `/usr/local/bin/cigen` and the plugins to
34+
`/usr/local/lib/cigen/plugins`. The setup workflow points `CIGEN_PLUGIN_DIR` to that
35+
path automatically.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[package]
2+
name = "cigen-provider-circleci"
3+
version = "0.1.0"
4+
edition = "2024"
5+
description = "CircleCI provider plugin for cigen"
6+
license = "MIT"
7+
authors = ["DocSpring Inc"]
8+
9+
[dependencies]
10+
anyhow = { workspace = true }
11+
clap = { version = "4.5.41", features = ["derive"] }
12+
serde = { workspace = true }
13+
serde_yaml = "0.9.34"
14+
tonic = { workspace = true }
15+
prost = { workspace = true }
16+
tonic-prost = { workspace = true }
17+
tracing = { workspace = true }
18+
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
19+
serde_json = { workspace = true }
20+
thiserror = "2.0.12"
21+
yaml-spanned = "0.0.2"
22+
23+
[dependencies.cigen]
24+
path = "../../"

0 commit comments

Comments
 (0)