-
-
Notifications
You must be signed in to change notification settings - Fork 1
307 lines (257 loc) · 12.2 KB
/
Copy pathbuild.yml
File metadata and controls
307 lines (257 loc) · 12.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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
# .github/workflows/build.yml
# This workflow builds, packages, and creates a draft release for the application on Windows (x64),
# macOS (x64, arm64), and Linux (x64, arm64), including AppImage for Linux.
name: Build and Release
on:
push:
branches: [ "release" ]
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: true
matrix:
include:
- os: ubuntu-22.04
arch: "x64"
runner: "ubuntu-22.04"
gradle_task: "packageReleaseDeb"
os_name: "ubuntu"
- os: ubuntu-22.04-arm
arch: "arm64"
runner: "ubuntu-22.04-arm"
gradle_task: "packageReleaseDeb"
os_name: "ubuntu"
- os: ubuntu-latest
arch: "x64"
runner: "ubuntu-latest"
os_name: "rocky-linux-8"
- os: ubuntu-24.04-arm
arch: "arm64"
runner: "ubuntu-24.04-arm"
os_name: "rocky-linux-8"
- os: macos-13
arch: "x64"
runner: "macos-13"
gradle_task: "packageReleaseDmg packageReleasePkg"
os_name: "macos"
- os: macos-latest
arch: "arm64"
runner: "macos-15"
gradle_task: "packageReleaseDmg packageReleasePkg"
os_name: "macos"
- os: windows-latest
arch: "x64"
runner: "windows-latest"
gradle_task: "packageReleaseMsi packageReleaseExe"
os_name: "windows"
- os: windows-11-arm
arch: "arm64"
runner: "windows-11-arm"
gradle_task: "packageReleaseMsi packageReleaseExe"
os_name: "windows"
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Update and Install Dependencies for Ubuntu
if: runner.os == 'Linux'
run: |
sudo apt-get update
- name: Install Dependencies for Rocky Linux
if: matrix.os_name == 'rocky-linux-8'
run: |
sudo apt-get install -y curl wget git gnupg ca-certificates libfuse2 curl unzip binutils file libglib2.0-0
- name: Set up JDK 21 for Windows ARM
if: matrix.os == 'windows-11-arm'
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'
architecture: ${{ matrix.arch }}
- name: Set up JDK 24 for other architectures
if: ${{ matrix.os != 'windows-11-arm' && matrix.os_name != 'rocky-linux-8' }}
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '24'
architecture: ${{ matrix.arch }}
- name: Remove JVM args for Windows ARM
if: matrix.os == 'windows-11-arm'
shell: powershell
run: |
$content = Get-Content composeApp/build.gradle.kts
$content = $content | Where-Object {
$_ -notmatch '"--enable-native-access=ALL-UNNAMED",' -and
$_ -notmatch '"--illegal-native-access=deny"'
}
$content | Set-Content composeApp/build.gradle.kts
- name: Grant execute permission for gradlew
if: runner.os != 'Windows'
run: chmod +x ./gradlew
- name: Build Jar with Gradle on Windows
if: matrix.os_name == 'windows'
shell: bash
run: ./gradlew.bat -PosArch=${{ matrix.arch }} ${{ matrix.gradle_task }} packageReleaseUberJarForCurrentOS
- name: Build Jar with Gradle on macOS
if: matrix.os_name == 'macos'
run: ./gradlew -PosArch=${{ matrix.arch }} ${{ matrix.gradle_task }} packageReleaseUberJarForCurrentOS
- name: Build Jar with Gradle on Ubuntu
if: matrix.os_name == 'ubuntu'
run: ./gradlew -PosArch=${{ matrix.arch }} ${{ matrix.gradle_task }} packageReleaseUberJarForCurrentOS
- name: Build AppImage on Rocky Linux 8
if: matrix.os_name == 'rocky-linux-8'
shell: bash
run: |
docker run --rm \
-v ${{ github.workspace }}:${{ github.workspace }} \
-w ${{ github.workspace }} \
-e ARCH=${{ matrix.arch }} \
-e WORKSPACE_PATH="${{ github.workspace }}" \
rockylinux:8 /bin/bash packaging/build-scripts/package.sh
- name: Rename Packages for Release
shell: bash
run: |
ARTIFACT_DIR="composeApp/build/compose/binaries/main-release"
ARCH="${{ matrix.arch }}"
rename_files() {
DIR_PATH="$1"
EXT="$2"
if [ -d "$DIR_PATH" ]; then
for f in "$DIR_PATH"/*."$EXT"; do
if [ -f "$f" ]; then
# Constructs the new name, e.g., app-1.0.0.msi -> app-1.0.0-x64.msi
NEW_NAME="$(basename "$f" ."$EXT")-$ARCH.$EXT"
echo "Renaming $f to $DIR_PATH/$NEW_NAME"
mv "$f" "$DIR_PATH/$NEW_NAME"
fi
done
fi
}
# Rename only the package types that have conflicting names
rename_files "$ARTIFACT_DIR/dmg" "dmg"
rename_files "$ARTIFACT_DIR/pkg" "pkg"
rename_files "$ARTIFACT_DIR/msi" "msi"
rename_files "$ARTIFACT_DIR/exe" "exe"
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: package-${{ matrix.os_name }}-${{ matrix.arch }}
path: |
composeApp/build/compose/binaries/main-release/deb/*.deb
composeApp/build/compose/binaries/main-release/appimage/*.AppImage
composeApp/build/compose/binaries/main-release/appimage/*.zsync
composeApp/build/compose/binaries/main-release/dmg/*.dmg
composeApp/build/compose/binaries/main-release/pkg/*.pkg
composeApp/build/compose/binaries/main-release/msi/*.msi
composeApp/build/compose/binaries/main-release/exe/*.exe
composeApp/build/compose/jars/*.jar
composeApp/build/compose/binaries/main-release/tarball/*.tar.gz
retention-days: 1
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Get Project Version
id: get_version
run: |
# Extracts the version from the line 'packageVersion = "1.0.0"'
VERSION=$(grep 'packageVersion = ' composeApp/build.gradle.kts | head -n 1 | sed -e 's/.*packageVersion = "\(.*\)"/\1/')
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Download all build artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create Draft Release
uses: softprops/action-gh-release@v2
with:
name: Pomolin v${{ steps.get_version.outputs.version }} Beta
draft: false
prerelease: false
make_latest: true
tag_name: v${{ steps.get_version.outputs.version }}
body: |
## Description
Pomolin is a simple, beautiful, and minimalist Pomodoro timer for your desktop. Designed to help you stay focused and productive, it provides an elegant and straightforward way to manage your work and break intervals. With a clean interface and essential features, Pomolin helps you get into a rhythm of focused work sessions followed by refreshing breaks, all from a native desktop application.
## Installation
### Windows
- **Installer**: Download the `.exe` or `.msi` installer for easy setup with automatic shortcuts and uninstaller
### macOS
- **Installer**: Download the `.dmg` or `.pkg` installer for standard macOS installation
### Linux
- **AppImage** (Recommended): Download the `.AppImage` file for universal compatibility across distributions
- **Flatpak**: Available for sandboxed installation. Note: Flatpak from releases does not auto-update. For auto-updates, install from Flathub or GNOME Software
- **Package**: Download `.deb` for Debian/Ubuntu-based systems or `.tar.gz` for manual extraction
### Java
- **JAR File**: Requires Java 24 installed (Java 21 for Windows 11 ARM64)
- **Run Command**: `java -jar pomolin-windows-x64-1.1.8-release.jar`
#### Linux Installation Tools
For AppImage files, consider using:
- **AppImageLauncher**: Provides desktop integration and automatic updates for AppImage applications
- **Gear Lever**: A modern AppImage manager with GUI for organizing and running AppImage files
## System Requirements
- **Java Runtime**: Java 24 required for JAR files (Java 21 for Windows 11 ARM64)
- **Operating Systems**: Windows 10+, macOS 10.14+, Linux (distributions released after 2019)
- **Architecture Support**: x64, ARM64
## Download Instructions
1. Choose the appropriate package for your operating system and architecture from the assets below
2. All builds are automatically generated and tested via GitHub Actions
3. For JAR files, ensure you have the correct Java version installed
4. Follow your platform's standard installation procedures
## Package Types Available
- **Windows**: `.exe` installer, `.msi` installer, `.jar` portable
- **macOS**: `.dmg` installer, `.pkg` installer, `.jar` portable
- **Linux**: `.AppImage` portable, `.flatpak` package, `.tar.gz` archive, `.deb` package, `.jar` portable
- **Cross-platform**: Universal `.jar` files for any Java-compatible system
## Support
If you encounter any issues with AppImage, Flatpak, or any other installation method, please report them using GitHub Issues. Include your operating system, architecture, and installation method when reporting problems.
files: artifacts/**/*
build-flatpak:
name: Build Flatpak
needs: release # This job will start only after the 'release' job is successful
runs-on: ${{ matrix.runner }}
permissions:
contents: write
strategy:
fail-fast: true
matrix:
include:
- arch: "x64"
flatpak_arch: "x86_64"
runner: "ubuntu-latest"
- arch: "arm64"
flatpak_arch: "aarch64"
runner: "ubuntu-24.04-arm"
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Get Project Version
id: get_version
run: |
VERSION=$(grep 'packageVersion = ' composeApp/build.gradle.kts | head -n 1 | sed -e 's/.*packageVersion = "\(.*\)"/\1/')
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Install Flatpak dependencies
run: |
sudo apt-get update
sudo apt-get install -y flatpak-builder
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
sudo flatpak install --noninteractive flathub org.freedesktop.Sdk/${{ matrix.flatpak_arch }}/24.08
sudo flatpak install --noninteractive flathub org.freedesktop.Platform/${{ matrix.flatpak_arch }}/24.08
sudo flatpak install --noninteractive flathub org.freedesktop.Sdk.Extension.openjdk/${{ matrix.flatpak_arch }}/24.08
- name: Build Flatpak Bundle
run: |
echo "Building Flatpak for ${{ matrix.flatpak_arch }}"
# 1. Build the Flatpak from the manifest file
flatpak-builder --force-clean --repo=repo build-dir packaging/flatpak/pomolin.yml
# 2. Create a single-file bundle from the repository
flatpak build-bundle repo pomolin-${{ matrix.flatpak_arch }}.flatpak io.github.redddfoxxyy.pomolin
echo "Flatpak bundle created: pomolin-${{ matrix.flatpak_arch }}.flatpak"
- name: Upload Flatpak to Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload v${{ steps.get_version.outputs.version }} pomolin-${{ matrix.flatpak_arch }}.flatpak --clobber