-
Notifications
You must be signed in to change notification settings - Fork 2
224 lines (214 loc) · 8.68 KB
/
release.yml
File metadata and controls
224 lines (214 loc) · 8.68 KB
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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
deploy-bom:
runs-on: ubuntu-latest
env:
MVN: ./mvnw --show-version --batch-mode --no-transfer-progress
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
java-version: 25
distribution: temurin
cache: maven
- run: $MVN package
working-directory: bom
- uses: actions/setup-java@v5
with: # running setup-java again overwrites the settings.xml
java-version: 25
distribution: temurin
server-id: central
server-username: CENTRAL_USERNAME
server-password: CENTRAL_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- run: $MVN deploy -P release
working-directory: bom
env:
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
deploy:
needs: deploy-bom
runs-on: ubuntu-latest
env:
MVN: ./mvnw --show-version --batch-mode --no-transfer-progress
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
java-version: 25
distribution: temurin
cache: maven
- run: $MVN package
- uses: actions/setup-java@v5
with: # running setup-java again overwrites the settings.xml
java-version: 25
distribution: temurin
server-id: central
server-username: CENTRAL_USERNAME
server-password: CENTRAL_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- run: $MVN deploy -P prod,op,feature-pack,standalone,os,release
env:
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
release:
needs: deploy
runs-on: ubuntu-latest
steps:
- id: get-version
uses: battila7/get-version-action@v2.3.0
- uses: actions/checkout@v6
- id: read-changelog
uses: mindsers/changelog-reader-action@v2
with:
path: ./CHANGELOG.md
version: ${{ steps.get-version.outputs.version-without-v }}
- uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.get-version.outputs.version }}
name: HAL Foundation ${{ steps.get-version.outputs.version-without-v }}
body: ${{ steps.read-changelog.outputs.changes }}
draft: false
prerelease: false
build-native-image:
needs: release
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64, arm64]
env:
MVN: ./mvnw --show-version --batch-mode --no-transfer-progress
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
java-version: 25
distribution: temurin
cache: maven
- run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Build native binary for ${{ matrix.arch }}
run: $MVN install -P prod,op,standalone,native -Dquarkus.native.container-build=true -Dquarkus.native.container-runtime-options=--platform=linux/${{ matrix.arch }}
- uses: actions/upload-artifact@v7
with:
name: native-binary-${{ matrix.arch }}
path: op/standalone/target/*-runner
retention-days: 1
build-image:
needs: build-native-image
runs-on: ubuntu-latest
steps:
- id: get-version
uses: battila7/get-version-action@v2.3.0
- uses: actions/checkout@v6
- run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- run: podman --version
- uses: actions/download-artifact@v8
with:
name: native-binary-amd64
path: op/standalone/target/native-amd64
- uses: actions/download-artifact@v8
with:
name: native-binary-arm64
path: op/standalone/target/native-arm64
- uses: redhat-actions/podman-login@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
- name: Build multi-arch image
run: |
VERSION="${{ steps.get-version.outputs.version-without-v }}"
podman manifest create quay.io/halconsole/hal-op:latest
podman build \
--platform linux/amd64 \
--manifest quay.io/halconsole/hal-op:latest \
--label maintainer=hpehl@redhat.com \
--label org.opencontainers.image.authors=hpehl@redhat.com \
--label org.opencontainers.image.description="HAL console on premise" \
--label org.opencontainers.image.licenses=Apache-2.0 \
--label org.opencontainers.image.revision="${VERSION}" \
--label org.opencontainers.image.source=https://github.com/hal/foundation \
--label org.opencontainers.image.title="HAL On Premise" \
--label org.opencontainers.image.url=https://hal.github.io \
--label org.opencontainers.image.vendor="Red Hat" \
--build-arg BINARY_PATH=target/native-amd64 \
-f op/standalone/src/main/docker/Dockerfile.native-micro \
op/standalone
podman build \
--platform linux/arm64 \
--manifest quay.io/halconsole/hal-op:latest \
--label maintainer=hpehl@redhat.com \
--label org.opencontainers.image.authors=hpehl@redhat.com \
--label org.opencontainers.image.description="HAL console on premise" \
--label org.opencontainers.image.licenses=Apache-2.0 \
--label org.opencontainers.image.revision="${VERSION}" \
--label org.opencontainers.image.source=https://github.com/hal/foundation \
--label org.opencontainers.image.title="HAL On Premise" \
--label org.opencontainers.image.url=https://hal.github.io \
--label org.opencontainers.image.vendor="Red Hat" \
--build-arg BINARY_PATH=target/native-arm64 \
-f op/standalone/src/main/docker/Dockerfile.native-micro \
op/standalone
podman tag quay.io/halconsole/hal-op:latest quay.io/halconsole/hal-op:${VERSION}
podman manifest push quay.io/halconsole/hal-op:latest
podman manifest push quay.io/halconsole/hal-op:${VERSION}
build-native-binaries:
needs: release
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- id: get-version
uses: battila7/get-version-action@v2.3.0
- uses: actions/checkout@v6
- uses: graalvm/setup-graalvm@v1
with:
java-version: 25
distribution: graalvm
github-token: ${{ secrets.GITHUB_TOKEN }}
components: native-image
cache: maven
- if: matrix.os == 'ubuntu-latest'
run: ./mvnw --show-version --batch-mode --no-transfer-progress install -P prod,op,standalone,native -Dquarkus.native.container-build=false
- if: matrix.os == 'macos-latest'
run: ./mvnw --show-version --batch-mode --no-transfer-progress install -P prod,op,standalone,native -Dquarkus.native.container-build=false
- if: matrix.os == 'windows-latest'
run: .\mvnw.cmd --show-version --batch-mode --no-transfer-progress install -P prod,op,standalone,native "-Dquarkus.native.container-build=false"
- if: matrix.os == 'windows-latest'
run: |
$APP_NAME = "hal-op"
$VERSION = "${{ steps.get-version.outputs.version-without-v }}"
$runner = Get-ChildItem -Path op\standalone\target -Filter "*-runner.exe" -Recurse | Select-Object -First 1
Move-Item $runner.FullName "${APP_NAME}-${VERSION}-windows.exe"
shell: pwsh
- if: matrix.os == 'macos-latest'
run: |
APP_NAME="hal-op"
VERSION="${{ steps.get-version.outputs.version-without-v }}"
find op/standalone/target -maxdepth 1 -name '*-runner' -type f -exec mv {} "${APP_NAME}-${VERSION}-macos" \;
shell: bash
- if: matrix.os == 'ubuntu-latest'
run: |
APP_NAME="hal-op"
VERSION="${{ steps.get-version.outputs.version-without-v }}"
find op/standalone/target -maxdepth 1 -name '*-runner' -type f -exec mv {} "${APP_NAME}-${VERSION}-linux" \;
shell: bash
- uses: softprops/action-gh-release@v2
with:
files: hal-op-${{ steps.get-version.outputs.version-without-v }}-*