ci: безопасно интегрировать принятый Crank и отделить production deploy #105

Merged
bsodfather merged 17 commits from ops/separate-production-deploy into main 2026-10-26 21:36:10 +00:00
2 changed files with 51 additions and 50 deletions
Showing only changes of commit 9567bbf3aa - Show all commits

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,