-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (87 loc) · 3.1 KB
/
release.yml
File metadata and controls
99 lines (87 loc) · 3.1 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
# SPDX-FileCopyrightText: 2026 Project516 <138796702+Project516@users.noreply.github.com>
#
# SPDX-License-Identifier: GPL-3.0-or-later
name: Build and Upload Release Assets
on:
release:
types: [created]
jobs:
build-assets:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: true
matrix:
target:
- name: jar
command: ./gradlew build && cp app/build/libs/app-all.jar NumberGuessingGame.jar
artifact: NumberGuessingGame.jar
path: ./NumberGuessingGame.jar
- name: deb
command: ./package-deb.sh
artifact: NumberGuessingGame.deb
path: ./NumberGuessingGame.deb
- name: rpm
command: ./package-rpm.sh
artifact: NumberGuessingGame.rpm
path: ./NumberGuessingGame.rpm
needsRpmTools: true
- name: zip
command: ./package-zip.sh
artifact: NumberGuessingGame-archive.zip
path: ./NumberGuessingGame-archive.zip
- name: windows
command: ./package-win.sh
artifact: NumberGuessingGame-windows.zip
path: ./NumberGuessingGame-windows.zip
- name: macos
command: ./package-macos.sh
artifact: NumberGuessingGame-macos.zip
path: ./NumberGuessingGame-macos.zip
- name: linux
command: ./package-linux.sh
artifact: NumberGuessingGame-linux.tar.xz
path: ./NumberGuessingGame-linux.tar.xz
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
java-version: '25'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
- name: Install RPM build tools
if: ${{ matrix.target.needsRpmTools }}
run: sudo apt-get update && sudo apt-get install -y rpm
- name: Build ${{ matrix.target.name }}
run: ${{ matrix.target.command }}
- name: Upload ${{ matrix.target.name }} artifact
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.target.artifact }}
path: ${{ matrix.target.path }}
if-no-files-found: error
create-release:
runs-on: ubuntu-latest
needs: build-assets
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v8
with:
path: dist
- name: Upload release assets
uses: softprops/action-gh-release@v3
with:
files: |
dist/NumberGuessingGame.jar/NumberGuessingGame.jar
dist/NumberGuessingGame.deb/NumberGuessingGame.deb
dist/NumberGuessingGame.rpm/NumberGuessingGame.rpm
dist/NumberGuessingGame-archive.zip/NumberGuessingGame-archive.zip
dist/NumberGuessingGame-windows.zip/NumberGuessingGame-windows.zip
dist/NumberGuessingGame-macos.zip/NumberGuessingGame-macos.zip
dist/NumberGuessingGame-linux.tar.xz/NumberGuessingGame-linux.tar.xz