-
Notifications
You must be signed in to change notification settings - Fork 38
147 lines (126 loc) · 4.99 KB
/
release-phase4.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Release Phase 4 - Tag, create a release in GitHub, cleanup and set up next dev version
on:
workflow_dispatch:
inputs:
operator-next-version:
description: Next Operator version (-dev)
required: true
operand-next-version:
description: Next Operand version
required: true
default: 2.x
operand-next-image-tag:
description: Next Operand image version
required: true
default: 2.5.x-snapshot
release-branch:
description: Branch used during the release
required: true
default: release
debug:
type: boolean
description: Debug with tmate on failure
env:
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/$RELEASE_BRANCH"
- name: Configure env. variables
run: |
echo "OPERATOR_VERSION=$(make get-variable-operator-version)" >> "$GITHUB_ENV"
echo "OPERAND_VERSION=$(make get-variable-operand-version)" >> "$GITHUB_ENV"
echo "GH_TOKEN=${{ secrets.JSENKO_ACCESS_TOKEN }}" >> "$GITHUB_ENV"
echo "PACKAGE_VERSION=$(make get-variable-package-version)" >> "$GITHUB_ENV"
- name: Configure more env. variables
run: |
echo "RELEASE_TAG=v$OPERATOR_VERSION" >> "$GITHUB_ENV"
echo "RELEASE_TAG_FULL=v$PACKAGE_VERSION" >> "$GITHUB_ENV"
echo "DIST_FILE=apicurio-registry-operator-$PACKAGE_VERSION.tar.gz" >> "$GITHUB_ENV"
- name: Run make info
run: make info
- name: Create git tags
run: |
git tag -a "$RELEASE_TAG" -m "Apicurio Registry Operator $OPERATOR_VERSION"
git tag -a "$RELEASE_TAG_FULL" -m "Apicurio Registry Operator $OPERATOR_VERSION with Apicurio Registry $OPERAND_VERSION"
- name: Cleanup
run: |
cp -t /tmp "$DIST_FILE"
make clean
git add .
git commit -m "release: clean release files"
- name: Record previous package version
run: |
make release-update-makefile
git add .
git commit -m "release: update Makefile"
- name: Update env. variables
run: |
echo "OPERATOR_VERSION=${{ github.event.inputs.operator-next-version }}" >> "$GITHUB_ENV"
echo "OPERAND_VERSION=${{ github.event.inputs.operand-next-version }}" >> "$GITHUB_ENV"
- name: Set next Operator version
run: |
SNAPSHOT=true make release-set-operator-version
git add .
git commit -m "release: update to next operator version"
- name: Set next Operand version
run: |
OPERAND_IMAGE_TAG="${{ github.event.inputs.operand-next-image-tag }}" make release-set-operand-version
git add .
git commit -m "release: update to next operand version"
- name: Set next api-model version
run: |
SNAPSHOT_VERSION="$(make get-variable-operator-version-prefix)-SNAPSHOT"
cd api-model
./mvnw -B versions:set "-DnewVersion=$SNAPSHOT_VERSION" -DgenerateBackupPoms=false -DprocessAllModules=true
git add .
git commit -m "release: update Java API Model to next version"
- name: Update resources
run: |
make release-update-install-file
git add .
git commit -m "release: update resources"
- name: Push release branch last time
run: |
git push origin "$RELEASE_BRANCH"
- name: Merge release branch
run: |
git checkout --track origin/main
git merge --ff-only "$RELEASE_BRANCH"
git push origin main
- name: Push release tag
run: |
git push origin "$RELEASE_TAG"
git push origin "$RELEASE_TAG_FULL"
- name: Create a GitHub release
run: |
gh repo set-default Apicurio/apicurio-registry-operator
RELEASE_NOTES="docs/resources/release-notes/$PACKAGE_VERSION.md"
if [[ ! -f $RELEASE_NOTES ]]; then
echo "Missing release notes file: $RELEASE_NOTES"
exit 1
fi
gh release create "$RELEASE_TAG_FULL" --latest \
--title "Apicurio Registry Operator $PACKAGE_VERSION" \
-F "$RELEASE_NOTES" \
"/tmp/$DIST_FILE"
- name: Delete release branch
run: |
git push --delete origin "$RELEASE_BRANCH"
- name: Setup tmate session
if: failure() && inputs.debug
uses: mxschmitt/action-tmate@v3