-
Notifications
You must be signed in to change notification settings - Fork 7
88 lines (85 loc) · 2.97 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
#
# Copyright (c) 2019-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#
name: Release Kubernetes Image Puller operator
on:
workflow_dispatch:
inputs:
version:
description: 'The version that is going to be released. Should be in format 1.yy.z'
required: true
forceRecreateTags:
description: If true, tags will be recreated. Use with caution
required: false
default: 'false'
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check existing tags
run: |
set +e
RECREATE_TAGS=${{ github.event.inputs.forceRecreateTags }}
VERSION=${{ github.event.inputs.version }}
EXISTING_TAG=$(git ls-remote --exit-code origin refs/tags/${VERSION})
if [[ -n ${EXISTING_TAG} ]]; then
if [[ ${RECREATE_TAGS} == "true" ]]; then
echo "[INFO] Removing tag for ${VERSION} version. New tag will be recreated during release."
git push origin :$VERSION
else
echo "[ERROR] Cannot proceed with release - tag ${EXISTING_TAG} already exists."
exit 1
fi
else
echo "[INFO] No existing tags detected for $VERSION"
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Docker quay.io Login
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install yq
run: |
python -m pip install --upgrade pip
pip install yq
- name: Set up Go 1.18
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Release operator
run: |
RELEASE_VERSION=${{ github.event.inputs.version }}
echo "RELEASE_VERSION=${RELEASE_VERSION}"
BRANCH=${RELEASE_VERSION%.*}.x
echo "BRANCH=${BRANCH}"
git config --global user.name "Anatolii Bazko"
git config --global user.email "[email protected]"
export GITHUB_TOKEN=${{ secrets.CHE_INCUBATOR_BOT_GITHUB_TOKEN }}
set -e
if [[ ${{ github.event.inputs.forceRecreateTags }} == "true" ]]; then force_update="--force"; fi
./make-release.sh ${RELEASE_VERSION} ${force_update} \
--release \
--release-olm-files \
--release-olm-bundle \
--push-git-changes \
--pull-requests