Skip to content

Commit

Permalink
Merge pull request #192 from oscerd/release-pipeline-build-and-push
Browse files Browse the repository at this point in the history
Release-pipeline: Add build-and-push job
  • Loading branch information
lburgazzoli authored Feb 8, 2024
2 parents f7cb15c + e4ab19c commit 901fbc4
Showing 1 changed file with 70 additions and 11 deletions.
81 changes: 70 additions & 11 deletions .github/workflows/release-pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 🏷️ Tag, release and attach generated bundle action
name: 🏷️ Release operator and create branches to add new operators versions to repositories for Kubernetes and Openshift
on:
workflow_dispatch:
inputs:
Expand Down Expand Up @@ -27,21 +27,80 @@ on:
The supported Openshift version range. This could be a single version, like for example v4.13 or v4.9-v4.13 as a range
required: false
default: v4.13
olm:
required: true
description: |
Define if we are going to release OLM bundle too
type: boolean
latest:
required: true
description: |
Define if we want to tag the image as latest too
type: boolean
secrets:
registry:
required: true
registry-username:
required: true
registry-password:
required: true

jobs:

version-update:
build-and-push:
permissions:
contents: write
env:
VERSION: ${{ github.event.inputs.operator_version }}
USE_IMAGE_DIGESTS: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Checkout"
uses: actions/checkout@v4
- name: "Build"
run: make build
- name: "Test"
run: make test
- name: "Set up Go"
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true
- name: "Login to Container registry"
uses: docker/login-action@v3
with:
registry: ${{ secrets.registry }}
username: ${{ secrets.registry-username }}
password: ${{ secrets.registry-password }}
- name: Set versions
run: |
export INPUT_VERSION="${{ github.event.inputs.operator_version }}"
export C_VERSION="${INPUT_VERSION#v}"
- name: make bundle
run: make bundle
echo "VERSION=${C_VERSION}" >> $GITHUB_ENV
echo "IMG_VERSION=${C_VERSION}" >> $GITHUB_ENV
- name: "Set Up Crane"
run: |
make crane
- name: "Build Container image"
run: |
export IMAGE_DIGEST=$(crane digest quay.io/kaotoio/kaoto-app:stable)
export KAOTO_APP_IMAGE="quay.io/kaotoio/kaoto-app@${IMAGE_DIGEST}"
make docker-build
make docker-push
- name: "Tag lates Container image"
if: ${{ inputs.latest }}
run: |
docker tag quay.io/kaotoio/kaoto-operator:${VERSION} quay.io/kaotoio/kaoto-operator:latest
docker push quay.io/kaotoio/kaoto-operator:latest
- name: "Build OLM bundle"
if: ${{ inputs.olm }}
run: |
make bundle
make bundle-build
make bundle-push
make catalog-build
make catalog-push
- name: Commit
run: |
if [[ `git status --porcelain` ]]; then
Expand Down Expand Up @@ -78,11 +137,11 @@ jobs:
contents: write
runs-on: ubuntu-latest
needs:
- version-update
- build-and-push
steps:
- uses: actions/checkout@v4

- name: "🛰️ Download UI Dist"
- name: "🛰️ Download Bundle"
uses: actions/download-artifact@v4
with:
name: bundle-${{ github.event.inputs.operator_version }}.tgz
Expand All @@ -109,7 +168,7 @@ jobs:
contents: write
runs-on: ubuntu-latest
needs:
- version-update
- build-and-push
- tag-and-release
steps:

Expand All @@ -120,7 +179,7 @@ jobs:
token: ${{ secrets.PR_TOKEN }}
ref: main

- name: "🛰️ Download UI Dist"
- name: "🛰️ Download Bundle"
uses: actions/download-artifact@v4
with:
name: bundle-${{ github.event.inputs.operator_version }}.tgz
Expand Down Expand Up @@ -156,7 +215,7 @@ jobs:
contents: write
runs-on: ubuntu-latest
needs:
- version-update
- build-and-push
- tag-and-release
steps:

Expand All @@ -167,7 +226,7 @@ jobs:
token: ${{ secrets.PR_TOKEN }}
ref: main

- name: "🛰️ Download UI Dist"
- name: "🛰️ Download Bundle"
uses: actions/download-artifact@v4
with:
name: bundle-${{ github.event.inputs.operator_version }}.tgz
Expand Down

0 comments on commit 901fbc4

Please sign in to comment.