Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,25 @@ jobs:
- name: Run actionlint
run: go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.12

release-automation:
name: Release automation tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Check release verification, smoke and finalization
run: |
bash -n hack/verify-release-artifacts.sh hack/verify-release-artifacts_test.sh \
hack/smoke-release.sh hack/smoke-release_test.sh \
hack/finalize-release.sh hack/finalize-release_test.sh
bash hack/verify-release-artifacts_test.sh
bash hack/smoke-release_test.sh
bash hack/finalize-release_test.sh

ci-summary:
name: CI summary
needs: [build, test, lint, e2e, dependency-review, workflow-lint]
needs: [build, test, lint, e2e, dependency-review, workflow-lint, release-automation]
runs-on: ubuntu-latest
if: always()
steps:
Expand All @@ -104,6 +120,7 @@ jobs:
E2E_RESULT: ${{ needs.e2e.result }}
DEPENDENCY_REVIEW_RESULT: ${{ needs.dependency-review.result }}
WORKFLOW_LINT_RESULT: ${{ needs.workflow-lint.result }}
RELEASE_AUTOMATION_RESULT: ${{ needs.release-automation.result }}
run: |
results=(
"build=${BUILD_RESULT}"
Expand All @@ -112,6 +129,7 @@ jobs:
"e2e=${E2E_RESULT}"
"dependency-review=${DEPENDENCY_REVIEW_RESULT}"
"workflow-lint=${WORKFLOW_LINT_RESULT}"
"release-automation=${RELEASE_AUTOMATION_RESULT}"
)
failed=0
for result in "${results[@]}"; do
Expand Down
118 changes: 118 additions & 0 deletions .github/workflows/finalize-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Finalize Release

"on":
workflow_dispatch:
inputs:
operation:
description: Publish a verified candidate or repair only its attestation notes
required: true
type: choice
options: [finalize, repair]
version:
description: Candidate version, for example v0.4.4
required: true
type: string
source_commit:
description: Full source commit approved for this release
required: true
type: string
release_id:
description: Existing GitHub release ID
required: true
type: string
image_digest:
description: Exact approved sha256 image digest
required: true
type: string
promote_latest:
description: Also promote the verified image and manifests to latest
required: false
default: false
type: boolean

permissions:
contents: read

concurrency:
group: release-finalization
cancel-in-progress: false

jobs:
finalize:
if: github.repository == 'tektoncd/tekton-kueue' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 45
environment:
name: kueue-release-finalization
env:
GOTOOLCHAIN: local
GH_TOKEN: ${{ secrets.CHATOPS_TOKEN }}
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
OCI_API_KEY: ${{ secrets.OCI_API_KEY }}
OCI_FINGERPRINT: ${{ secrets.OCI_FINGERPRINT }}
OCI_TENANCY_OCID: ${{ secrets.OCI_TENANCY_OCID }}
OCI_USER_OCID: ${{ secrets.OCI_USER_OCID }}
OCI_REGION: ${{ secrets.OCI_REGION }}
RELEASE_SIGNING_PUBLIC_KEY: ${{ vars.RELEASE_SIGNING_PUBLIC_KEY }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Require configured signing trust
shell: bash
run: |
test -n "$RELEASE_SIGNING_PUBLIC_KEY"
printf '%s\n' "$RELEASE_SIGNING_PUBLIC_KEY" > "$RUNNER_TEMP/release-signing.pub"
openssl pkey -pubin -in "$RUNNER_TEMP/release-signing.pub" -noout

- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod

- name: Install pinned verification tools
shell: bash
run: |
export GOBIN="$RUNNER_TEMP/release-tools"
mkdir -p "$GOBIN"
go install github.com/sigstore/cosign/v3/cmd/cosign@v3.0.6
go install github.com/google/go-containerregistry/cmd/crane@v0.20.6
go install sigs.k8s.io/kind@v0.32.0
printf '%s\n' "$GOBIN" >> "$GITHUB_PATH"

- name: Install pinned OCI client
if: inputs.promote_latest
shell: bash
run: |
python3 -m venv "$RUNNER_TEMP/oci-client"
"$RUNNER_TEMP/oci-client/bin/pip" install oci-cli==3.74.2
printf '%s\n' "$RUNNER_TEMP/oci-client/bin" >> "$GITHUB_PATH"

- name: Verify, smoke-test and finalize
shell: bash
env:
OPERATION: ${{ inputs.operation }}
VERSION: ${{ inputs.version }}
COMMIT: ${{ inputs.source_commit }}
RELEASE_ID: ${{ inputs.release_id }}
DIGEST: ${{ inputs.image_digest }}
PROMOTE_LATEST: ${{ inputs.promote_latest }}
run: |
bash hack/finalize-release.sh "$OPERATION" "$VERSION" "$COMMIT" \
"$RELEASE_ID" "$DIGEST" "$RUNNER_TEMP/release-signing.pub" \
"$PROMOTE_LATEST" "$RUNNER_TEMP/release-finalization"
{
printf '### Release %s\n\n' "$VERSION"
printf -- '- Operation: %s\n' "$OPERATION"
printf -- '- Source: %s\n' "$COMMIT"
printf -- '- Image: %s\n' "$DIGEST"
printf -- '- Release: https://github.com/tektoncd/tekton-kueue/releases/tag/%s\n' "$VERSION"
} >> "$GITHUB_STEP_SUMMARY"

- name: Save isolated smoke diagnostics
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: release-smoke-${{ github.run_id }}
path: ${{ runner.temp }}/release-finalization/smoke
if-no-files-found: ignore
28 changes: 1 addition & 27 deletions .github/workflows/patch-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ name: Patch Release
description: "Version to release (for example, v0.5.1)"
required: true
type: string
release_as_latest:
description: "Publish as latest release"
required: false
type: boolean
default: true
schedule:
- cron: "0 10 * * 4"

Expand Down Expand Up @@ -47,23 +42,6 @@ jobs:
id: scan
shell: bash
run: |
latest_branch=""
latest_major=0
latest_minor=0
for ref in $(git branch -r --list 'origin/release-v*'); do
branch="${ref#origin/}"
if [[ "$branch" =~ ^release-v([0-9]+)\.([0-9]+)\.x$ ]]; then
major="${BASH_REMATCH[1]}"
minor="${BASH_REMATCH[2]}"
if [ "$major" -gt "$latest_major" ] || { [ "$major" -eq "$latest_major" ] && [ "$minor" -gt "$latest_minor" ]; }; then
latest_major=$major
latest_minor=$minor
latest_branch=$branch
fi
fi
done
echo "::notice::Latest release branch: ${latest_branch}"

min_major="${MIN_RELEASE_VERSION%%.*}"
min_minor="${MIN_RELEASE_VERSION##*.}"
releases=()
Expand Down Expand Up @@ -93,9 +71,7 @@ jobs:
fi

next_version=$(echo "$last_tag" | awk -F. '{printf "%s.%s.%d", $1, $2, $3+1}')
is_latest=false
[ "$branch" = "$latest_branch" ] && is_latest=true
releases+=("{\"branch\":\"${branch}\",\"version\":\"${next_version}\",\"release_as_latest\":\"${is_latest}\"}")
releases+=("{\"branch\":\"${branch}\",\"version\":\"${next_version}\"}")
done

if [ ${#releases[@]} -eq 0 ]; then
Expand Down Expand Up @@ -133,7 +109,6 @@ jobs:
PAC_INCOMING_SECRET: ${{ secrets.PAC_INCOMING_SECRET }}
RELEASE_BRANCH: ${{ matrix.release.branch }}
RELEASE_VERSION: ${{ matrix.release.version }}
RELEASE_AS_LATEST: ${{ matrix.release.release_as_latest }}
run: bash ./hack/trigger-patch-release.sh

trigger-manual-release:
Expand Down Expand Up @@ -184,5 +159,4 @@ jobs:
PAC_INCOMING_SECRET: ${{ secrets.PAC_INCOMING_SECRET }}
RELEASE_BRANCH: ${{ inputs.branch }}
RELEASE_VERSION: ${{ inputs.version }}
RELEASE_AS_LATEST: ${{ inputs.release_as_latest }}
run: bash ./hack/trigger-patch-release.sh
56 changes: 56 additions & 0 deletions .github/workflows/release-smoke.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Released Artifact Smoke

"on":
pull_request:
paths:
- ".github/workflows/release-smoke.yaml"
- ".github/workflows/finalize-release.yaml"
- "hack/*release*.sh"
- "tekton/publish.yaml"
- "tekton/release-pipeline.yaml"
- "test/release-smoke/**"

permissions:
contents: read

concurrency:
group: release-smoke-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
smoke:
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
- name: Install pinned Kind
run: |
GOTOOLCHAIN=local go install sigs.k8s.io/kind@v0.32.0
- name: Check smoke script behavior
run: |
bash -n hack/smoke-release.sh hack/smoke-release_test.sh
bash hack/smoke-release_test.sh
- name: Install and exercise the immutable release fixture
shell: bash
run: |
# A pinned public fixture tests installation, not the production trust bootstrap.
curl -fsSL https://infra.tekton.dev/tekton-releases/tekton-kueue/previous/v0.4.3/release.yaml \
-o "$RUNNER_TEMP/release.yaml"
printf '%s %s\n' \
340e21dbed798284de3e665e816e02f29f024af0cd32efa3cc98bbb7f9830270 \
"$RUNNER_TEMP/release.yaml" | sha256sum -c -
bash hack/smoke-release.sh "$RUNNER_TEMP/release.yaml" \
ghcr.io/tektoncd/tekton-kueue@sha256:6d89cbd8b47cebebc1c05c9e45292433e755372db68e0b66d5dd68d6ede9cb17 \
"$RUNNER_TEMP/release-smoke"
- name: Save smoke diagnostics
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: release-smoke-${{ github.run_id }}
path: ${{ runner.temp }}/release-smoke
if-no-files-found: ignore
23 changes: 23 additions & 0 deletions .github/workflows/release-verification.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release artifact verification

on:
pull_request:
paths:
- hack/verify-release-artifacts.sh
- hack/verify-release-artifacts_test.sh
- .github/workflows/release-verification.yaml

permissions:
contents: read

jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Check verifier syntax and behavior
run: |
bash -n hack/verify-release-artifacts.sh hack/verify-release-artifacts_test.sh
bash hack/verify-release-artifacts_test.sh
2 changes: 0 additions & 2 deletions .tekton/release-patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ spec:
value: tekton-robot
- name: releaseBucket
value: tekton-releases
- name: releaseAsLatest
value: "{{ release_as_latest }}"
- name: platforms
value: linux/amd64,linux/arm64,linux/s390x,linux/ppc64le
- name: serviceAccountImagesPath
Expand Down
2 changes: 0 additions & 2 deletions .tekton/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ spec:
value: tekton-robot
- name: releaseBucket
value: tekton-releases
- name: releaseAsLatest
value: "true"
- name: platforms
value: linux/amd64,linux/arm64,linux/s390x,linux/ppc64le
- name: serviceAccountImagesPath
Expand Down
Loading
Loading