Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

Commit f78f0fa

Browse files
committed
Refactor Android build process in GitHub Actions: standardize environment variable usage and improve APK build steps
1 parent 73a60cf commit f78f0fa

File tree

1 file changed

+21
-34
lines changed

1 file changed

+21
-34
lines changed

.github/workflows/main.yml

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,8 @@ on:
88
workflow_dispatch:
99

1010
env:
11-
Args: "-D officialBuild -D NotDeveloper"
12-
JAVA_HOME: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.14-7/x64
13-
JAVA_HOME_17_X64: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.14-7/x64
14-
NEKOPATH: /opt/hostedtoolcache/neko/2.4.0/x64
15-
LD_LIBRARY_PATH: /opt/hostedtoolcache/neko/2.4.0/x64:$LD_LIBRARY_PATH
16-
HAXE_STD_PATH: /opt/hostedtoolcache/haxe/4.3.6/x64/std
17-
ANDROID_HOME: /usr/local/lib/android/sdk
18-
ANDROID_SDK_ROOT: /usr/local/lib/android/sdk
19-
ANDROID_SDK: /usr/local/lib/android/sdk
20-
ANDROID_NDK_ROOT: /usr/local/lib/android/sdk/ndk/27.2.12479018
11+
ARGS: "-D officialBuild -D NotDeveloper"
12+
HAXE_VERSION : 4.3.6
2113

2214
jobs:
2315
setup-haxe:
@@ -39,7 +31,7 @@ jobs:
3931
- name: Setup Haxe
4032
uses: krdlab/setup-haxe@master
4133
with:
42-
haxe-version: 4.3.6
34+
haxe-version: ${{ env.HAXE_VERSION }}
4335
- name: Install Dependencies & Setup
4436
run: |
4537
sudo apt-get update
@@ -51,7 +43,7 @@ jobs:
5143
- name: Create Version Tag
5244
run: echo "${{ github.run_id }}" > VERSION
5345
- name: Compile for Linux
54-
run: haxelib run lime build Project.xml linux --app-version="4.0.0-${{ github.run_id }}" $Args
46+
run: haxelib run lime build Project.xml linux --app-version="4.0.0-${{ github.run_id }}" $ARGS
5547
- name: Upload Artifact
5648
uses: actions/upload-artifact@v4.3.4
5749
with:
@@ -66,15 +58,15 @@ jobs:
6658
- uses: actions/checkout@v4.1.7
6759
- uses: krdlab/setup-haxe@master
6860
with:
69-
haxe-version: 4.3.6
61+
haxe-version: ${{ env.HAXE_VERSION }}
7062
- run: |
7163
haxelib setup C:/haxelib
7264
haxelib install hxcpp --quiet
7365
setup\windows.bat
7466
shell: cmd
7567
- run: echo "${{ github.run_id }}" > VERSION
7668
shell: bash
77-
- run: haxelib run lime build windows --app-version="4.0.0-${{ github.run_id }}" $Args
69+
- run: haxelib run lime build windows --app-version="4.0.0-${{ github.run_id }}" $ARGS
7870
- uses: actions/upload-artifact@v4.3.4
7971
with:
8072
name: windowsBuild64
@@ -88,15 +80,15 @@ jobs:
8880
- uses: actions/checkout@v4.1.7
8981
- uses: krdlab/setup-haxe@master
9082
with:
91-
haxe-version: 4.3.6
83+
haxe-version: ${{ env.HAXE_VERSION }}
9284
- run: |
9385
haxelib setup C:/haxelib
9486
haxelib install hxcpp --quiet
9587
setup\windows.bat
9688
shell: cmd
9789
- run: echo "${{ github.run_id }}" > VERSION
9890
shell: bash
99-
- run: haxelib run lime build windows -32 --app-version="4.0.0-${{ github.run_id }}" $Args
91+
- run: haxelib run lime build windows -32 --app-version="4.0.0-${{ github.run_id }}" $ARGS
10092
- uses: actions/upload-artifact@v4.3.4
10193
with:
10294
name: windowsBuild32
@@ -110,7 +102,7 @@ jobs:
110102
- uses: actions/checkout@v4.1.7
111103
- uses: krdlab/setup-haxe@master
112104
with:
113-
haxe-version: 4.3.6
105+
haxe-version: ${{ env.HAXE_VERSION }}
114106
- run: |
115107
haxelib setup ~/haxelib
116108
haxelib install hxcpp --quiet
@@ -120,7 +112,7 @@ jobs:
120112
chmod +x ./setup/unix.sh
121113
./setup/unix.sh
122114
- run: echo "${{ github.run_id }}" > VERSION
123-
- run: haxelib run lime build mac --app-version="4.0.0-${{ github.run_id }}" $Args
115+
- run: haxelib run lime build mac --app-version="4.0.0-${{ github.run_id }}" $ARGS
124116
- uses: actions/upload-artifact@v4.3.4
125117
with:
126118
name: macBuild
@@ -134,15 +126,15 @@ jobs:
134126
- uses: actions/checkout@v4.1.7
135127
- uses: krdlab/setup-haxe@master
136128
with:
137-
haxe-version: 4.3.6
129+
haxe-version: ${{ env.HAXE_VERSION }}
138130
- run: |
139131
haxelib setup ~/haxelib
140132
haxelib install lime --quiet
141133
haxelib install openfl --quiet
142134
chmod +x ./setup/unix.sh
143135
./setup/unix.sh
144136
- run: echo "${{ github.run_id }}" > VERSION
145-
- run: haxelib run lime build html5 --app-version="4.0.0-${{ github.run_id }}" $Args
137+
- run: haxelib run lime build html5 --app-version="4.0.0-${{ github.run_id }}" $ARGS
146138
- uses: actions/upload-artifact@v4.3.4
147139
with:
148140
name: webBuild
@@ -152,16 +144,7 @@ jobs:
152144
name: Android
153145
runs-on: ubuntu-latest
154146
needs: setup-haxe
155-
env:
156-
JAVA_HOME: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.14-7/x64
157-
JAVA_HOME_17_X64: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.14-7/x64
158-
NEKOPATH: /opt/hostedtoolcache/neko/2.4.0/x64
159-
LD_LIBRARY_PATH: /opt/hostedtoolcache/neko/2.4.0/x64:$LD_LIBRARY_PATH
160-
HAXE_STD_PATH: /opt/hostedtoolcache/haxe/4.3.6/x64/std
161-
ANDROID_HOME: /usr/local/lib/android/sdk
162-
ANDROID_SDK_ROOT: /usr/local/lib/android/sdk
163-
ANDROID_SDK: /usr/local/lib/android/sdk
164-
ANDROID_NDK_ROOT: /usr/local/lib/android/sdk/ndk/27.2.12479018
147+
if: false
165148
steps:
166149
- name: Checkout Code
167150
uses: actions/checkout@v4.1.7
@@ -175,7 +158,7 @@ jobs:
175158
- name: Setup Haxe
176159
uses: krdlab/setup-haxe@master
177160
with:
178-
haxe-version: 4.3.6
161+
haxe-version: ${{ env.HAXE_VERSION }}
179162

180163
- name: Setup Android SDK
181164
uses: android-actions/setup-android@v3
@@ -188,13 +171,17 @@ jobs:
188171
haxelib install openfl --quiet
189172
chmod +x ./setup/unix.sh
190173
./setup/unix.sh
174+
175+
haxelib git extension-androidtools https://github.com/jigsaw-4277821/extension-androidtools
176+
haxelib git extension-androidtools https://github.com/jigsaw-4277821/extension-videoview
191177
192178
- name: Write Version File
193179
run: echo "${{ github.run_id }}" > VERSION
194180

195181
- name: Build Android APK
196182
run: |
197-
haxelib run lime build android --app-version="4.0.0-${{ github.run_id }}" $Args
183+
lime setup android
184+
haxelib run lime build android --app-version="4.0.0-${{ github.run_id }}" $ARGS
198185
199186
- name: Upload APK Artifact
200187
uses: actions/upload-artifact@v4.3.4
@@ -213,7 +200,7 @@ jobs:
213200
- name: Setup Haxe
214201
uses: krdlab/setup-haxe@master
215202
with:
216-
haxe-version: 4.3.6
203+
haxe-version: ${{ env.HAXE_VERSION }}
217204
- name: Install Haxe Dependencies
218205
run: |
219206
haxelib setup ~/haxelib
@@ -227,7 +214,7 @@ jobs:
227214
- name: Create Version Tag
228215
run: echo "${{ github.run_id }}" > VERSION
229216
- name: Build for iOS Simulator
230-
run: haxelib run lime build ios --app-version="4.0.0-${{ github.run_id }}" $Args
217+
run: haxelib run lime build ios --app-version="4.0.0-${{ github.run_id }}" $ARGS
231218
- name: Upload Artifact
232219
uses: actions/upload-artifact@v4.3.4
233220
with:

0 commit comments

Comments
 (0)