Repository navigation
277 lines (254 loc) · 10.2 KB
/
Copy pathbuild-wave-cli.yml
File metadata and controls
277 lines (254 loc) · 10.2 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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
name: Wave-cli builds
permissions:
contents: read
on:
push:
branches:
- '*'
- '!refs/tags/.*'
tags-ignore:
- '*'
paths:
- 'wave-cli/**'
- '.github/workflows/build-wave-cli.yml'
pull_request:
types: [opened, reopened, synchronize]
branches:
- '*'
- '!refs/tags/.*'
tags-ignore:
- '*'
paths:
- 'wave-cli/**'
- '.github/workflows/build-wave-cli.yml'
jobs:
detect-release:
name: Detect release commit
runs-on: ubuntu-latest
outputs:
release: ${{ steps.detect.outputs.release }}
steps:
- name: Detect release commit
id: detect
env:
COMMIT_MSG: ${{ github.event.head_commit.message }}
REF: ${{ github.ref }}
run: |
# as in Wave CI: only direct pushes to master whose first line tags `[release]`,
# squash and merge commits excluded, so a PR mentioning the tag does not trigger a release
first_line=$(printf '%s\n' "$COMMIT_MSG" | head -n1)
release=false
if [[ "$REF" == "refs/heads/master" && "$first_line" == *"[release]"* && ! "$first_line" =~ \(#[0-9]+\)$ && ! "$first_line" =~ ^Merge\ pull\ request\ #[0-9]+ ]]; then
release=true
fi
echo "release=$release ref=$REF"
echo "release=$release" >> "$GITHUB_OUTPUT"
build:
name: Wave on ${{ matrix.os }}
needs: [ detect-release ]
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: wave-cli
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest-large, macos-latest-xlarge, windows-latest]
include:
- os: ubuntu-latest
fatjar: true
musl: true
- os: macos-latest-large
codesign: true
- os: macos-latest-xlarge
codesign: true
steps:
- name: Environment
working-directory: .
run: env | sort
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: graalvm/setup-graalvm@d6eca2595046623d69d636041513c80abf745406 # v1.6.9
if: ${{ matrix.musl }}
with:
java-version: '25'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
native-image-musl: 'true'
- uses: graalvm/setup-graalvm@d6eca2595046623d69d636041513c80abf745406 # v1.6.9
if: ${{ !matrix.musl }}
with:
java-version: '25'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
# native-image embeds the build JDK trust store into the binary: drop the Comodo AAA root,
# which chains to the compromised eMudhra intermediates (CVE-2026-91403)
- name: Remove distrusted CA roots
shell: bash
run: |
# JDK-bundled entries carry a " [jdk]" suffix in their alias
alias="comodoaaaca [jdk]"
if keytool -list -cacerts -storepass changeit -alias "$alias" >/dev/null 2>&1; then
keytool -delete -cacerts -storepass changeit -alias "$alias"
echo "Removed '$alias' from the GraalVM trust store"
else
echo "'$alias' not present in the GraalVM trust store"
fi
- name: Run tests
run: |
./gradlew test
- name: Build fat JAR
if: ${{ matrix.fatjar }}
run: ./gradlew shadowJar
- name: Upload fat JAR artifact
if: ${{ matrix.fatjar }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: wave-jar
path: ./wave-cli/app/build/libs/wave.jar
- name: Build static native
if: ${{ matrix.musl }}
run: ./gradlew app:nativeCompile
env:
PLATFORM: linux-x86_64
- name: Build native
if: ${{ !matrix.musl }}
run: ./gradlew app:nativeCompile
- name: Check embedded trust store
shell: bash
run: |
if LC_ALL=C grep -q -a "AAA Certificate Services" app/build/native/nativeCompile/wave*; then
echo "::error::Native binary still embeds the Comodo AAA root (CVE-2026-91403)"
exit 1
fi
- name: Codesign binary
if: ${{ matrix.codesign && needs.detect-release.outputs.release == 'true' }}
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
MACOS_CERTIFICATE_NAME: ${{ secrets.MACOS_CERTIFICATE_NAME }}
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.MACOS_CI_KEYCHAIN_PWD }}
run: |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_CI_KEYCHAIN_PWD" build.keychain
/usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" --options runtime ./app/build/native/nativeCompile/wave -v
- name: Notarize binary
if: ${{ matrix.codesign && needs.detect-release.outputs.release == 'true' }}
env:
MACOS_AC_API_CERT: ${{ secrets.MACOS_AC_API_CERT }}
MACOS_AC_API_ISSUER_ID: ${{ secrets.MACOS_AC_API_ISSUER_ID }}
MACOS_AC_API_KEY_ID: ${{ secrets.MACOS_AC_API_KEY_ID }}
run: |
echo $MACOS_AC_API_CERT | base64 --decode > AuthKey.p8
xcrun notarytool store-credentials "notarytool-profile" -k AuthKey.p8 -d "$MACOS_AC_API_KEY_ID" -i "$MACOS_AC_API_ISSUER_ID"
ditto -c -k --keepParent "./app/build/native/nativeCompile/wave" "notarization.zip"
xcrun notarytool submit "notarization.zip" --keychain-profile "notarytool-profile" --wait
- name: Upload Binary
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: nativeCompile-${{ matrix.os }}
path: ./wave-cli/app/build/native/nativeCompile
- name: Publish tests report
if: failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: test-reports-${{ matrix.os }}
path: |
wave-cli/**/build/reports/tests/test
smoke-test:
name: Smoke test linux-x86_64 on ${{ matrix.os }}
needs: [ build ]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
steps:
- name: Download linux-x86_64 binary
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: nativeCompile-ubuntu-latest
path: ./bin
- name: Run binary
run: |
uname -a
lscpu
ulimit -a
chmod +x ./bin/wave
./bin/wave --version
# must start with a virtual memory limit (#46)
for v in 2000000 1000000; do (ulimit -v $v && ./bin/wave --version); done
release:
name: Release
if: needs.detect-release.outputs.release == 'true'
needs: [ detect-release, build, smoke-test ]
runs-on: ubuntu-latest
permissions:
contents: write
actions: write
steps:
- name: Checkout repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
fetch-depth: 0
- name: Download all build artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
- name: Setup Java for JReleaser
uses: actions/setup-java@cf277c60eb25467037889841efdb72551f06f6c3 # v4.9.1
with:
java-version: '25'
distribution: 'corretto'
- name: Version
id: version
run: |
VERSION=$(cat ./wave-cli/VERSION)
echo "VERSION=$VERSION"
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Enable Homebrew for final release
run: |
VERSION=${{ steps.version.outputs.VERSION }}
if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Homebrew release enabled."
echo "JRELEASER_PACKAGERS_BREW_ACTIVE=ALWAYS" >> $GITHUB_ENV
else
echo "Homebrew release disabled (pre-release detected)."
echo "JRELEASER_PACKAGERS_BREW_ACTIVE=NEVER" >> $GITHUB_ENV
fi
# release notes are taken from the version entry in wave-cli/changelog.txt, because the
# git log of this repository includes the Wave server commits
- name: Release notes
run: |
VERSION=${{ steps.version.outputs.VERSION }}
awk -v v="$VERSION" '
$0 ~ "^"v" - " { found=1; next }
found && /^[0-9]+\.[0-9]+\.[0-9]+.* - / { exit }
found { print }
' ./wave-cli/changelog.txt > ./wave-cli-release-notes.md
if [[ ! -s ./wave-cli-release-notes.md ]]; then
echo "::error::Missing entry for version $VERSION in wave-cli/changelog.txt"
exit 1
fi
cat ./wave-cli-release-notes.md
- name: Run JReleaser
uses: jreleaser/release-action@90ac653bb9c79d11179e65d81499f3f34527dcd5 # 2.5.0
with:
arguments: full-release --config-file wave-cli/jreleaser.yml --basedir .
env:
# the release is created in this repository with the workflow token, the PAT is
# only needed to push the formula to the Homebrew tap repository
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_HOMEBREW_GITHUB_TOKEN: ${{ secrets.JRELEASER_HOMEBREW_GITHUB_TOKEN }}
JRELEASER_PROJECT_VERSION: ${{ steps.version.outputs.VERSION }}
JRELEASER_PACKAGERS_BREW_ACTIVE: ${{ env.JRELEASER_PACKAGERS_BREW_ACTIVE }}
- name: JReleaser release output
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: jreleaser-release
path: |
out/jreleaser/trace.log
out/jreleaser/output.properties
...