-
-
Notifications
You must be signed in to change notification settings - Fork 10
155 lines (137 loc) · 5.79 KB
/
test.yml
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
name: Test
on:
push:
pull_request:
workflow_dispatch:
jobs:
jar-and-media:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Get branch name
id: branch-name
uses: tj-actions/[email protected]
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'
check-latest: true
cache: 'gradle'
- uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper
- uses: luangong/setup-install4j@v1
with:
version: 10.0.7
license: ${{ secrets.INSTALL4J_LICENSE }}
- name: Build with Gradle
run: |
./gradlew -Pversion=${{ steps.branch-name.outputs.current_branch }} generateLicenseReport --info --full-stacktrace
./gradlew -Pversion=${{ steps.branch-name.outputs.current_branch }} build media --info --full-stacktrace
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: jar-and-media
path: |
media
build
buildSrc/build
serverpackcreator-api/build
serverpackcreator-app/build
serverpackcreator-web-frontend/dist
serverpackcreator-plugin-example/build
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn`
appimage:
runs-on: ubuntu-latest
steps:
# GET THE LATEST CODE
- name: Checkout latest code
uses: actions/[email protected]
with:
fetch-depth: 0
# BUILD PROJECT AND PUBLISH
- name: Set up JDK 21
id: java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'
check-latest: true
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper
- name: Prepare
env:
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./gradlew -Pversion=${{ steps.branch-name.outputs.current_branch }} generateLicenseReport --info --full-stacktrace
./gradlew build --info --full-stacktrace
- name: Build Image
run: |
jpackage \
--app-version "6.6.6" \
--copyright "Copyright (C) 2024 Griefed" \
--description "Create server packs from Minecraft Forge, NeoForge, Fabric, Quilt or LegacyFabric modpacks." \
--dest serverpackcreator-app/build/dist \
--icon serverpackcreator-app/jpackagerResources/app.png \
--input serverpackcreator-app/build/libs \
--java-options "-Dfile.encoding=UTF-8" \
--java-options "-Dlog4j2.formatMsgNoLookups=true" \
--main-class org.springframework.boot.loader.launch.JarLauncher \
--main-jar serverpackcreator-app-dev.jar \
--name ServerPackCreator \
--resource-dir serverpackcreator-app/jpackagerResources \
--runtime-image $JAVA_HOME \
--temp serverpackcreator-app/build/tmp/jpackager \
--type "app-image" \
--vendor "griefed.de" \
--verbose
- name: List
if: ${{ always() }}
run: ls -ahl serverpackcreator-app/build/dist
- name: Create AppImage
run: |
mkdir -p serverpackcreator-app/build/dist/ServerPackCreator.AppDir/usr/share/applications && \
mkdir -p serverpackcreator-app/build/dist/ServerPackCreator.AppDir/usr/icons/hicolor/512x512 && \
mkdir -p serverpackcreator-app/build/dist/ServerPackCreator.AppDir/usr/icons/hicolor/scalable && \
cp -rf serverpackcreator-app/build/dist/ServerPackCreator/* \
serverpackcreator-app/build/dist/ServerPackCreator.AppDir && \
cp serverpackcreator-app/jpackagerResources/appimage.desktop \
serverpackcreator-app/build/dist/ServerPackCreator.AppDir/usr/share/applications/ServerPackCreator.desktop && \
cp serverpackcreator-app/jpackagerResources/appimage.png \
serverpackcreator-app/build/dist/ServerPackCreator.AppDir/usr/icons/hicolor/512x512/ServerPackCreator.png && \
cp serverpackcreator-app/jpackagerResources/appimage.svg \
serverpackcreator-app/build/dist/ServerPackCreator.AppDir/usr/icons/hicolor/scalable/ServerPackCreator.svg && \
cd serverpackcreator-app/build/dist/ServerPackCreator.AppDir && \
ln -s bin/ServerPackCreator \
AppRun && \
ln -s usr/share/applications/ServerPackCreator.desktop \
ServerPackCreator.desktop && \
ln -s usr/icons/hicolor/512x512/ServerPackCreator.png \
ServerPackCreator.png && \
ln -s usr/icons/hicolor/scalable/ServerPackCreator.svg \
ServerPackCreator.svg && \
cd .. && \
curl \
-L https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage \
-o appimagetool.AppImage && \
chmod +x appimagetool.AppImage && \
./appimagetool.AppImage --appimage-extract && \
export PATH=./squashfs-root/usr/bin:${PATH} && \
appimagetool \
ServerPackCreator.AppDir \
ServerPackCreator-Portable-Linux-x86_64.AppImage
# UPLOAD OS-SPECIFICS
- name: Upload
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: appimage
path: |
serverpackcreator-app/build/dist/ServerPackCreator-Portable-Linux-x86_64.AppImage
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn`