|
5 | 5 | workflow_dispatch: |
6 | 6 |
|
7 | 7 | jobs: |
8 | | - buildWindows: |
9 | | - name: Build Windows Application |
10 | | - runs-on: windows-latest |
11 | | - |
| 8 | + build: |
| 9 | + name: Build Game |
| 10 | + strategy: |
| 11 | + matrix: |
| 12 | + include: |
| 13 | + - target: windows |
| 14 | + runs-on: windows-latest |
| 15 | + |
| 16 | + - target: macos |
| 17 | + runs-on: macos-latest |
| 18 | + |
| 19 | + - target: linux |
| 20 | + runs-on: ubuntu-latest |
| 21 | + |
| 22 | + - target: ios |
| 23 | + runs-on: macos-26 |
| 24 | + |
| 25 | + - target: android |
| 26 | + runs-on: ubuntu-latest |
| 27 | + runs-on: |
| 28 | + - ${{matrix.runs-on}} |
12 | 29 | steps: |
13 | | - - name: Download Source Code |
14 | | - uses: actions/checkout@v4 |
| 30 | + - name: Checkout Repository |
| 31 | + uses: funkincrew/ci-checkout@main |
15 | 32 |
|
16 | 33 | - name: Setup Haxe |
17 | | - uses: krdlab/setup-haxe@master |
| 34 | + uses: funkincrew/ci-haxe@master |
18 | 35 | with: |
19 | 36 | haxe-version: 4.3.7 |
20 | 37 |
|
21 | | - - name: Retrieve Haxelib Cache |
22 | | - id: windows-haxelib-cache |
23 | | - uses: actions/cache@v4 |
| 38 | + - name: Install HMM with Funkin' Patches |
| 39 | + run: | |
| 40 | + haxelib --debug --never --global git haxelib https://github.com/FunkinCrew/haxelib.git funkin-patches --skip-dependencies |
| 41 | + haxelib --debug --never --global git hmm https://github.com/FunkinCrew/hmm funkin-patches |
| 42 | + haxelib --debug --never newrepo |
| 43 | +
|
| 44 | + - name: Restore HMM Cache |
| 45 | + id: hmm-cache |
| 46 | + uses: actions/cache@main |
24 | 47 | with: |
25 | | - path: | |
26 | | - C:/haxelib/** |
27 | | - .haxelib/** |
28 | | - key: ${{ runner.os }}-haxelib-cache |
| 48 | + path: .haxelib |
| 49 | + key: ${{runner.os}}-hmm |
29 | 50 |
|
30 | | - - name: Install Haxe Libraries using HMM |
31 | | - run: | |
32 | | - haxelib install hmm --quiet |
33 | | - haxelib run hmm install |
| 51 | + - name: Install Dependencies using HMM |
| 52 | + run: haxelib --global run hmm install -q |
34 | 53 |
|
35 | 54 | - name: Compile HXCPP Build Tools |
36 | 55 | run: | |
37 | 56 | cd .haxelib/hxcpp/git/tools/hxcpp |
38 | 57 | haxe compile.hxml |
39 | 58 | cd ../../../../.. |
40 | 59 |
|
41 | | - - name: Compile Application |
42 | | - run: haxelib run lime build windows |
43 | | - |
44 | | - - name: Upload Artifact |
45 | | - uses: actions/upload-artifact@v4 |
46 | | - with: |
47 | | - name: TechNotDrip-Engine_WINDOWS |
48 | | - path: export/release/windows/bin/ |
49 | | - |
50 | | - buildMacOS: |
51 | | - name: Build MacOS Application |
52 | | - runs-on: macos-latest |
53 | | - |
54 | | - steps: |
55 | | - - name: Download Source Code |
56 | | - uses: actions/checkout@v4 |
57 | | - |
58 | | - - name: Setup Haxe |
59 | | - uses: krdlab/setup-haxe@master |
60 | | - with: |
61 | | - haxe-version: 4.3.7 |
62 | | - |
63 | | - - name: Retrieve Haxelib Cache |
64 | | - id: macos-haxelib-cache |
| 60 | + - name: Restore hxcpp cache |
65 | 61 | uses: actions/cache@v4 |
66 | 62 | with: |
67 | | - path: | |
68 | | - ~/haxelib/** |
69 | | - .haxelib/** |
70 | | - key: ${{ runner.os }}-haxelib-cache |
| 63 | + path: ${{runner.temp}}/hxcpp_cache |
| 64 | + key: ${{runner.os}}-hxcpp |
71 | 65 |
|
72 | | - - name: Install Haxe Libraries using HMM |
| 66 | + - name: Configure HXCPP Cache |
| 67 | + shell: bash |
73 | 68 | run: | |
74 | | - haxelib install hmm --quiet |
75 | | - haxelib run hmm install |
76 | | -
|
77 | | - - name: Compile Application |
78 | | - run: haxelib run lime build macos |
| 69 | + echo "HXCPP_COMPILE_CACHE=${{runner.temp}}/hxcpp_cache" >> "$GITHUB_ENV" |
| 70 | + echo 'HXCPP_CACHE_MB="4096"' >> "$GITHUB_ENV" |
| 71 | + haxelib run hxcpp cache list |
79 | 72 |
|
80 | | - - name: Upload Artifact |
81 | | - uses: actions/upload-artifact@v4 |
82 | | - with: |
83 | | - name: TechNotDrip-Engine_MACOS |
84 | | - path: export/release/macos/bin/ |
85 | | - |
86 | | - buildLinux: |
87 | | - name: Build Linux Application |
88 | | - runs-on: ubuntu-latest |
89 | | - |
90 | | - steps: |
91 | | - - name: Download Source Code |
92 | | - uses: actions/checkout@v4 |
93 | | - |
94 | | - - name: Setup Haxe |
95 | | - uses: krdlab/setup-haxe@master |
96 | | - with: |
97 | | - haxe-version: 4.3.7 |
98 | | - |
99 | | - - name: Retrieve Haxelib Cache |
100 | | - id: linux-haxelib-cache |
101 | | - uses: actions/cache@v4 |
102 | | - with: |
103 | | - path: | |
104 | | - ~/haxelib/** |
105 | | - .haxelib/** |
106 | | - key: ${{ runner.os }}-haxelib-cache |
107 | | - |
108 | | - - name: Install Haxe Libraries using HMM |
| 73 | + - name: Install Linux Dependencies |
| 74 | + if: ${{runner.os == 'Linux'}} |
109 | 75 | run: | |
110 | | - sudo apt install -qq libvlccore-dev libvlc-dev -y |
111 | | - haxelib install hmm --quiet |
112 | | - haxelib run hmm install |
113 | | -
|
114 | | - - name: Compile HXCPP Build Tools |
115 | | - run: | |
116 | | - cd .haxelib/hxcpp/git/tools/hxcpp |
117 | | - haxe compile.hxml |
118 | | - cd ../../../../.. |
119 | | -
|
120 | | - - name: Compile Application |
121 | | - run: haxelib run lime build linux |
122 | | - |
123 | | - - name: Upload Artifact |
124 | | - uses: actions/upload-artifact@v4 |
125 | | - with: |
126 | | - name: TechNotDrip-Engine_LINUX |
127 | | - path: export/release/linux/bin/ |
128 | | - |
129 | | - buildAndroid: |
130 | | - name: Build Android Application |
131 | | - runs-on: ubuntu-latest |
132 | | - |
133 | | - steps: |
134 | | - - name: Download Source Code |
135 | | - uses: actions/checkout@v4 |
136 | | - |
137 | | - - name: Setup Haxe |
138 | | - uses: krdlab/setup-haxe@master |
139 | | - with: |
140 | | - haxe-version: 4.3.7 |
| 76 | + sudo apt-get -y install libvlc-dev libvlccore-dev |
141 | 77 |
|
142 | 78 | - name: Setup Android NDK |
143 | | - uses: nttld/setup-ndk@v1 |
| 79 | + uses: nttld/setup-ndk@main |
| 80 | + if: ${{matrix.target == 'android'}} |
144 | 81 | id: ndk |
145 | 82 | with: |
146 | 83 | ndk-version: r21e |
147 | 84 |
|
148 | 85 | - name: Setup Java |
149 | | - uses: actions/setup-java@v4 |
| 86 | + uses: actions/setup-java@main |
| 87 | + if: ${{matrix.target == 'android'}} |
150 | 88 | with: |
151 | | - distribution: 'oracle' |
| 89 | + distribution: 'temurin' |
152 | 90 | java-version: '17' |
153 | 91 |
|
154 | | - - name: Retrieve Haxelib Cache |
155 | | - id: android-haxelib-cache |
156 | | - uses: actions/cache@v4 |
157 | | - with: |
158 | | - path: | |
159 | | - ~/haxelib/** |
160 | | - .haxelib/** |
161 | | - key: android-haxelib-cache |
162 | | - |
163 | | - - name: Install Haxe Libraries using HMM |
164 | | - run: | |
165 | | - sudo apt install libvlccore-dev libvlc-dev -y -q |
166 | | - haxelib install hmm --quiet |
167 | | - haxelib run hmm install |
168 | | -
|
169 | | - - name: Compile HXCPP Build Tools |
170 | | - run: | |
171 | | - cd .haxelib/hxcpp/git/tools/hxcpp |
172 | | - haxe compile.hxml |
173 | | - cd ../../../../.. |
174 | | -
|
175 | 92 | - name: Configure Android |
| 93 | + if: ${{matrix.target == 'android'}} |
176 | 94 | run: | |
177 | 95 | haxelib run lime config ANDROID_SDK $ANDROID_HOME |
178 | | - haxelib run lime config ANDROID_NDK_ROOT ${{ steps.ndk.outputs.ndk-path }} |
| 96 | + haxelib run lime config ANDROID_NDK_ROOT ${{steps.ndk.outputs.ndk-path}} |
179 | 97 | haxelib run lime config JAVA_HOME $JAVA_HOME |
180 | 98 | haxelib run lime config ANDROID_SETUP true |
181 | 99 |
|
182 | | - - name: Compile Application |
183 | | - run: haxelib run lime build android |
184 | | - |
185 | | - - name: Upload Artifact |
186 | | - uses: actions/upload-artifact@v4 |
187 | | - with: |
188 | | - name: TechNotDrip-Engine_ANDROID |
189 | | - path: export/release/android/bin/app/build/outputs/apk/debug/*.apk |
190 | | - |
191 | | - buildiOS: |
192 | | - name: Build iOS Application |
193 | | - runs-on: macos-latest |
194 | | - |
195 | | - steps: |
196 | | - - name: Download Source Code |
197 | | - uses: actions/checkout@v4 |
| 100 | + - name: Compile the Application |
| 101 | + if: ${{matrix.target != 'ios'}} |
| 102 | + run: haxelib run lime build ${{matrix.target}} |
198 | 103 |
|
199 | | - - name: Setup Haxe |
200 | | - uses: krdlab/setup-haxe@master |
201 | | - with: |
202 | | - haxe-version: 4.3.7 |
| 104 | + - name: Compile the Application (No Signing) |
| 105 | + if: ${{matrix.target == 'ios'}} |
| 106 | + run: haxelib run lime build ios -nosign |
203 | 107 |
|
204 | | - - name: Retrieve Haxelib Cache |
205 | | - id: ios-haxelib-cache |
206 | | - uses: actions/cache@v4 |
| 108 | + - name: Format Artifact String |
| 109 | + uses: ASzc/change-string-case-action@v6 |
| 110 | + id: artifact-string |
207 | 111 | with: |
208 | | - path: | |
209 | | - ~/haxelib/** |
210 | | - .haxelib/** |
211 | | - key: ios-haxelib-cache |
212 | | - |
213 | | - - name: Install Haxe Libraries using HMM |
214 | | - run: | |
215 | | - haxelib install hmm --quiet |
216 | | - haxelib run hmm install |
217 | | -
|
218 | | - - name: Compile HXCPP Build Tools |
219 | | - run: | |
220 | | - cd .haxelib/hxcpp/git/tools/hxcpp |
221 | | - haxe compile.hxml |
222 | | - cd ../../../../.. |
223 | | -
|
224 | | - - name: Compile Application |
225 | | - run: haxelib run lime build ios -nosign |
| 112 | + string: ${{matrix.target}} |
226 | 113 |
|
227 | 114 | - name: Zip up IPA File |
| 115 | + if: ${{matrix.target == 'ios'}} |
228 | 116 | run: | |
229 | 117 | cd export/release/ios/build/Release-iphoneos |
230 | 118 | mkdir Payload |
231 | 119 | mv *.app Payload |
232 | | - zip -r TechNotDrip.ipa Payload |
| 120 | + zip -r TechNotDripEngine.ipa Payload |
233 | 121 |
|
234 | 122 | - name: Upload Artifact |
| 123 | + if: ${{ matrix.target != 'ios' && matrix.target != 'android' }} |
| 124 | + uses: actions/upload-artifact@v4 |
| 125 | + with: |
| 126 | + name: TechNotDrip-Engine_${{steps.artifact-string.outputs.uppercase}} |
| 127 | + path: export/release/${{matrix.target}}/bin/ |
| 128 | + |
| 129 | + - name: Upload Artifact (on iOS) |
| 130 | + if: ${{ matrix.target == 'ios' }} |
235 | 131 | uses: actions/upload-artifact@v4 |
236 | 132 | with: |
237 | 133 | name: TechNotDrip-Engine_IOS |
238 | 134 | path: export/release/ios/build/Release-iphoneos/*.ipa |
| 135 | + |
| 136 | + - name: Upload Artifact (on Android) |
| 137 | + if: ${{ matrix.target == 'android' }} |
| 138 | + uses: actions/upload-artifact@v4 |
| 139 | + with: |
| 140 | + name: TechNotDrip-Engine_ANDROID |
| 141 | + path: export/release/android/bin/app/build/outputs/apk/debug/*.apk |
0 commit comments