diff --git a/.github/workflows/release_promotion.yml b/.github/workflows/release_promotion.yml new file mode 100644 index 000000000..58ffafff9 --- /dev/null +++ b/.github/workflows/release_promotion.yml @@ -0,0 +1,80 @@ +name: Release Promotion + +on: + workflow_dispatch: + inputs: + commit_sha: + description: 'SHA of the commit to release' + type: string + required: true + version: + description: 'Version to promote' + required: true + type: string + +jobs: + crate_draft_release_notes: + name: Create draft Release Notes + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + fetch-depth: '0' + - name: Setup host + uses: ./.github/actions/setup-ubuntu-host + with: + python-version: '${{ vars.PYTHON_VERSION }}' + # Probably we should just download the Release Notes from the staging registry (together with other artifacts) + - name: Generate Release Notes + id: generate_release_notes + run: python -m scripts.release.release_notes -s $INITIAL_COMMIT_SHA -v $INITIAL_VERSION -o release_notes_final.md + env: + INITIAL_COMMIT_SHA: ${{ vars.RELEASE_INITIAL_COMMIT_SHA }} + INITIAL_VERSION: ${{ vars.RELEASE_INITIAL_VERSION }} + # Add all other assets to the release notes + # Put all of this in single script + - name: Generate draft release + run: | + gh release create $VERSION --target $COMMIT_SHA --draft --prerelease --latest --notes-file release_notes_final.md --title "Release of MCK $VERSION" + env: + VERSION: ${{ github.event.inputs.version }} + COMMIT_SHA: ${{ github.event.inputs.commit_sha }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + approve_release: + name: Approve Release + environment: production + runs-on: ubuntu-latest + needs: crate_draft_release_notes + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + fetch-depth: '0' + - name: Create git tag + run: | + git tag -a $VERSION -m "Release of MCK $VERSION" + git push origin $VERSION + env: + VERSION: ${{ github.event.inputs.version }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + publish_release_notess: + name: Publish Release Notes + environment: production + runs-on: ubuntu-latest + needs: approve_release + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + fetch-depth: '0' + - name: Publish Release Notes + run: | + gh release edit $VERSION --draft=false --verify-tag + env: + VERSION: ${{ github.event.inputs.version }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/scripts/release/dev_workflow.mmd b/scripts/release/dev_workflow.mmd new file mode 100644 index 000000000..3b6102b16 --- /dev/null +++ b/scripts/release/dev_workflow.mmd @@ -0,0 +1,27 @@ +%%{ + init: { + 'flowchart': { + 'htmlLabels': true + } + } +}%% +flowchart LR +%% ─────────────── Build stage ─────────────── + subgraph Build ["Build"] + direction LR + CONTAINER_IMAGES["Build Container Images
Arch: multi
Signing: yes
Tag: build_id
Registry: ECR dev"] + KUBECTL_MONGODB["Build kubectl-mongodb
Arch: multi
Signing: yes
Tag: build_id
Store: S3 dev
"] + HELM_CHARTS["Helm charts
Signing: yes
Tag: build_id
Registry: OCI ECR dev"] + OLM_BUNDLES["Openshift Bundles
Push to dev S3
Tag: build_id"] + end + +%% ─────────────── Test stage ─────────────── + subgraph Testing ["Testing"] + direction LR + TESTS["Run e2e tests"] + OLM_TESTS["Run OLM e2e tests"] + end + +%% ─────────────── Dependencies ─────────────── + + Build --> Testing diff --git a/scripts/release/staging_workflow.mmd b/scripts/release/staging_workflow.mmd new file mode 100644 index 000000000..00e112609 --- /dev/null +++ b/scripts/release/staging_workflow.mmd @@ -0,0 +1,36 @@ +--- +config: + flowchart: + htmlLabels: true +--- +flowchart TD +%% ─────────────── Build stage ─────────────── + subgraph Build["Build"] + CONTAINER_IMAGES["Build Container Images
Arch: multi
Signing: yes
Tag: commit_sha
Registry: quay.io staging"] + KUBECTL_MONGODB["Build kubectl-mongodb
Arch: multi
Signing: yes
Tag: commit_sha
Store: S3 staging/commit_sha
"] + HELM_CHARTS["Helm charts
Signing: yes
Tag: commit_sha
Registry: OCI quay.io staging"] + OLM_BUNDLES["Openshift Bundles
Preflight: yes
Tag: commit_sha
Store: S3 staging/commit_sha"] + RELEASE_NOTES["Generate Release Notes
Store: S3 staging/commit_sha"] + RELATED_VERSIONS_JSON["Generate related_versions.json
Store: S3 staging/commit_sha"] + end + +%% ─────────────── Test stage ─────────────── + subgraph Testing["Testing"] + TESTS["Run e2e tests"] + CODE_SNIPPETS["Run code snippets
Save outputs: yes
Store: S3 staging/commit_sha"] + OLM_TESTS["Run OLM e2e tests"] + end + +%% ─────────────── SBOM Generation ─────────────── + subgraph SBOM ["SBOM Generation"] + IMAGE_SBOM["Images SBOM
CycloneDX"] + KUBECTL_SBOM["Kubectl SBOM"] + AUGUMENTED_SBOM["Augment SBOMs
with Kondukto
Store: S3 staging/commit_sha"] + end + +%% ─────────────── Dependencies ─────────────── + CONTAINER_IMAGES --> TESTS & OLM_TESTS & IMAGE_SBOM & CODE_SNIPPETS + KUBECTL_MONGODB --> TESTS & KUBECTL_SBOM & CODE_SNIPPETS + IMAGE_SBOM & KUBECTL_SBOM --> AUGUMENTED_SBOM + HELM_CHARTS --> TESTS & CODE_SNIPPETS + OLM_BUNDLES --> OLM_TESTS diff --git a/scripts/release/staging_workflow_simple.mmd b/scripts/release/staging_workflow_simple.mmd new file mode 100644 index 000000000..50b2346f5 --- /dev/null +++ b/scripts/release/staging_workflow_simple.mmd @@ -0,0 +1,41 @@ +--- +config: + flowchart: + htmlLabels: true +--- +flowchart LR +%% ─────────────── Build stage ─────────────── + subgraph Build["Build"] + direction LR + CONTAINER_IMAGES["Build Container Images
Arch: multi
Signing: yes
Tag: commit_sha
Registry: quay.io staging"] + KUBECTL_MONGODB["Build kubectl-mongodb
Arch: multi
Signing: yes
Tag: commit_sha
Store: S3 staging/commit_sha
"] + HELM_CHARTS["Helm charts
Signing: yes
Tag: commit_sha
Registry: OCI quay.io staging"] + OLM_BUNDLES["Openshift Bundles
Preflight: yes
Tag: commit_sha
Store: S3 staging/commit_sha"] + end + +%% ─────────────── Other stage ─────────────── + subgraph Other["Other build artifacts"] + direction LR + RELEASE_NOTES["Generate Release Notes
Store: S3 staging/commit_sha"] + RELATED_VERSIONS_JSON["Generate related_versions.json
Store: S3 staging/commit_sha"] + end + +%% ─────────────── Test stage ─────────────── + subgraph Testing["Testing"] + direction LR + TESTS["Run e2e tests"] + OLM_TESTS["Run OLM e2e tests"] + CODE_SNIPPETS["Run code snippets
Save outputs: yes
Store: S3 staging/commit_sha"] + end + +%% ─────────────── SBOM Generation ─────────────── + subgraph SBOM ["SBOM Generation"] + direction LR + IMAGE_SBOM["Container Images SBOM
CycloneDX"] + KUBECTL_SBOM["Kubectl SBOM"] + AUGUMENTED_SBOM["Augment SBOMs
with Kondukto
Store: S3 staging/commit_sha"] + end + +%% ─────────────── Dependencies ─────────────── + Build --> Testing & SBOM + IMAGE_SBOM & KUBECTL_SBOM --> AUGUMENTED_SBOM diff --git a/scripts/release/test_git_repo.mmd b/scripts/release/testdata/test_git_repo.mmd similarity index 100% rename from scripts/release/test_git_repo.mmd rename to scripts/release/testdata/test_git_repo.mmd