-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Giovanni Liva <[email protected]>
- Loading branch information
Showing
1 changed file
with
1 addition
and
163 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,153 +18,15 @@ env: | |
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: "keptn-lifecycle-operator" | ||
folder: "operator/" | ||
- name: "scheduler" | ||
folder: "scheduler/" | ||
- name: "functions-runtime" | ||
folder: "functions-runtime/" | ||
- name: "klt-cert-manager" | ||
folder: "klt-cert-manager/" | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: write | ||
packages: write | ||
id-token: write | ||
env: | ||
IMAGE_TAG: ghcr.io/keptn/${{ matrix.config.name }}:${{ 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 | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ${{ matrix.config.folder }} | ||
platforms: linux/amd64,linux/arm64 | ||
target: production | ||
tags: | | ||
${{ 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 images | ||
env: | ||
COSIGN_EXPERIMENTAL: 1 | ||
run: cosign sign ${{ env.IMAGE_TAG }} | ||
|
||
- name: Generate SBOM | ||
uses: anchore/[email protected] | ||
with: | ||
image: ${{ 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@v3 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: Create manifests | ||
env: | ||
RELEASE_REGISTRY: ghcr.keptn.sh/keptn | ||
TAG: ${{ 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 .. | ||
echo "---" >> operator/config/rendered/release.yaml | ||
echo "---" >> scheduler/config/rendered/release.yaml | ||
cat >> namespace.yaml << EOF | ||
--- | ||
apiVersion: v1 | ||
|
@@ -173,28 +35,4 @@ jobs: | |
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 > 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' | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Update Documentation | ||
uses: ./.github/actions/update-documentation | ||
with: | ||
version: ${{ needs.release-please.outputs.tag_name }} | ||
klt-repo: ${{ github.workspace }} | ||
token: ${{ secrets.KEPTN_SANDBOX_BOT_TOKEN }} | ||
update-main: true | ||
cat namespace.yaml |