chore(release): remove the canary, release news, changelog and Woodpecker pipelines (#1917)
This commit is contained in:
36 files changed
+60
-7651
No files matched your search
@@ -1,51 +0,0 @@
|
||||
name: canary
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "*/15 * * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: canary
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
judge:
|
||||
if: vars.CANARY_URL != ''
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: main
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Log in to the Gitea registry
|
||||
run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login git.catlow.cloud -u "${{ github.actor }}" --password-stdin
|
||||
|
||||
- name: Fetch the published archied
|
||||
# The deploy workflow already built this binary. edge is the newest
|
||||
# main that passed the gate.
|
||||
run: |
|
||||
set -e
|
||||
image=git.catlow.cloud/sam/archied:edge
|
||||
docker pull -q "$image"
|
||||
container="$(docker create "$image")"
|
||||
docker cp "$container:/usr/local/bin/archied" "$RUNNER_TEMP/archied"
|
||||
docker rm "$container" >/dev/null
|
||||
|
||||
- name: Judge the canary
|
||||
env:
|
||||
ARCHIE_CANARY_TOKEN: ${{ secrets.CANARY_TOKEN }}
|
||||
CANARY_WINDOW: ${{ vars.CANARY_WINDOW }}
|
||||
run: |
|
||||
window_args=()
|
||||
if [ -n "$CANARY_WINDOW" ]; then
|
||||
window_args=(-window "$CANARY_WINDOW")
|
||||
fi
|
||||
"$RUNNER_TEMP/archied" release canary check -dashboard "${{ vars.CANARY_URL }}" \
|
||||
"${window_args[@]}" \
|
||||
-latest git.catlow.cloud/sam/archied,git.catlow.cloud/sam/archie-agent
|
||||
@@ -2,11 +2,10 @@ name: deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
tags: ["v*"]
|
||||
|
||||
concurrency:
|
||||
group: ${{ startsWith(github.ref, 'refs/tags/') && format('deploy-release-{0}', github.sha) || format('deploy-{0}', github.ref) }}
|
||||
group: deploy-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
@@ -18,46 +17,19 @@ jobs:
|
||||
runs-on: self-hosted
|
||||
outputs:
|
||||
archied_version: ${{ steps.release_tag.outputs.archied_version }}
|
||||
run: ${{ steps.release_tag.outputs.run }}
|
||||
sha: ${{ steps.release_tag.outputs.sha }}
|
||||
component: ${{ steps.release_tag.outputs.component }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Resolve archied tag at HEAD
|
||||
- name: Resolve the release
|
||||
id: release_tag
|
||||
run: |
|
||||
version="$(git tag --points-at HEAD --list 'v*' | sed -e 's|^v||' | sort -V | tail -1)"
|
||||
echo "archied_version=$version" >> "$GITHUB_OUTPUT"
|
||||
if [ -n "$version" ]; then
|
||||
echo "archied release at HEAD: $version"
|
||||
else
|
||||
echo "no release tag at HEAD; distribution zip will be skipped"
|
||||
fi
|
||||
# An annotated tag makes GITHUB_SHA the tag object, so the commit is
|
||||
# resolved from the ref: image tags pin it.
|
||||
sha="$(git rev-parse "${GITHUB_REF}^{commit}")"
|
||||
echo "sha=$sha" >> "$GITHUB_OUTPUT"
|
||||
# A release reports its version; any other build of main names its commit.
|
||||
echo "component=${version:-dev+${sha:0:12}}" >> "$GITHUB_OUTPUT"
|
||||
run=true
|
||||
case "$GITHUB_REF" in
|
||||
refs/tags/*) ;;
|
||||
*)
|
||||
if [ -n "$version" ]; then
|
||||
run=false
|
||||
echo "the v$version tag push runs this commit; skipping the branch run"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
echo "run=$run" >> "$GITHUB_OUTPUT"
|
||||
echo "archied_version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
|
||||
echo "sha=$(git rev-parse "${GITHUB_REF}^{commit}")" >> "$GITHUB_OUTPUT"
|
||||
|
||||
gate:
|
||||
needs: plan
|
||||
if: needs.plan.outputs.run == 'true'
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -105,14 +77,9 @@ jobs:
|
||||
env:
|
||||
RELEASE_VERSION: ${{ needs.plan.outputs.archied_version }}
|
||||
run: |
|
||||
# A release also builds the binaries it ships, in the same task run:
|
||||
# the dashboard is built once and the tree that passed is the tree
|
||||
# that is published.
|
||||
if [ -n "$RELEASE_VERSION" ]; then
|
||||
task check dist TEST_FLAGS=-count=1 VERSION="$RELEASE_VERSION"
|
||||
else
|
||||
task check TEST_FLAGS=-count=1
|
||||
fi
|
||||
# The binaries the release ships are built in the same task run, so
|
||||
# the tree that passed is the tree that is published.
|
||||
task check dist TEST_FLAGS=-count=1 VERSION="$RELEASE_VERSION"
|
||||
git diff --exit-code
|
||||
|
||||
- name: Vulnerability scan
|
||||
@@ -120,39 +87,11 @@ jobs:
|
||||
go install golang.org/x/vuln/cmd/govulncheck@v1.9.0
|
||||
govulncheck ./...
|
||||
|
||||
- name: Release tags must match changelogs
|
||||
run: |
|
||||
set -e
|
||||
fail=0
|
||||
for tag in $(git tag --points-at HEAD); do
|
||||
case "$tag" in
|
||||
v*)
|
||||
ver="${tag#v}"
|
||||
echo " release tag $tag -> looking for [$ver] in CHANGELOG.md"
|
||||
grep -q "^## \\[$ver\\]" CHANGELOG.md || {
|
||||
echo " FAIL: CHANGELOG.md has no [$ver] section"
|
||||
fail=1
|
||||
}
|
||||
;;
|
||||
esac
|
||||
done
|
||||
if [ $fail -ne 0 ]; then
|
||||
echo
|
||||
echo "A release tag points at this commit but its changelog does not"
|
||||
echo "describe that version. Cut releases with the release workflow."
|
||||
exit 1
|
||||
fi
|
||||
if ! git tag --points-at HEAD | grep -qE '^v[0-9]' ; then
|
||||
echo "This commit isn't a release, so the images are published as :edge and sha-<sha>; :latest keeps naming the newest promoted release."
|
||||
fi
|
||||
|
||||
- name: Package the release binaries
|
||||
if: needs.plan.outputs.archied_version != ''
|
||||
# tar keeps the executable bit, which an uploaded artifact drops.
|
||||
run: tar -cf release-binaries.tar dist
|
||||
|
||||
- name: Upload the release binaries
|
||||
if: needs.plan.outputs.archied_version != ''
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release-binaries
|
||||
@@ -185,21 +124,17 @@ jobs:
|
||||
context: .
|
||||
file: Dockerfile.archied
|
||||
push: true
|
||||
# The first line is empty for a build of main; empty lines are ignored.
|
||||
tags: |
|
||||
${{ needs.plan.outputs.archied_version != '' && format('git.catlow.cloud/sam/archied:v{0}', needs.plan.outputs.archied_version) || '' }}
|
||||
git.catlow.cloud/sam/archied:edge
|
||||
git.catlow.cloud/sam/archied:v${{ needs.plan.outputs.archied_version }}
|
||||
git.catlow.cloud/sam/archied:sha-${{ needs.plan.outputs.sha }}
|
||||
build-args: |
|
||||
GATEWAY_VERSION=${{ needs.plan.outputs.component }}
|
||||
RUNTIME_VERSION=${{ needs.plan.outputs.component }}
|
||||
GATEWAY_VERSION=${{ needs.plan.outputs.archied_version }}
|
||||
RUNTIME_VERSION=${{ needs.plan.outputs.archied_version }}
|
||||
cache-from: type=gha,scope=archied
|
||||
cache-to: type=gha,mode=max,scope=archied
|
||||
|
||||
agent-image:
|
||||
needs: [plan, gate]
|
||||
# The agent image is only published with a release.
|
||||
if: needs.plan.outputs.run == 'true' && needs.plan.outputs.archied_version != ''
|
||||
outputs:
|
||||
agent_digest: ${{ steps.agent.outputs.digest }}
|
||||
runs-on: self-hosted
|
||||
@@ -235,13 +170,14 @@ jobs:
|
||||
cache-to: type=gha,mode=max,scope=archie-agent
|
||||
|
||||
dist-zip:
|
||||
# archied-image is needed so a release never reaches the canary without it.
|
||||
# archied-image is needed so a release is never published without it.
|
||||
needs: [plan, gate, archied-image, agent-image]
|
||||
if: needs.plan.outputs.run == 'true' && needs.plan.outputs.archied_version != ''
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
# The gate built these from the tree it checked; nothing is compiled here.
|
||||
- name: Download the release binaries
|
||||
@@ -265,7 +201,7 @@ jobs:
|
||||
for cmd in $(jq -r '.required_topology.units[], .required_topology.binaries[]?' release.json); do
|
||||
cp "dist/$cmd" "$name/"
|
||||
done
|
||||
cp deployments/INSTRUCTIONS.md CHANGELOG.md "$name/"
|
||||
cp deployments/INSTRUCTIONS.md "$name/"
|
||||
digest='${{ needs.agent-image.outputs.agent_digest }}'
|
||||
test -n "$digest"
|
||||
jq --arg image "git.catlow.cloud/sam/archie-agent@$digest" '. + {agent_image: $image}' release.json > "$name/release.json"
|
||||
@@ -307,15 +243,8 @@ jobs:
|
||||
prerelease=false
|
||||
case "$version" in *-*) prerelease=true ;; esac
|
||||
notes="$(mktemp)"
|
||||
awk -v hdr="## [$version]" '
|
||||
index($0, hdr) == 1 { printing = 1 }
|
||||
printing && /^## \[/ && index($0, hdr) != 1 { exit }
|
||||
printing { print }
|
||||
' CHANGELOG.md > "$notes"
|
||||
if ! [ -s "$notes" ]; then
|
||||
echo "no [$version] section extracted from CHANGELOG.md" >&2
|
||||
exit 1
|
||||
fi
|
||||
previous="$(git describe --tags --abbrev=0 --match 'v*' "$tag^" 2>/dev/null || true)"
|
||||
git log --no-merges --format='- %s' ${previous:+"$previous.."}"$tag" > "$notes"
|
||||
api="https://git.catlow.cloud/api/v1"
|
||||
repo="sam/archie"
|
||||
auth="Authorization: token $DEPLOY_TOKEN"
|
||||
@@ -327,12 +256,6 @@ jobs:
|
||||
"$api/repos/$repo/releases" >/dev/null
|
||||
echo "published release notes for $tag"
|
||||
|
||||
- name: Install the release on the canary
|
||||
if: vars.CANARY_URL != ''
|
||||
env:
|
||||
ARCHIE_CANARY_TOKEN: ${{ secrets.CANARY_TOKEN }}
|
||||
run: ./dist/archied release canary start -dashboard "${{ vars.CANARY_URL }}" -version "${{ steps.version.outputs.version }}"
|
||||
|
||||
- name: Link the packages to this repository
|
||||
env:
|
||||
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
|
||||
|
||||
@@ -4,7 +4,7 @@ on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: "release the canary is expected to run; must match what it runs"
|
||||
description: "published release to move stable to, such as 1.63.0"
|
||||
required: true
|
||||
type: string
|
||||
|
||||
@@ -18,27 +18,22 @@ permissions:
|
||||
|
||||
jobs:
|
||||
promote:
|
||||
if: vars.CANARY_URL != ''
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Log in to the Gitea registry
|
||||
run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login git.catlow.cloud -u "${{ github.actor }}" --password-stdin
|
||||
|
||||
- name: Fetch the published archied
|
||||
# The deploy workflow already built this binary. edge is the newest
|
||||
# main that passed the gate.
|
||||
- name: Fetch the release's archied
|
||||
run: |
|
||||
set -e
|
||||
image=git.catlow.cloud/sam/archied:edge
|
||||
image="git.catlow.cloud/sam/archied:v${{ inputs.version }}"
|
||||
docker pull -q "$image"
|
||||
container="$(docker create "$image")"
|
||||
docker cp "$container:/usr/local/bin/archied" "$RUNNER_TEMP/archied"
|
||||
docker rm "$container" >/dev/null
|
||||
|
||||
- name: Promote the canary's release
|
||||
env:
|
||||
ARCHIE_CANARY_TOKEN: ${{ secrets.CANARY_TOKEN }}
|
||||
- name: Promote to stable
|
||||
run: |
|
||||
"$RUNNER_TEMP/archied" release canary promote -dashboard "${{ vars.CANARY_URL }}" \
|
||||
"$RUNNER_TEMP/archied" release promote \
|
||||
-version "${{ inputs.version }}" \
|
||||
-latest git.catlow.cloud/sam/archied,git.catlow.cloud/sam/archie-agent
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
|
||||
run: |
|
||||
if [ -z "$DEPLOY_TOKEN" ]; then
|
||||
echo "::error::DEPLOY_TOKEN is not set for this repository, so the release cannot push its commit and tag. Set the secret here, or dispatch the release from the Gitea primary."
|
||||
echo "::error::DEPLOY_TOKEN is not set for this repository, so the release cannot push its tag. Set the secret here, or dispatch the release from the Gitea primary."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -52,4 +52,4 @@ jobs:
|
||||
task release RELEASE="$RELEASE"
|
||||
|
||||
- name: Push the release
|
||||
run: git push --atomic origin main "$(git describe --exact-match --match 'v*' HEAD)"
|
||||
run: git push origin "$(git describe --exact-match --match 'v*' HEAD)"
|
||||
Reference in new issue
Block a user