forked from project-openubl/searchpe
-
Notifications
You must be signed in to change notification settings - Fork 0
234 lines (219 loc) · 8.7 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
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
name: Release
on:
workflow_dispatch:
inputs:
version:
description: "Release version"
default: "E.g. 4.0.0"
required: true
next:
description: "Next version"
default: "E.g. 5.0.0-SNAPSHOT"
required: false
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
cache: maven
- name: Set release version ${{ github.event.inputs.version }}
run: |
mvn -B versions:set versions:commit -DnewVersion=$NEW_VERSION
env:
NEW_VERSION: ${{ github.event.inputs.version }}
- name: Commit and Push
uses: project-openubl/.github/actions/commit@master
with:
commit_message: "🏁 Releasing version ${{ github.event.inputs.version }}"
application:
needs: [ prepare ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: master
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
cache: maven
- name: Login to Quay.io
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAYIO_USERNAME }}
password: ${{ secrets.QUAYIO_PASSWORD }}
- name: Release container images
run: |
mvn -U -B package -DskipTests \
-Dquarkus.native.container-build=true \
-Dquarkus.container-image.push=false \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.registry=quay.io \
-Dquarkus.container-image.group=projectopenubl \
-Dquarkus.container-image.name=searchpe \
-Dquarkus.container-image.tag=latest \
-P native,ui \
-pl application
# Identify major version
major=$(echo "${{ github.event.inputs.version }}" | cut -d. -f1)
# Tag images
docker tag quay.io/projectopenubl/searchpe:latest quay.io/projectopenubl/searchpe:latest
docker tag quay.io/projectopenubl/searchpe:latest quay.io/projectopenubl/searchpe:v$major
docker tag quay.io/projectopenubl/searchpe:latest quay.io/projectopenubl/searchpe:v${{ github.event.inputs.version }}
# Push images
docker image push --all-tags quay.io/projectopenubl/searchpe
# helm:
# needs: [ prepare ]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# with:
# ref: master
# - uses: actions/setup-java@v3
# with:
# java-version: 17
# distribution: temurin
# cache: maven
# - uses: azure/setup-helm@v3
# - name: Release Helm
# run: |
# mvn package -DskipTests
# mvn process-resources
#
# helm plugin install https://github.com/chartmuseum/helm-push
# helm repo add \
# --username ${{ secrets.GITLAB_REGISTRY_USERNAME }} \
# --password ${{ secrets.GITLAB_REGISTRY_TOKEN }} \
# openubl https://gitlab.com/api/v4/projects/36554180/packages/helm/stable
# helm cm-push --force application/target/helm openubl
operator:
needs: [ prepare ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: master
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
cache: maven
- name: Login to Quay.io
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAYIO_USERNAME }}
password: ${{ secrets.QUAYIO_PASSWORD }}
- name: Release container images
run: |
mvn -U -B package -DskipTests \
-Dquarkus.native.container-build=true \
-Dquarkus.container-image.push=false \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.registry=quay.io \
-Dquarkus.container-image.group=projectopenubl \
-Dquarkus.container-image.name=searchpe-operator \
-Dquarkus.container-image.tag=latest \
-Dquarkus.operator-sdk.bundle.package-name=searchpe-operator \
-Dquarkus.operator-sdk.bundle.channels=alpha \
-Doperator.searchpe.image=quay.io/projectopenubl/searchpe:v${{ github.event.inputs.version }} \
-P native \
-pl operator
# Tag images
docker tag quay.io/projectopenubl/searchpe-operator:latest quay.io/projectopenubl/searchpe-operator:v${{ github.event.inputs.version }}
# Push images
docker image push --all-tags quay.io/projectopenubl/searchpe-operator
publish-operator:
needs: [ application, operator ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: master
path: searchpe
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
cache: maven
- name: Setup other tools
run: |
sudo apt-get install -y groovy
- name: Prepare files
working-directory: searchpe
run: |
mvn package -DskipTests \
-Doperator.searchpe.image=quay.io/projectopenubl/searchpe:v${{ github.event.inputs.version }} \
-Dquarkus.operator-sdk.bundle.package-name=searchpe-operator \
-Dquarkus.operator-sdk.bundle.channels=alpha \
-Dquarkus.application.version=v${{ github.event.inputs.version }} \
-pl operator
groovy scripts/enrichCSV.groovy operator/target/bundle/searchpe-operator/manifests/searchpe-operator.clusterserviceversion.yaml ${{ github.event.inputs.version }}
sed -i "/ annotations: ''/d" ./operator/target/bundle/searchpe-operator/manifests/searchpe-operator.clusterserviceversion.yaml
- name: Create PR community-operators
uses: project-openubl/.github/actions/pull-request-operator@master
with:
operator_name: searchpe-operator
operator_version: ${{ github.event.inputs.version }}
operator_bundle_directory: searchpe/operator/target/bundle/searchpe-operator
pr_body_template_url: https://raw.githubusercontent.com/project-openubl/community-operators/main/docs/pull_request_template.md
repository_origin_owner: project-openubl
repository_origin_name: community-operators
repository_upstream_owner: k8s-operatorhub
repository_upstream_name: community-operators
repository_default_branch: main
github_pat: ${{ secrets.GH_PAT }}
release:
needs: [ publish-operator ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: master
fetch-depth: 0
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
cache: maven
- name: Build distribution
run: mvn package -DskipTests -P ui,distribution -pl application
- name: JReleaser - release
uses: jreleaser/release-action@v2
env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.GH_PAT }}
JRELEASER_PROJECT_VERSION: ${{ github.event.inputs.version }}
JRELEASER_PRERELEASE_PATTERN: .*(?:Alpha|alpha|Beta|beta)[0-9]
JRELEASER_ZULIP_API_KEY: ${{ secrets.JRELEASER_ZULIP_API_KEY }}
JRELEASER_TWITTER_CONSUMER_KEY: ${{ secrets.JRELEASER_TWITTER_CONSUMER_KEY }}
JRELEASER_TWITTER_CONSUMER_SECRET: ${{ secrets.JRELEASER_TWITTER_CONSUMER_SECRET }}
JRELEASER_TWITTER_ACCESS_TOKEN: ${{ secrets.JRELEASER_TWITTER_ACCESS_TOKEN }}
JRELEASER_TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.JRELEASER_TWITTER_ACCESS_TOKEN_SECRET }}
JRELEASER_SLACK_TOKEN: ${{ secrets.JRELEASER_SLACK_TOKEN }}
JRELEASER_SLACK_WEBHOOK: ${{ secrets.JRELEASER_SLACK_WEBHOOK }}
JRELEASER_MAIL_PASSWORD: ${{ secrets.JRELEASER_MAIL_PASSWORD }}
JRELEASER_ARTICLE_GITHUB_TOKEN: ${{ secrets.GH_PAT }}
- name: JReleaser - generate log
if: always()
shell: bash
run: tar -czvf jreleaser-log.tgz out/
- name: JReleaser - upload log
if: always()
uses: actions/upload-artifact@v3
with:
name: jreleaser-log
path: 'jreleaser-log.tgz'
- name: Set version ${{ github.event.inputs.next }}
run: |
mvn -B versions:set versions:commit -DnewVersion=$NEW_VERSION
env:
NEW_VERSION: ${{ github.event.inputs.next }}
- name: Commit and Push
uses: project-openubl/.github/actions/commit@master
with:
commit_message: "⬆️ Next version ${{ github.event.inputs.next }}"