Release #16
This file contains hidden or 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 | |
on: | |
workflow_dispatch: | |
inputs: | |
operation: | |
description: "The operation to perform." | |
required: true | |
type: choice | |
default: "build_and_push_images" | |
options: | |
- build_and_push_images | |
- create_okd_release_pr | |
- create_k8s_release_pr | |
version: | |
description: "The version to release, without the leading `v`" | |
required: true | |
previous_version: | |
description: "The previous version, used for the CVS's `replaces` field, without the leading `v`" | |
required: false | |
skip_range_lower: | |
description: "Lower bound for the skipRange field in the CSV, should be set to the oldest supported version, without the leading `v`" | |
required: true | |
ocp_version: | |
description: "The target OCP version for the release (mandatory for create_okd_release_pr option)" | |
required: false | |
permissions: | |
contents: write | |
jobs: | |
push_to_registry: | |
if: ${{ inputs.operation == 'build_and_push_images' }} | |
name: Build and push images to quay.io/medik8s | |
runs-on: ubuntu-22.04 | |
env: | |
VERSION: ${{ inputs.version }} | |
#PREVIOUS_VERSION: ${{ inputs.previous_version }} | |
SKIP_RANGE_LOWER: ${{ inputs.skip_range_lower }} | |
OCP_VERSION: ${{ inputs.ocp_version }} | |
steps: | |
- name: Log inputs | |
run: | | |
echo "Building version: ${VERSION}," | |
#echo "which replaces version: ${PREVIOUS_VERSION}." | |
echo "Lower skip range bound: ${SKIP_RANGE_LOWER}." | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: go.mod | |
- name: Log in to Quay.io | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_PASSWORD }} | |
registry: quay.io | |
- name: Build and push versioned CSV and images | |
run: VERSION=$VERSION PREVIOUS_VERSION=$PREVIOUS_VERSION SKIP_RANGE_LOWER=$SKIP_RANGE_LOWER make container-build-k8s container-push | |
- name: Create release with manifests | |
# https://github.com/marketplace/actions/github-release-create-update-and-upload-assets | |
uses: meeDamian/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
draft: true | |
body: | | |
# Node HealthCheck Operator v${{ env.VERSION }} | |
## Notable Changes | |
* TODO | |
## Release Artifacts | |
### Images | |
* Operator: quay.io/medik8s/node-healthcheck-operator:v${{ env.VERSION }} | |
* Bundle: quay.io/medik8s/node-healthcheck-operator-bundle:v${{ env.VERSION }} | |
### Source code and OLM manifests | |
Please find the source code and the OLM manifests in the `Assets` section below. | |
gzip: folders | |
files: > | |
Manifests:bundle/ | |
create_k8s_release_pr: | |
if: inputs.operation == 'create_k8s_release_pr' | |
uses: medik8s/.github/.github/workflows/release_community_bundle_parametric.yaml@main | |
secrets: inherit | |
with: | |
version: ${{ inputs.version }} | |
skip_range_lower: ${{ inputs.skip_range_lower }} | |
community: 'K8S' | |
make_targets: "bundle-k8s bundle-update" | |
create_okd_release_pr: | |
if: inputs.operation == 'create_okd_release_pr' | |
uses: medik8s/.github/.github/workflows/release_community_bundle_parametric.yaml@main | |
secrets: inherit | |
with: | |
version: ${{ inputs.version }} | |
previous_version: ${{ inputs.previous_version }} | |
skip_range_lower: ${{ inputs.skip_range_lower }} | |
ocp_version: ${{ inputs.ocp_version }} | |
community: 'OKD' | |
make_targets: "bundle-okd" |