fix(ci): pass the community scope guard and publish release artifacts before registry steps

- the community scope guard rejected the innocuous English comment 'One timed
  resources/list' in the Story 3.8 discovery diagnostic (its 'one-time-token'
  marker matches any 'one time' phrase). Reword the comment; no behaviour change.
- move the release artifact publication ahead of the registry/OpenBao steps, so a
  credential problem cannot leave the archives, checksums and SBOM unpublished.
This commit is contained in:
bsodfather committed 2026-10-25 09:27:55 +00:00
1 parent 54ce770682
commit f2fd204367
2 files changed
+51 -50

No files matched your search

+49 -48
View File
@@ -178,6 +178,55 @@ jobs:
dir:/workspace -o spdx-json \
> dist/crank-community-${IMAGE_TAG}-sbom.spdx.json
- name: Write release notes
run: |
set -eu
tag="${{ gitea.ref_name }}"
{
echo "## Crank Community ${tag}"
echo
echo "Source commit: \`$(git rev-parse HEAD)\`"
echo
echo "### Changes"
echo
git log --oneline -25 | sed 's/^/- /'
echo
echo "### Artifacts and checksums"
echo
echo '```'
cat "dist/crank-community-${tag}-checksums.txt"
echo '```'
} > dist/RELEASE-NOTES.md
cat dist/RELEASE-NOTES.md
# The archives, the checksums and the SBOM only exist inside the runner workspace until they are
# attached to the release entry: publish them so a released version keeps its artifacts, and do
# it before the registry steps so an image-credential problem cannot lose them.
- name: Publish artifacts to the Gitea release
env:
RELEASE_TOKEN: ${{ secrets.GITEA_TOKEN }}
FALLBACK_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -eu
tag="${{ gitea.ref_name }}"
token="${RELEASE_TOKEN:-${FALLBACK_TOKEN:-}}"
if [ -z "$token" ]; then
echo "No Gitea token is available to the workflow: the release artifacts stay in the runner workspace" >&2
exit 1
fi
prerelease=""
case "$tag" in
*-*) prerelease="--prerelease" ;;
esac
GITEA_TOKEN="$token" python3 scripts/publish-gitea-release.py \
--api "${{ gitea.server_url }}/api/v1" \
--repo "${{ gitea.repository }}" \
--tag "$tag" \
--title "Crank Community ${tag}" \
--notes-file dist/RELEASE-NOTES.md \
--dist dist \
$prerelease
- name: Load deployment secrets from OpenBao
env:
BAO_ADDR: ${{ secrets.BAO_ADDR }}
@@ -243,51 +292,3 @@ jobs:
- name: Show release bundle summary
run: |
ls -lh dist
- name: Write release notes
run: |
set -eu
tag="${{ gitea.ref_name }}"
{
echo "## Crank Community ${tag}"
echo
echo "Source commit: \`$(git rev-parse HEAD)\`"
echo
echo "### Changes"
echo
git log --oneline -25 | sed 's/^/- /'
echo
echo "### Artifacts and checksums"
echo
echo '```'
cat "dist/crank-community-${tag}-checksums.txt"
echo '```'
} > dist/RELEASE-NOTES.md
cat dist/RELEASE-NOTES.md
# The archives, the checksums and the SBOM only exist inside the runner workspace until they are
# attached to the release entry: publish them so a released version keeps its artifacts.
- name: Publish artifacts to the Gitea release
env:
RELEASE_TOKEN: ${{ secrets.GITEA_TOKEN }}
FALLBACK_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -eu
tag="${{ gitea.ref_name }}"
token="${RELEASE_TOKEN:-${FALLBACK_TOKEN:-}}"
if [ -z "$token" ]; then
echo "No Gitea token is available to the workflow: the release artifacts stay in the runner workspace" >&2
exit 1
fi
prerelease=""
case "$tag" in
*-*) prerelease="--prerelease" ;;
esac
GITEA_TOKEN="$token" python3 scripts/publish-gitea-release.py \
--api "${{ gitea.server_url }}/api/v1" \
--repo "${{ gitea.repository }}" \
--tag "$tag" \
--title "Crank Community ${tag}" \
--notes-file dist/RELEASE-NOTES.md \
--dist dist \
$prerelease
@@ -114,8 +114,8 @@ fn now_rfc3339() -> String {
.unwrap_or_else(|error| format!("unformatted-utc ({error})"))
}
/// One timed `resources/list`, built directly on `reqwest` so transport/timeout/HTTP failures are
/// recorded as outcomes instead of aborting the run.
/// A single timed `resources/list` call, built directly on `reqwest` so transport/timeout/HTTP
/// failures are recorded as outcomes instead of aborting the run.
async fn timed_list(
endpoint: &ResourceEndpoint,
revision: &'static str,