-
Notifications
You must be signed in to change notification settings - Fork 38
128 lines (106 loc) · 3.73 KB
/
release-phase1.yaml
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Release Phase 1 - Prepare release branch, build, test, and push images
on:
workflow_dispatch:
inputs:
operator-release-version:
description: Operator version being released
operand-release-version:
description: Operand version to use
required: true
branch:
description: Branch to release from
required: true
default: main
release-branch:
description: Branch used during the release
required: true
default: release
debug:
type: boolean
description: Debug with tmate on failure
env:
IMAGE_REGISTRY: quay.io
EXTRA_CHECKS: "true"
OPERAND_VERSION: ${{ github.event.inputs.operand-release-version }}
RELEASE_BRANCH: ${{ github.event.inputs.release-branch }}
jobs:
release:
runs-on: ubuntu-latest
if: github.repository_owner == 'Apicurio'
steps:
- name: Setup go 1.20
uses: actions/setup-go@v4
with:
go-version: '1.20'
- run: go version
- name: Checkout the Operator repository
run: |
git init
git config user.name apicurio-ci
git config user.email [email protected]
git remote add origin "https://apicurio-ci:${{ secrets.ACCESS_TOKEN }}@github.com/Apicurio/apicurio-registry-operator.git"
git fetch
git checkout --track "origin/${{ github.event.inputs.branch }}"
git checkout -b "$RELEASE_BRANCH"
- name: Configure env. variables
run: |
if [[ -z "${{ github.event.inputs.operator-release-version }}" ]]; then
echo "OPERATOR_VERSION=$(make get-variable-operator-version-prefix)" >> "$GITHUB_ENV"
else
echo "OPERATOR_VERSION=${{ github.event.inputs.operator-release-version }}" >> "$GITHUB_ENV"
fi
- name: Run make info
run: make info
- name: Update operator and operand versions
run: |
make release-set-operator-version
git add .
git commit -m "release: update operator version"
make release-set-operand-version
git add .
git commit -m "release: update operand version"
- name: Configure go
run: .github/scripts/setup.sh
- name: Build operator image
run: make build
- name: Commit after build
run: |
git add .
git commit -m "release: update resources"
- name: Run e2e test
run: |
CI_BUILD=true EXTRA_CHECKS=false .github/scripts/test_operator.sh
- name: Bundle
run: make bundle bundle-build
- name: Commit bundle
run: |
git add -f bundle.Dockerfile bundle
git commit -m "release: bundle"
- name: Setup Docker
run: docker login -u "${{ secrets.QUAY_USERNAME }}" -p "${{ secrets.QUAY_PASSWORD }}" "$IMAGE_REGISTRY"
- name: Publish operator and bundle images
run: make docker-push bundle-push
- name: Build and publish catalog image
run: make catalog-build catalog-push
- name: Generate dist
run: |
RELEASE=true make dist
git add -f dist
git add .
git commit -m "release: dist"
- name: Run e2e tests with release images
run: .github/scripts/test_operator.sh
- name: Push the release branch
run: git push origin "$RELEASE_BRANCH"
- name: Collect logs
if: failure()
run: .github/scripts/collect_logs.sh
- name: Upload tests logs artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: tests-logs
path: artifacts
- name: Setup tmate session
if: failure() && inputs.debug
uses: mxschmitt/action-tmate@v3