2323jobs :
2424 confirm :
2525 if : ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.confirm == 'true' }}
26- name : Confirm Build
2726 runs-on : ubuntu-latest
2827 steps :
29- - name : Confirm Build
30- run : echo "Build confirmed. Proceeding with the build."
28+ - run : echo "Build confirmed. Proceeding with the build."
3129
3230 setup-haxe :
33- name : Setup and Cache Haxe Dependencies
3431 runs-on : ubuntu-latest
3532 needs : confirm
3633 steps :
@@ -43,24 +40,40 @@ jobs:
4340 restore-keys : |
4441 ${{ runner.os }}-haxe-
4542
46- buildLinux :
47- name : Build on Linux
43+ version :
44+ name : Define Version
4845 runs-on : ubuntu-latest
4946 needs : setup-haxe
47+ outputs :
48+ version_tag : ${{ steps.setver.outputs.version }}
49+ steps :
50+ - id : setver
51+ run : echo "version=4.0.0-${{ github.run_id }}" >> "$GITHUB_OUTPUT"
52+ - run : echo "4.0.0-${{ github.run_id }}" > VERSION
53+ - uses : actions/upload-artifact@v4
54+ with :
55+ name : Version
56+ path : VERSION
57+
58+ buildLinux :
59+ runs-on : ubuntu-latest
60+ needs : version
5061 steps :
51- - uses : actions/checkout@v4.1.7
62+ - uses : actions/checkout@v4
63+ - uses : actions/download-artifact@v4
64+ with :
65+ name : Version
5266 - uses : krdlab/setup-haxe@master
5367 with :
5468 haxe-version : ${{ env.HAXE_VERSION }}
5569 - run : |
56- sudo apt-get update
57- sudo apt-get install -y libvlc-dev libvlccore-dev
5870 haxelib setup ~/haxelib
5971 haxelib list | grep -q hxcpp || haxelib install hxcpp --quiet
72+ haxelib list | grep -q lime || haxelib install lime --quiet
73+ haxelib list | grep -q openfl || haxelib install openfl --quiet || true
6074 chmod +x ./setup/unix.sh
6175 ./setup/unix.sh
62- - run : echo "${{ github.run_id }}" > VERSION
63- - run : haxelib run lime build Project.xml linux --app-version="4.0.0-${{ github.run_id }}" $ARGS
76+ - run : haxelib run lime build Project.xml linux --app-version="$(cat VERSION)" "$ARGS"
6477 - uses : actions/upload-artifact@v4
6578 with :
6679 name : Linux Build
@@ -69,15 +82,17 @@ jobs:
6982 compression-level : 9
7083
7184 buildWindows :
72- name : Build on Windows
7385 runs-on : windows-latest
74- needs : setup-haxe
86+ needs : version
7587 continue-on-error : true
7688 strategy :
7789 matrix :
7890 arch : [64, 32]
7991 steps :
80- - uses : actions/checkout@v4.1.7
92+ - uses : actions/checkout@v4
93+ - uses : actions/download-artifact@v4
94+ with :
95+ name : Version
8196 - uses : krdlab/setup-haxe@master
8297 with :
8398 haxe-version : ${{ env.HAXE_VERSION }}
@@ -86,10 +101,8 @@ jobs:
86101 haxelib list | findstr hxcpp || haxelib install hxcpp --quiet
87102 setup\windows.bat
88103 shell: cmd
89- - run : echo " ${{ github.run_id }}" > VERSION
104+ - run : haxelib run lime build windows ${{ matrix.arch == 32 && '-32 -D 32bits' || '' }} --app-version="$(cat VERSION)" "$ARGS"
90105 shell : bash
91- - run : |
92- haxelib run lime build windows ${{ matrix.arch == 32 && '-32 -D 32bits' || '' }} --app-version="4.0.0-${{ github.run_id }}" $ARGS
93106 - uses : actions/upload-artifact@v4
94107 with :
95108 name : Windows Build (x${{ matrix.arch }})
@@ -98,24 +111,26 @@ jobs:
98111 compression-level : 9
99112
100113 buildMac :
101- name : Build on macOS (Universal)
102114 runs-on : macos-13
103- needs : setup-haxe
115+ needs : version
104116 steps :
105- - uses : actions/checkout@v4.1.7
117+ - uses : actions/checkout@v4
118+ - uses : actions/download-artifact@v4
119+ with :
120+ name : Version
106121 - uses : krdlab/setup-haxe@master
107122 with :
108123 haxe-version : ${{ env.HAXE_VERSION }}
109124 - run : |
110125 haxelib setup ~/haxelib
111126 haxelib list | grep -q hxcpp || haxelib install hxcpp --quiet
112127 haxelib list | grep -q lime || haxelib install lime --quiet
128+ haxelib list | grep -q openfl || haxelib install openfl --quiet || true
113129 haxelib run lime rebuild lime mac -64
114130 haxelib run lime rebuild lime mac -Dmac-catalyst -Dmac-arm64
115131 chmod +x ./setup/unix.sh
116132 ./setup/unix.sh
117- - run : echo "${{ github.run_id }}" > VERSION
118- - run : haxelib run lime build mac --app-version="4.0.0-${{ github.run_id }}" $ARGS
133+ - run : haxelib run lime build mac --app-version="$(cat VERSION)" "$ARGS"
119134 - uses : actions/upload-artifact@v4
120135 with :
121136 name : macOS Build
@@ -124,21 +139,21 @@ jobs:
124139 compression-level : 9
125140
126141 Mobile :
127- name : Mobile
128142 runs-on : ubuntu-latest
129- needs : setup-haxe
130- if : ${{ github.event.inputs.Mobile == 'true' }}
143+ needs : version
144+ if : ${{ github.event_name == 'workflow_dispatch' && github. event.inputs.Mobile == 'true' }}
131145 steps :
132- - name : Include Mobile Builds
133- run : echo "Mobile builds are included."
146+ - run : echo "Mobile builds are included."
134147
135148 buildAndroid :
136- name : Build Android
137149 runs-on : ubuntu-latest
138150 needs : Mobile
139151 if : ${{ github.event.inputs.Mobile == 'true' }}
140152 steps :
141- - uses : actions/checkout@v4.1.7
153+ - uses : actions/checkout@v4
154+ - uses : actions/download-artifact@v4
155+ with :
156+ name : Version
142157 - uses : actions/setup-java@v4
143158 with :
144159 distribution : ' temurin'
@@ -158,13 +173,11 @@ jobs:
158173 haxelib setup ~/haxelib
159174 haxelib list | grep -q hxcpp || haxelib install hxcpp --quiet
160175 haxelib list | grep -q lime || haxelib install lime --quiet
161- haxelib list | grep -q openfl || haxelib install openfl --quiet
176+ haxelib list | grep -q openfl || haxelib install openfl --quiet || true
162177 chmod +x ./setup/unix.sh
163178 ./setup/unix.sh
164- - run : echo "${{ github.run_id }}" > VERSION
165- - run : |
166- lime setup android
167- haxelib run lime build android --app-version="4.0.0-${{ github.run_id }}" $ARGS
179+ - run : lime setup android
180+ - run : haxelib run lime build android --app-version="$(cat VERSION)" "$ARGS"
168181 - uses : actions/upload-artifact@v4
169182 with :
170183 name : Android Build
@@ -173,24 +186,25 @@ jobs:
173186 compression-level : 9
174187
175188 buildiOS :
176- name : Build iOS
177189 runs-on : macos-13
178190 needs : Mobile
179191 if : ${{ github.event.inputs.Mobile == 'true' }}
180192 steps :
181- - uses : actions/checkout@v4.1.7
193+ - uses : actions/checkout@v4
194+ - uses : actions/download-artifact@v4
195+ with :
196+ name : Version
182197 - uses : krdlab/setup-haxe@master
183198 with :
184199 haxe-version : ${{ env.HAXE_VERSION }}
185200 - run : |
186201 haxelib setup ~/haxelib
187202 haxelib list | grep -q hxcpp || haxelib install hxcpp --quiet
188203 haxelib list | grep -q lime || haxelib install lime --quiet
189- haxelib list | grep -q openfl || haxelib install openfl --quiet
204+ haxelib list | grep -q openfl || haxelib install openfl --quiet || true
190205 chmod +x ./setup/unix.sh
191206 ./setup/unix.sh
192- - run : echo "${{ github.run_id }}" > VERSION
193- - run : haxelib run lime build ios --app-version="4.0.0-${{ github.run_id }}" $ARGS
207+ - run : haxelib run lime build ios --app-version="$(cat VERSION)" "$ARGS"
194208 - uses : actions/upload-artifact@v4
195209 with :
196210 name : iOS Build
@@ -199,7 +213,6 @@ jobs:
199213 compression-level : 9
200214
201215 notifyDiscord :
202- name : 📣 Notify Discord
203216 runs-on : ubuntu-latest
204217 if : always()
205218 needs :
@@ -208,15 +221,16 @@ jobs:
208221 - buildMac
209222 - buildAndroid
210223 - buildiOS
224+ - version
211225 steps :
212- - name : Send Discord Notification
226+ - name : Notify Discord
213227 env :
214228 DISCORD_WEBHOOK : ${{ secrets.DISCORD_WEBHOOK_URL }}
215229 RUN_URL : https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
216230 COMMIT_URL : https://github.com/${{ github.repository }}/commit/${{ github.sha }}
217231 BRANCH : ${{ github.ref_name }}
218- COMMIT_MESSAGE : >-
219- ${{ github.event.head_commit.message || github.event.pull_request.title || 'Manual Trigger' }}
232+ COMMIT_MESSAGE : ${{ github.event.head_commit.message || github.event.pull_request.title || 'Manual Trigger' }}
233+ VERSION : ${{ needs.version.outputs.version_tag }}
220234 run : |
221235 check() {
222236 case "$1" in
@@ -254,9 +268,10 @@ jobs:
254268 { \"name\": \"📝 Commit Message\", \"value\": \"${COMMIT_MESSAGE}\" },
255269 { \"name\": \"📦 Branch\", \"value\": \"$BRANCH\", \"inline\": true },
256270 { \"name\": \"🔖 Commit\", \"value\": \"[View Commit]($COMMIT_URL)\", \"inline\": true },
257- { \"name\": \"🔗 Workflow Run\", \"value\": \"[Click Here]($RUN_URL)\" }
271+ { \"name\": \"🔗 Workflow Run\", \"value\": \"[Click Here]($RUN_URL)\" },
272+ { \"name\": \"🧾 Version\", \"value\": \"$VERSION\" }
258273 ],
259274 \"footer\": { \"text\": \"Haxe CI • ${{ github.repository }}\" },
260275 \"timestamp\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"
261276 }]
262- }" "$DISCORD_WEBHOOK"
277+ }" "$DISCORD_WEBHOOK"
0 commit comments