-
Notifications
You must be signed in to change notification settings - Fork 9
106 lines (94 loc) · 3.55 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
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
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 }}
OCP_VERSION: ${{ inputs.ocp_version }}
steps:
- name: Log inputs
run: |
echo "Building version: ${VERSION},"
echo "replaces version (optional): ${PREVIOUS_VERSION},"
echo "OCP version (optional): ${OCP_VERSION}."
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Log in to Quay.io
uses: docker/login-action@v3
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 make container-build-and-push-community
- name: Create release with manifests
# https://github.com/marketplace/actions/github-release-create-update-and-upload-assets
uses: meeDamian/github-release@2.0
with:
tag: v${{ inputs.version }}
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
body: |
# Fence Agents Remediation v${{ inputs.version }}
## Notable Changes
* TODO
## Release Artifacts
### Images
* Operator: quay.io/medik8s/fence-agents-remediation-operator:v${{ inputs.version }}
* Bundle: quay.io/medik8s/fence-agents-remediation-operator-bundle:v${{ inputs.version }}
* Catalog aka Index: quay.io/medik8s/fence-agents-remediation-operator-catalog:v${{ inputs.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 }}
community: 'K8S'
make_targets: "bundle-community-k8s"
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 }}
ocp_version: ${{ inputs.ocp_version }}
community: 'OKD'
make_targets: "bundle-community-okd"