Repository navigation
185 lines (155 loc) · 6.11 KB
/
Copy pathrelease.yml
File metadata and controls
185 lines (155 loc) · 6.11 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
name: Release WireTap Native
on:
release:
types: [published]
workflow_dispatch:
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Set up Maven 3.8.8
uses: stCarolas/setup-maven@v5
with:
maven-version: '3.8.8'
- name: Build with Maven
run: mvn clean package
build-macos-native:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: '17'
distribution: 'graalvm-community'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Maven 3.8.8
uses: stCarolas/setup-maven@v5
with:
maven-version: '3.8.8'
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn clean package -DskipTests
- name: Build native image for macOS with Gluon
run: mvn -B gluonfx:build -Dgluonfx.nativeimage.args="--no-fallback,--allow-incomplete-classpath" -Dgluonfx.macos.codesign=false
# Find the produced executable and normalize its name
- name: Locate and normalize macOS binary
run: |
set -euo pipefail
echo "Listing target dir:"
ls -la target/gluonfx/aarch64-darwin || true
# Find first executable file at depth 1
BIN="$(find target/gluonfx/aarch64-darwin -maxdepth 1 -type f -perm -111 | head -n1 || true)"
if [ -z "${BIN}" ]; then
echo "ERROR: No executable found in target/gluonfx/aarch64-darwin"
exit 1
fi
echo "Found executable: ${BIN}"
cp "${BIN}" target/gluonfx/aarch64-darwin/wiretap-macos-arm64
chmod +x target/gluonfx/aarch64-darwin/wiretap-macos-arm64
- name: Create macOS app bundle
run: |
set -euo pipefail
mkdir -p WireTap.app/Contents/MacOS
mkdir -p WireTap.app/Contents/Resources
cp target/gluonfx/aarch64-darwin/wiretap-macos-arm64 WireTap.app/Contents/MacOS/wiretap
# Copy icon if it exists
if [ -f "src/main/resources/icons/icon.icns" ]; then
cp src/main/resources/icons/icon.icns WireTap.app/Contents/Resources/icon.icns
echo "Icon copied to app bundle"
fi
cat > WireTap.app/Contents/Info.plist << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key><string>wiretap</string>
<key>CFBundleIdentifier</key><string>com.wiretap.aol</string>
<key>CFBundleName</key><string>WireTap</string>
<key>CFBundleVersion</key><string>${{ github.event.release.tag_name }}</string>
<key>CFBundleShortVersionString</key><string>${{ github.event.release.tag_name }}</string>
<key>CFBundleInfoDictionaryVersion</key><string>6.0</string>
<key>CFBundlePackageType</key><string>APPL</string>
<key>CFBundleSignature</key><string>????</string>
<key>CFBundleIconFile</key><string>icon.icns</string>
</dict>
</plist>
EOF
# Optional: zip the .app for release
ditto -c -k --sequesterRsrc --keepParent WireTap.app WireTap-macOS.app.zip
- name: Upload macOS executable & app to Release
run: |
gh release upload ${{ github.event.release.tag_name }} target/gluonfx/aarch64-darwin/wiretap-macos-arm64 || true
gh release upload ${{ github.event.release.tag_name }} WireTap-macOS.app.zip || true
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
build-windows-native:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# MSVC (cl.exe) + Windows SDK on PATH
- name: Enable MSVC Build Tools
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: '17'
distribution: 'graalvm-community'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Maven 3.8.8
uses: stCarolas/setup-maven@v5
with:
maven-version: '3.8.8'
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn -B clean package -DskipTests
- name: Build native image for Windows with Gluon
shell: cmd
run: mvn -B gluonfx:build gluonfx:package -Dgluonfx.nativeimage.args="--no-fallback,--allow-incomplete-classpath"
# Normalize names to match your mac artifact style
- name: Normalize Windows artifact names
shell: pwsh
run: |
$out = "target/gluonfx/x86_64-windows"
if (!(Test-Path $out)) { Write-Error "Missing output dir $out"; exit 1 }
$exe = Get-ChildItem "$out" -File -Filter *.exe | Select-Object -First 1
if (!$exe) { Write-Error "No .exe produced"; exit 1 }
Copy-Item $exe.FullName "$out/wiretap-windows-x64.exe" -Force
$msi = Get-ChildItem "$out" -File -Filter *.msi | Select-Object -First 1
if ($msi) { Copy-Item $msi.FullName "$out/wiretap-windows-x64.msi" -Force }
Write-Host "Artifacts:"
Get-ChildItem "$out" -File
- name: Upload Windows artifacts to Release
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: |
$tag = "${{ github.event.release.tag_name }}"
gh release upload $tag `
target/gluonfx/x86_64-windows/wiretap-windows-x64.exe `
target/gluonfx/x86_64-windows/wiretap-windows-x64.msi `
--clobber