-
Notifications
You must be signed in to change notification settings - Fork 16
95 lines (79 loc) · 2.89 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
---
name: Release
on:
push:
branches:
- EVEREST-107-automated-release-fix
permissions:
contents: write
packages: write
checks: write
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
env:
TOOLS_PATH: "/opt/tools/bin"
VERSION: 1.0.2
RELEASE_TYPE: patch
# version in format "X.Y" which is going to be updated with each patch release
FLOATING_TAG: ''
# branch name in format "release-X.Y"
BRANCH_NAME: ''
# GitHub tag name to use for the RC/Release
GH_TAG: ''
# Shows if this workflow is triggered for RC or Release
IS_RC: 0
ARCH: ''
OS: ''
steps:
- name: Validate input
run: |
if [[ ! $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+(-rc[1-9][0-9]*)?$ ]]; then
echo "Wrong version format provided, please use "X.Y.Z-rcN" format for an RC or "X.Y.Z" format for a release"
exit 1
fi
- name: Set environment variables
run: |
floating_tag=${VERSION%.*}
echo "FLOATING_TAG=$floating_tag" >> $GITHUB_ENV
echo "BRANCH_NAME=release-$floating_tag" >> $GITHUB_ENV
echo "GH_TAG=v$VERSION" >> $GITHUB_ENV
if [[ ! $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "IS_RC=1" >> $GITHUB_ENV
fi
echo "ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')" >> $GITHUB_ENV
echo "OS=$(uname | awk '{print tolower($0)}')" >> $GITHUB_ENV
- name: Catalog - checkout
uses: actions/checkout@v4
with:
repository: percona/everest-catalog
path: everest-catalog
token: ${{ secrets.ROBOT_TOKEN }}
- name: Catalog - update veneer file
run: |
cd everest-catalog/tools
cp ../veneer/everest-operator.yaml ../veneer/everest-operator-original.yaml
echo "---- start -----"
if [[ $env.IS_RC ]]; then
go run . \
--veneer-file ../veneer/everest-operator-original.yaml \
--channel fast-v0 \
--new-version ${{ env.VERSION }}
else
go run . \
--veneer-file ../veneer/everest-operator-original.yaml \
--channel stable-v0 \
--new-version ${{ env.VERSION }}
echo "---------"
go run . \
--veneer-file ../veneer/everest-operator-original.yaml \
--channel fast-v0 \
--new-version ${{ env.VERSION }}
fi
echo "---- end -----"
rm -f ../veneer/everest-operator-original.yaml
# curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/latest/download/${OS}-${ARCH}-opm
# chmod +x /tmp/opm
# /tmp/opm alpha render-template basic -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml
#