-
-
Notifications
You must be signed in to change notification settings - Fork 0
174 lines (144 loc) · 5.29 KB
/
release-packages.yml
File metadata and controls
174 lines (144 loc) · 5.29 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
name: Build and Release Packages
on:
push:
tags:
- "v*"
- "V*"
permissions:
contents: write
jobs:
linux-packages:
name: Linux Packages (AppImage, DEB, RPM)
runs-on: ubuntu-latest
env:
APP_NAME: GraphDigitizer
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Temurin JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
cache: maven
- name: Install packaging dependencies (deb/rpm/fpm)
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
fakeroot rpm ruby ruby-dev rubygems build-essential xz-utils zsync wget
sudo gem install --no-document fpm
- name: Install appimagetool
run: |
set -euxo pipefail
wget -O appimagetool.AppImage https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x appimagetool.AppImage
./appimagetool.AppImage --appimage-extract
sudo mv squashfs-root/AppRun /usr/local/bin/appimagetool
sudo chmod +x /usr/local/bin/appimagetool
- name: Build with Maven
run: mvn -B -ntp -DskipTests package
- name: Download all Maven dependencies (including JavaFX)
run: mvn -B -ntp dependency:resolve dependency:resolve-plugins
- name: Derive version from tag
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"
- name: Ensure scripts executable
run: chmod +x scripts/*.sh
- name: Generate DEB
continue-on-error: true
run: ./scripts/generate-deb.sh "$VERSION"
- name: Generate RPM
continue-on-error: true
run: ./scripts/generate-rpm.sh "$VERSION"
- name: Generate AppImage
continue-on-error: true
run: ./scripts/generate-appimage.sh "$VERSION"
- name: Upload Linux artifacts to Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
target/generated_builds/**/*.deb
target/generated_builds/**/*.rpm
target/generated_builds/**/*.AppImage
fail_on_unmatched_files: false
macos-dmg:
name: macOS DMG
runs-on: macos-latest
env:
APP_NAME: GraphDigitizer
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Temurin JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
cache: maven
- name: Build with Maven
run: mvn -B -ntp -DskipTests package
- name: Derive version from tag
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"
- name: Ensure scripts executable
run: chmod +x scripts/*.sh
- name: Generate DMG
run: ./scripts/generate-dmg.sh "$VERSION"
- name: Upload macOS artifacts to Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
target/generated_builds/**/*.dmg
fail_on_unmatched_files: false
windows-msi:
name: Windows MSI
runs-on: windows-latest
env:
APP_NAME: GraphDigitizer
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Temurin JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
cache: maven
- name: Build with Maven
run: mvn -B -ntp -DskipTests package
- name: Derive version from tag
shell: pwsh
run: |
$version = "${{ github.ref_name }}" -replace '^v', ''
echo "VERSION=$version" >> $env:GITHUB_ENV
- name: Build jlink runtime image
shell: pwsh
run: |
$modules = "java.base,java.desktop,java.logging,java.xml,java.naming,java.sql,jdk.unsupported"
& "$env:JAVA_HOME\bin\jlink.exe" --add-modules $modules --output target\jlink-runtime --strip-debug --no-header-files --no-man-pages --compress=2
- name: Generate MSI with jpackage
shell: pwsh
run: |
$jar = Get-ChildItem -Path target -Filter "*.jar" | Where-Object { $_.Name -notmatch 'sources|original|tests' } | Sort-Object LastWriteTime -Descending | Select-Object -First 1
if (-not $jar) { Write-Error "No JAR found"; exit 1 }
New-Item -ItemType Directory -Path target\generated_builds -Force | Out-Null
& "$env:JAVA_HOME\bin\jpackage.exe" `
--type msi `
--input $jar.DirectoryName `
--main-jar $jar.Name `
--main-class com.digitizer.ui.GraphDigitizerApp `
--name GraphDigitizer `
--app-version "$env:VERSION" `
--dest target\generated_builds `
--runtime-image target\jlink-runtime `
--win-dir-chooser `
--win-menu `
--win-shortcut `
--win-menu-group GraphDigitizer
- name: Upload Windows artifacts to Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
target/generated_builds/**/*.msi
fail_on_unmatched_files: false