docs: set up Migration Guide (#1506) #42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Please | |
on: | |
push: | |
branches: | |
- main | |
- '[0-9]+.[0-9]+.x' | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
env: | |
GO_VERSION: "~1.20" | |
# renovate: datasource=github-releases depName=kubernetes-sigs/controller-tools | |
CONTROLLER_TOOLS_VERSION: "v0.12.0" | |
SCHEDULER_COMPATIBLE_K8S_VERSION: "v0.24.3" | |
jobs: | |
release-please: | |
runs-on: ubuntu-22.04 | |
outputs: | |
tag_name: ${{ steps.release.outputs.tag_name }} | |
releases_created: ${{ steps.release.outputs.releases_created }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Run release please | |
uses: google-github-actions/release-please-action@v3 | |
id: release | |
with: | |
command: manifest | |
token: ${{ secrets.KEPTN_BOT_TOKEN }} | |
default-branch: main | |
signoff: "keptn-bot <[email protected]>" | |
build-release: | |
if: needs.release-please.outputs.releases_created == 'true' | |
needs: | |
- release-please | |
strategy: | |
matrix: | |
config: | |
- name: "lifecycle-operator" | |
folder: "operator/" | |
- name: "metrics-operator" | |
folder: "metrics-operator/" | |
- name: "scheduler" | |
folder: "scheduler/" | |
- name: "functions-runtime" | |
folder: "functions-runtime/" | |
- name: "python-runtime" | |
folder: "python-runtime/" | |
- name: "certificate-operator" | |
folder: "klt-cert-manager/" | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write | |
packages: write | |
id-token: write | |
env: | |
IMAGE_NAME: ghcr.io/keptn/${{ matrix.config.name }} | |
IMAGE_TAG: ${{ needs.release-please.outputs.tag_name }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: "ghcr.io" | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Cosign | |
uses: sigstore/[email protected] | |
- name: Build Docker Image | |
id: docker_build_image | |
uses: docker/build-push-action@v4 | |
with: | |
context: ${{ matrix.config.folder }} | |
platforms: linux/amd64,linux/arm64 | |
target: production | |
tags: | | |
${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} | |
build-args: | | |
GIT_HASH=${{ env.GIT_SHA }} | |
RELEASE_VERSION=dev-${{ env.DATETIME }} | |
BUILD_TIME=${{ env.BUILD_TIME }} | |
CONTROLLER_TOOLS_VERSION=${{ env.CONTROLLER_TOOLS_VERSION }} | |
SCHEDULER_COMPATIBLE_K8S_VERSION=${{ env.SCHEDULER_COMPATIBLE_K8S_VERSION }} | |
builder: ${{ steps.buildx.outputs.name }} | |
push: true | |
cache-from: type=gha,scope=${{ github.ref_name }}-${{ matrix.config.name }} | |
cache-to: type=gha,scope=${{ github.ref_name }}-${{ matrix.config.name }} | |
- name: Sign container image | |
env: | |
IMAGE_DIGEST: ${{ steps.docker_build_image.outputs.digest }} | |
run: | | |
cosign sign --yes ${{ env.IMAGE_NAME }}@${{ env.IMAGE_DIGEST }} | |
cosign verify \ | |
--certificate-identity-regexp="https://github.com/keptn/lifecycle-toolkit/.*" \ | |
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" \ | |
${{ env.IMAGE_NAME }}@${{ env.IMAGE_DIGEST }} | |
- name: Generate SBOM | |
uses: anchore/[email protected] | |
with: | |
image: ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} | |
artifact-name: sbom-${{ matrix.config.name }} | |
output-file: ./sbom-${{ matrix.config.name }}.spdx.json | |
- name: Attach SBOM to release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ needs.release-please.outputs.tag_name }} | |
files: ./sbom-${{ matrix.config.name }}.spdx.json | |
release-manifests: | |
if: needs.release-please.outputs.releases_created == 'true' | |
needs: | |
- release-please | |
- build-release | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Cache build tools operator | |
id: cache-build-tools-operator | |
uses: actions/cache@v3 | |
with: | |
path: ./operator/bin | |
key: build-tools-${{ github.ref_name }} | |
- name: Cache build tools scheduler | |
id: cache-build-tools-scheduler | |
uses: actions/cache@v3 | |
with: | |
path: ./scheduler/bin | |
key: build-tools-${{ github.ref_name }} | |
- name: Cache build tools cert-manager | |
id: cache-build-tools-klt-cert-manager | |
uses: actions/cache@v3 | |
with: | |
path: ./klt-cert-manager/bin | |
key: build-tools-${{ github.ref_name }} | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
check-latest: true | |
- name: Create manifests | |
env: | |
RELEASE_REGISTRY: ghcr.io/keptn | |
CHART_APPVERSION: ${{ needs.release-please.outputs.tag_name }} | |
run: | | |
cd scheduler | |
make release-manifests | |
cd ../operator | |
make controller-gen release-manifests | |
cd ../klt-cert-manager | |
make controller-gen release-manifests | |
cd ../metrics-operator | |
make controller-gen release-manifests | |
cd .. | |
echo "---" >> operator/config/rendered/release.yaml | |
echo "---" >> scheduler/config/rendered/release.yaml | |
echo "---" >> klt-cert-manager/config/rendered/release.yaml | |
cat >> namespace.yaml << EOF | |
--- | |
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: keptn-lifecycle-toolkit-system | |
--- | |
EOF | |
cat namespace.yaml \ | |
operator/config/rendered/release.yaml \ | |
scheduler/config/rendered/release.yaml \ | |
klt-cert-manager/config/rendered/release.yaml \ | |
metrics-operator/config/rendered/release.yaml > manifest.yaml | |
- name: Attach release assets | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ needs.release-please.outputs.tag_name }} | |
files: manifest.yaml | |
update-docs: | |
name: Update Documentation | |
needs: | |
- release-please | |
if: needs.release-please.outputs.releases_created == 'true' | |
with: | |
tag_name: ${{ needs.release-please.outputs.tag_name }} | |
uses: keptn/docs-tooling/.github/workflows/[email protected] | |
secrets: inherit | |
update-examples: | |
name: Update examples | |
needs: | |
- release-please | |
if: needs.release-please.outputs.releases_created == 'true' | |
with: | |
tag_name: ${{ needs.release-please.outputs.tag_name }} | |
uses: ./.github/workflows/release-examples.yml | |
secrets: inherit |