11name : Build and Notify
2- description : Build the project for different platforms and notify via Discord
2+
33on :
44 push :
55 branches : [ main ]
66 pull_request :
77 branches : [ main ]
88 workflow_dispatch :
9+ inputs :
10+ confirm :
11+ description : " Confirm to proceed with the build?"
12+ required : true
13+ default : false
14+ type : boolean
15+ includeMobile :
16+ description : " Include Android and iOS builds?"
17+ required : false
18+ default : " false"
919
1020env :
1121 ARGS : " -D officialBuild -D NotDeveloper"
12- HAXE_VERSION : 4.3.6
22+ HAXE_VERSION : 4.3.6
1323
1424jobs :
25+ confirm :
26+ if : ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.confirm == 'true' }}
27+ name : Confirm Build
28+ runs-on : ubuntu-latest
29+
1530 setup-haxe :
1631 name : Setup and Cache Haxe Dependencies
1732 runs-on : ubuntu-latest
33+ needs : confirm
1834 steps :
1935 - uses : actions/cache@v4
2036 with :
@@ -26,56 +42,31 @@ jobs:
2642 runs-on : ubuntu-latest
2743 needs : setup-haxe
2844 steps :
29- - name : Checkout Code
30- uses : actions/checkout@v4.1.7
31- - name : Setup Haxe
32- uses : krdlab/setup-haxe@master
45+ - uses : actions/checkout@v4.1.7
46+ - uses : krdlab/setup-haxe@master
3347 with :
3448 haxe-version : ${{ env.HAXE_VERSION }}
35- - name : Install Dependencies & Setup
36- run : |
49+ - run : |
3750 sudo apt-get update
3851 sudo apt-get install -y libvlc-dev libvlccore-dev
3952 haxelib setup ~/haxelib
4053 haxelib install hxcpp --quiet
4154 chmod +x ./setup/unix.sh
4255 ./setup/unix.sh
43- - name : Create Version Tag
44- run : echo "${{ github.run_id }}" > VERSION
45- - name : Compile for Linux
46- run : haxelib run lime build Project.xml linux --app-version="4.0.0-${{ github.run_id }}" $ARGS
47- - name : Upload Artifact
48- uses : actions/upload-artifact@v4.3.4
49- with :
50- name : linuxBuild
51- path : export/release/linux/bin
52-
53- buildWindows64 :
54- name : Build on Windows (64-bit)
55- runs-on : windows-latest
56- needs : setup-haxe
57- steps :
58- - uses : actions/checkout@v4.1.7
59- - uses : krdlab/setup-haxe@master
60- with :
61- haxe-version : ${{ env.HAXE_VERSION }}
62- - run : |
63- haxelib setup C:/haxelib
64- haxelib install hxcpp --quiet
65- setup\windows.bat
66- shell: cmd
6756 - run : echo "${{ github.run_id }}" > VERSION
68- shell : bash
69- - run : haxelib run lime build windows --app-version="4.0.0-${{ github.run_id }}" $ARGS
70- - uses : actions/upload-artifact@v4.3.4
57+ - run : haxelib run lime build Project.xml linux --app-version="4.0.0-${{ github.run_id }}" $ARGS
58+ - uses : actions/upload-artifact@v4
7159 with :
72- name : windowsBuild64
73- path : export/release/windows /bin
60+ name : Linux Build
61+ path : export/release/linux /bin/**/*
7462
75- buildWindows32 :
76- name : Build on Windows (32-bit )
63+ buildWindows :
64+ name : Build on Windows (64 & 32 )
7765 runs-on : windows-latest
7866 needs : setup-haxe
67+ strategy :
68+ matrix :
69+ arch : [64, 32]
7970 steps :
8071 - uses : actions/checkout@v4.1.7
8172 - uses : krdlab/setup-haxe@master
@@ -88,11 +79,12 @@ jobs:
8879 shell: cmd
8980 - run : echo "${{ github.run_id }}" > VERSION
9081 shell : bash
91- - run : haxelib run lime build windows -32 --app-version="4.0.0-${{ github.run_id }}" $ARGS
92- - uses : actions/upload-artifact@v4.3.4
82+ - run : |
83+ haxelib run lime build windows${{ matrix.arch == 32 && ' -32' || '' }} --app-version="4.0.0-${{ github.run_id }}" $ARGS
84+ - uses : actions/upload-artifact@v4
9385 with :
94- name : windowsBuild32
95- path : export/release/windows/bin
86+ name : Windows Build (x${{ matrix.arch }})
87+ path : export/release/windows${{ matrix.arch }} /bin/**/*
9688
9789 buildMac :
9890 name : Build on macOS (Universal)
@@ -113,97 +105,73 @@ jobs:
113105 ./setup/unix.sh
114106 - run : echo "${{ github.run_id }}" > VERSION
115107 - run : haxelib run lime build mac --app-version="4.0.0-${{ github.run_id }}" $ARGS
116- - uses : actions/upload-artifact@v4.3.4
108+ - uses : actions/upload-artifact@v4
117109 with :
118- name : macBuild
119- path : export/release/macos /bin
110+ name : macOS Build
111+ path : export/release/mac /bin/**/*
120112
121113 buildAndroid :
122- name : Android
114+ name : Build Android
123115 runs-on : ubuntu-latest
124116 needs : setup-haxe
125- if : false
117+ if : ${{ github.event.inputs.includeMobile == 'true' }}
126118 steps :
127- - name : Checkout Code
128- uses : actions/checkout@v4.1.7
129-
130- - name : Setup Java (JDK 17 for Android tools)
131- uses : actions/setup-java@v4
119+ - uses : actions/checkout@v4.1.7
120+ - uses : actions/setup-java@v4
132121 with :
133122 distribution : ' temurin'
134123 java-version : ' 17'
135-
136- - name : Setup Haxe
137- uses : krdlab/setup-haxe@master
124+ - uses : krdlab/setup-haxe@master
138125 with :
139126 haxe-version : ${{ env.HAXE_VERSION }}
140-
141- - name : Setup Android SDK
142- uses : android-actions/setup-android@v3
143-
144- - name : Install Haxe Dependencies
145- run : |
127+ - uses : android-actions/setup-android@v3
128+ - run : |
146129 haxelib setup ~/haxelib
147130 haxelib install hxcpp --quiet
148131 haxelib install lime --quiet
149132 haxelib install openfl --quiet
150133 chmod +x ./setup/unix.sh
151134 ./setup/unix.sh
152-
153- - name : Write Version File
154- run : echo "${{ github.run_id }}" > VERSION
155-
156- - name : Build Android APK
157- run : |
135+ - run : echo "${{ github.run_id }}" > VERSION
136+ - run : |
158137 lime setup android
159138 haxelib run lime build android --app-version="4.0.0-${{ github.run_id }}" $ARGS
160-
161- - name : Upload APK Artifact
162- uses : actions/upload-artifact@v4.3.4
139+ - uses : actions/upload-artifact@v4
163140 with :
164- name : androidBuild
165- path : export/release/android/bin
166-
141+ name : Android Build
142+ path : export/release/android/bin/**/*
143+
167144 buildiOS :
168- name : Build iOS ( I hate this because it's a lot of trouble to set up )
145+ name : Build iOS
169146 runs-on : macos-13
170147 needs : setup-haxe
171- if : false
148+ if : ${{ github.event.inputs.includeMobile == 'true' }}
172149 steps :
173- - name : Checkout Code
174- uses : actions/checkout@v4.1.7
175- - name : Setup Haxe
176- uses : krdlab/setup-haxe@master
150+ - uses : actions/checkout@v4.1.7
151+ - uses : krdlab/setup-haxe@master
177152 with :
178153 haxe-version : ${{ env.HAXE_VERSION }}
179- - name : Install Haxe Dependencies
180- run : |
154+ - run : |
181155 haxelib setup ~/haxelib
182- # Ensure core libs needed for iOS build are present
183- haxelib install hxcpp --quiet # Often needed by Lime targets
156+ haxelib install hxcpp --quiet
184157 haxelib install lime --quiet
185158 haxelib install openfl --quiet
186- # Run the project's specific dependency script
187159 chmod +x ./setup/unix.sh
188160 ./setup/unix.sh
189- - name : Create Version Tag
190- run : echo "${{ github.run_id }}" > VERSION
191- - name : Build for iOS Simulator
192- run : haxelib run lime build ios --app-version="4.0.0-${{ github.run_id }}" $ARGS
193- - name : Upload Artifact
194- uses : actions/upload-artifact@v4.3.4
161+ - run : echo "${{ github.run_id }}" > VERSION
162+ - run : haxelib run lime build ios --app-version="4.0.0-${{ github.run_id }}" $ARGS
163+ - uses : actions/upload-artifact@v4
195164 with :
196- name : iosSimulatorBuild
197- path : export/release/ios/build/Release-iphonesimulator
165+ name : iOS Build
166+ path : export/release/ios/bin/**/*
198167
199168 notifyDiscord :
200169 name : 📣 Notify Discord
201170 runs-on : ubuntu-latest
202171 if : always()
203172 needs :
204173 - buildLinux
205- - buildWindows64
206- - buildWindows32
174+ - buildWindows
207175 - buildMac
208176 - buildAndroid
209177 - buildiOS
@@ -217,23 +185,19 @@ jobs:
217185 BRANCH : ${{ github.ref_name }}
218186 run : |
219187 check() { [[ "$1" == "success" ]] && echo "✅" || echo "❎"; }
220-
221188 TITLE="✅ Build Successful"
222189 COLOR=65280
223-
224- for status in "${{ needs.buildLinux.result }}" "${{ needs.buildWindows64.result }}" "${{ needs.buildWindows32.result }}" "${{ needs.buildMac.result }}" "${{ needs.buildAndroid.result }}" "${{ needs.buildiOS.result }}"; do
225- [[ "$status" != "success" && "$status" != "skip" ]] && TITLE="❎ Build Failed" && COLOR=16711680 && break
190+ for status in "${{ needs.buildLinux.result }}" "${{ needs.buildWindows.result }}" "${{ needs.buildMac.result }}" "${{ needs.buildAndroid.result }}" "${{ needs.buildiOS.result }}"; do
191+ [[ "$status" != "success" && "$status" != "skipped" ]] && TITLE="❎ Build Failed" && COLOR=16711680 && break
226192 done
227-
228193 curl -H "Content-Type: application/json" -X POST -d "{
229194 \"username\": \"Github Action Report\",
230195 \"embeds\": [{
231196 \"title\": \"$TITLE\",
232197 \"color\": $COLOR,
233198 \"fields\": [
234199 { \"name\": \"Linux\", \"value\": \"$(check ${{ needs.buildLinux.result }})\", \"inline\": true },
235- { \"name\": \"Windows 64-bit\", \"value\": \"$(check ${{ needs.buildWindows64.result }})\", \"inline\": true },
236- { \"name\": \"Windows 32-bit\", \"value\": \"$(check ${{ needs.buildWindows32.result }})\", \"inline\": true },
200+ { \"name\": \"Windows\", \"value\": \"$(check ${{ needs.buildWindows.result }})\", \"inline\": true },
237201 { \"name\": \"macOS\", \"value\": \"$(check ${{ needs.buildMac.result }})\", \"inline\": true },
238202 { \"name\": \"Android\", \"value\": \"$(check ${{ needs.buildAndroid.result }})\", \"inline\": true },
239203 { \"name\": \"iOS\", \"value\": \"$(check ${{ needs.buildiOS.result }})\", \"inline\": true },
@@ -242,4 +206,4 @@ jobs:
242206 \"footer\": { \"text\": \"GitHub Actions • ${{ github.repository }}\" },
243207 \"timestamp\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"
244208 }]
245- }" $DISCORD_WEBHOOK
209+ }" $DISCORD_WEBHOOK
0 commit comments