Skip to content

Commit 021db26

Browse files
Julianclaude
andcommitted
Support rebuilding historical versions via IMPLEMENTATION_VERSION
Pin the installed jschon version from an optional build arg so build-all can (re)build and publish images for past versions, giving the UI a per-version compliance trend. An empty value (the normal build) installs the latest. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent db167c6 commit 021db26

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

.github/workflows/build-all.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,16 @@ jobs:
2626
- name: Collect available versions
2727
id: revisions
2828
run: |
29-
# Only the auto-created per-version release tags, plus current `main`.
30-
tags=$(jq -c -n '$ARGS.positional + ["main"]' --args $(git tag --list 'harness-release-*'))
31-
echo "value=${tags}" >> "$GITHUB_OUTPUT"
29+
# Each historical version is a {ref, version} pair: the tag to check out and the
30+
# version to pin via the `IMPLEMENTATION_VERSION` build arg.
31+
# `main` builds the current default (unpinned) and is additionally tagged `latest`.
32+
revisions=$(git tag --list 'harness-release-*' \
33+
| jq -R -c '{ref: ., version: ltrimstr("harness-release-")}' \
34+
| jq -s -c '. + [{ref: "main", version: ""}]')
35+
echo "value=${revisions}" >> "$GITHUB_OUTPUT"
3236
3337
build:
34-
name: Build
38+
name: Build (${{ matrix.revision.ref }})
3539
needs: versions
3640
strategy:
3741
# Backfill as many versions as possible; don't abort the rest on one failure.
@@ -46,6 +50,7 @@ jobs:
4650
artifact-metadata: write # needed for build provenance attestation
4751
uses: bowtie-json-schema/bowtie/.github/workflows/harness-ci.yml@a0ae283dca0a0d0eb2381a886d5499162f33c82a # main
4852
with:
49-
ref: ${{ matrix.revision }}
53+
ref: ${{ matrix.revision.ref }}
54+
build-args: ${{ matrix.revision.version != '' && format('IMPLEMENTATION_VERSION={0}', matrix.revision.version) || '' }}
5055
publish: true
51-
is-latest: ${{ matrix.revision == 'main' }}
56+
is-latest: ${{ matrix.revision.ref == 'main' }}

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
FROM python:3.15.0b4-alpine
22
WORKDIR /usr/src/myapp
3-
RUN python3 -m pip install jschon
3+
# Optionally pin the installed version so `build-all` can rebuild historical versions.
4+
# An empty value (the normal build) installs the latest release.
5+
ARG IMPLEMENTATION_VERSION
6+
RUN python3 -m pip install "jschon${IMPLEMENTATION_VERSION:+==${IMPLEMENTATION_VERSION}}"
47
COPY bowtie_jschon.py .
58
CMD ["python3", "bowtie_jschon.py"]

0 commit comments

Comments
 (0)