Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

ci(bcr): name an attached release archive as the BCR source

Motivation: the Bazel Central Registry presubmit of progmasoft_catch3@0.5.0
(bazel-central-registry#12131) failed: tools/bcr_validation.py rejects
GitHub's tag archives (/archive/refs/tags/...) as unstable, since GitHub
does not promise their bytes stay the same.

Changes:
- .bcr/source.template.json names
  https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/catch3-{VERSION}.tar.xz
  with strip_prefix catch3-{VERSION}.
- publish-to-bcr.yml gains an `archive` job, run before `publish`: it
  checks out the tag, makes `git archive` through `xz -9e -T1` (the recipe
  of the storage.catch3.uk source archives) and attaches it with its
  .sha256sums to the release, unless it is already attached. publish-to-bcr
  takes the entry's integrity from that attached file.

Edge cases: a release that already has the archive (0.5.0, attached by
hand on 2026-12-03) is left alone; the checkout keeps no credentials.

Verification: the 0.5.0 entry with this URL passes
tools/bcr_validation.py --check progmasoft_catch3@0.5.0 locally (only the
maintainer review of a new module remains); zizmor reports no findings;
the workflow parses as YAML.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Commit
f8512a49fc1805a529e131b9bed58ea40ab0b267
Author
Leitwolf11 ·
Parents
ebad99d7aa31

Files · Download .tar.gz

Changes

 .bcr/source.template.json            |  4 ++--
 .github/workflows/publish-to-bcr.yml | 31 +++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/.bcr/source.template.json b/.bcr/source.template.json
index e68c53b4..3c5b285c 100644
--- a/.bcr/source.template.json
+++ b/.bcr/source.template.json
@@ -1,5 +1,5 @@
 {
   "integrity": "",
-  "strip_prefix": "{REPO}-{TAG}",
-  "url": "https://github.com/{OWNER}/{REPO}/archive/refs/tags/{TAG}.tar.gz"
+  "strip_prefix": "catch3-{VERSION}",
+  "url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/catch3-{VERSION}.tar.xz"
 }
diff --git a/.github/workflows/publish-to-bcr.yml b/.github/workflows/publish-to-bcr.yml
index beac20a0..797b537e 100644
--- a/.github/workflows/publish-to-bcr.yml
+++ b/.github/workflows/publish-to-bcr.yml
@@ -19,7 +19,38 @@ on:
 permissions: {}
 
 jobs:
+  # The registry rejects GitHub's tag archives as unstable, so the source the
+  # BCR entry names (.bcr/source.template.json) is attached to the release:
+  # `git archive` of the tag through `xz -9e -T1`, the recipe of the source
+  # archives on storage.catch3.uk. The entry's integrity is taken from the
+  # attached file itself, so its bytes need not match another xz's.
+  archive:
+    if: startsWith(github.event.release.tag_name || inputs.tag_name, 'catch3-')
+    runs-on: ubuntu-24.04
+    permissions:
+      contents: write
+    env:
+      TAG: ${{ github.event.release.tag_name || inputs.tag_name }}
+      GH_TOKEN: ${{ github.token }}
+    steps:
+      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+        with:
+          ref: ${{ env.TAG }}
+          persist-credentials: false
+      - name: Attach the source archive
+        run: |
+          version="${TAG#catch3-}"
+          name="catch3-${version}.tar.xz"
+          if gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json assets --jq '.assets[].name' | grep -qx "$name"; then
+            echo "$name is already attached"
+            exit 0
+          fi
+          git archive --format=tar --prefix="catch3-${version}/" "$TAG" | xz -9e -T1 -c > "$name"
+          sha256sum "$name" > "$name.sha256sums"
+          gh release upload "$TAG" "$name" "$name.sha256sums" --repo "$GITHUB_REPOSITORY"
+
   publish:
+    needs: archive
     if: startsWith(github.event.release.tag_name || inputs.tag_name, 'catch3-')
     uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@3b1b972e41764b9a7498cf9128ed4ed2258a3687 # v1.6.0
     with: