Skip to content

Commit 8fb331c

Browse files
committed
- Update workflow
1 parent d2e0f81 commit 8fb331c

File tree

2 files changed

+48
-75
lines changed

2 files changed

+48
-75
lines changed

.github/actions/get-cc/action.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 48 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ on:
88
branches: [main]
99

1010
env:
11+
BUILD_ASSETS_FOLDER: ./.github/build
1112
BUILD_TYPE: ${{ fromJSON('["dev", "release"]')[startsWith(github.ref, 'refs/tags/v')] }}
12-
CORE_LOVE_PACKAGE_PATH: ./core.love
13+
COLD_CLEAR_DOWNLOAD_URL: https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/11.4
1314
CORE_LOVE_ARTIFACT_NAME: core_love_package
15+
CORE_LOVE_PACKAGE_PATH: ./core.love
1416

1517
jobs:
1618
get-info:
@@ -101,7 +103,7 @@ jobs:
101103
path: ${{ env.CORE_LOVE_PACKAGE_PATH }}
102104
- name: Add icon to love package
103105
run: |
104-
cp ./.github/build/linux/${{ env.BUILD_TYPE }}/icon.png media/image/icon.png
106+
cp ${{ env.BUILD_ASSETS_FOLDER }}/linux/${{ env.BUILD_TYPE }}/icon.png media/image/icon.png
105107
zip -u ${{ env.CORE_LOVE_PACKAGE_PATH }} media/image/icon.png
106108
rm media/image/icon.png
107109
- name: Rename love package
@@ -167,6 +169,7 @@ jobs:
167169
needs: [get-info, build-core, auto-test]
168170
if: github.event_name != 'pull_request'
169171
env:
172+
COLD_CLEAR_FOLDER: ./libAndroid
170173
OUTPUT_FOLDER: ./build
171174
RELEASE_FOLDER: ./release
172175
steps:
@@ -179,6 +182,7 @@ jobs:
179182
run: |
180183
import os
181184
import re
185+
182186
with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
183187
if "${{ env.BUILD_TYPE }}" == "dev":
184188
f.write('bundle-id=org.f26_studio.' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '.snapshot\n')
@@ -191,10 +195,10 @@ jobs:
191195
with:
192196
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
193197
- name: Download ColdClear
194-
uses: ./.github/actions/get-cc
198+
uses: ./.github/actions/get-unzip
195199
with:
196-
platform: Android
197-
dir: ./libAndroid
200+
url: ${{ env.COLD_CLEAR_DOWNLOAD_URL }}/Android.zip
201+
dir: ${{ env.COLD_CLEAR_FOLDER }}
198202
- name: Build Android packages
199203
id: build-packages
200204
uses: love-actions/love-actions-android@main
@@ -207,8 +211,8 @@ jobs:
207211
keystore-key-password: ${{ secrets.ANDROID_KEYSTORE_KEYPASSWORD }}
208212
keystore-store-password: ${{ secrets.ANDROID_KEYSTORE_STOREPASSWORD }}
209213
love-package: ${{ env.CORE_LOVE_PACKAGE_PATH }}
210-
resource-path: ./.github/build/android/${{ env.BUILD_TYPE }}/res
211-
extra-assets: ./libAndroid/
214+
resource-path: ${{ env.BUILD_ASSETS_FOLDER }}/android/${{ env.BUILD_TYPE }}/res
215+
extra-assets: ${{ env.COLD_CLEAR_FOLDER }}
212216
custom-scheme: studio26f://oauth
213217
product-name: ${{ steps.process-app-name.outputs.product-name }}
214218
version-string: ${{ needs.get-info.outputs.version-string }}
@@ -238,8 +242,8 @@ jobs:
238242
build-linux:
239243
runs-on: ubuntu-latest
240244
needs: [get-info, build-core, auto-test]
241-
if: ${{ !always()}}
242245
env:
246+
COLD_CLEAR_FOLDER: ./ColdClear
243247
OUTPUT_FOLDER: ./build
244248
RELEASE_FOLDER: ./release
245249
steps:
@@ -263,18 +267,18 @@ jobs:
263267
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
264268
- name: Add icon to love package
265269
run: |
266-
cp ./.github/build/linux/${{ env.BUILD_TYPE }}/icon.png media/image/icon.png
270+
cp ${{ env.BUILD_ASSETS_FOLDER }}/linux/${{ env.BUILD_TYPE }}/icon.png media/image/icon.png
267271
zip -u ${{ env.CORE_LOVE_PACKAGE_PATH }} media/image/icon.png
268272
rm media/image/icon.png
269273
- name: Download ColdClear
270-
uses: ./.github/actions/get-cc
274+
uses: ./.github/actions/get-unzip
271275
with:
272-
platform: Linux
273-
dir: ./ColdClear
276+
url: ${{ env.COLD_CLEAR_DOWNLOAD_URL }}/Linux.zip
277+
dir: ${{ env.COLD_CLEAR_FOLDER }}
274278
- name: Process ColdClear
275279
shell: bash
276280
run: |
277-
cd ./ColdClear
281+
cd ${{ env.COLD_CLEAR_FOLDER }}
278282
mkdir -p ./lib/lua/5.1
279283
mv ./x64/CCloader.so ./lib/lua/5.1
280284
- name: Build Linux packages
@@ -285,9 +289,9 @@ jobs:
285289
bundle-id: ${{ steps.process-app-name.outputs.bundle-id }}
286290
description: Techmino is fun!
287291
version-string: ${{ needs.get-info.outputs.version-string }}
288-
icon-path: ./.github/build/linux/${{ env.BUILD_TYPE }}/icon.png
292+
icon-path: ${{ env.BUILD_ASSETS_FOLDER }}/linux/${{ env.BUILD_TYPE }}/icon.png
289293
love-package: ${{ env.CORE_LOVE_PACKAGE_PATH }}
290-
lib-path: ./ColdClear/lib
294+
lib-path: ${{ env.COLD_CLEAR_FOLDER }}/lib
291295
product-name: ${{ steps.process-app-name.outputs.product-name }}
292296
output-folder: ${{ env.OUTPUT_FOLDER }}
293297
- name: Upload AppImage artifact
@@ -322,9 +326,9 @@ jobs:
322326
build-macos-portable:
323327
runs-on: macos-latest
324328
needs: [get-info, build-core, auto-test]
325-
# if: github.event_name != 'pull_request'
326-
if: ${{ !always()}}
329+
if: github.event_name != 'pull_request'
327330
env:
331+
COLD_CLEAR_FOLDER: ./ColdClear
328332
OUTPUT_FOLDER: ./build
329333
RELEASE_FOLDER: ./release
330334
steps:
@@ -345,31 +349,31 @@ jobs:
345349
with:
346350
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
347351
- name: Download ColdClear
348-
uses: ./.github/actions/get-cc
352+
uses: ./.github/actions/get-unzip
349353
with:
350-
platform: macOS
351-
dir: ./ColdClear
354+
url: ${{ env.COLD_CLEAR_DOWNLOAD_URL }}/macOS.zip
355+
dir: ${{ env.COLD_CLEAR_FOLDER }}
352356
- name: Process ColdClear
353357
shell: bash
354358
run: |
355-
rm ./ColdClear/universal/libcold_clear.a
356-
- name: Use Xcode 15.3
357-
# Xcode 15.4 segfaults
358-
# see https://forums.developer.apple.com/forums/thread/757398
359-
uses: mobiledevops/xcode-select-version-action@v1
360-
with:
361-
xcode-select-version: 15.3
359+
rm ${{ env.COLD_CLEAR_FOLDER }}/universal/libcold_clear.a
360+
# - name: Use Xcode 15.3
361+
# # Xcode 15.4 segfaults
362+
# # see https://forums.developer.apple.com/forums/thread/757398
363+
# uses: mobiledevops/xcode-select-version-action@v1
364+
# with:
365+
# xcode-select-version: 15.3
362366
- name: Build macOS packages
363367
id: build-packages
364368
uses: love-actions/love-actions-macos-portable@v1
365369
with:
366370
app-name: ${{ needs.get-info.outputs.app-name }}
367371
bundle-id: ${{ steps.process-app-name.outputs.bundle-id }}
368372
copyright: "Copyright © 2019-2023 26F-Studio. Some Rights Reserved."
369-
icon-path: ./.github/build/macOS/${{ env.BUILD_TYPE }}/icon.icns
370-
love-ref: "11.5"
373+
icon-path: ${{ env.BUILD_ASSETS_FOLDER }}/macOS/${{ env.BUILD_TYPE }}/icon.icns
374+
love-ref: "11.4"
371375
love-package: ${{ env.CORE_LOVE_PACKAGE_PATH }}
372-
libs-path: ./ColdClear/universal/
376+
libs-path: ${{ env.COLD_CLEAR_FOLDER }}/universal/
373377
product-name: ${{ steps.process-app-name.outputs.product-name }}
374378
version-string: ${{ needs.get-info.outputs.version-string }}
375379
output-folder: ${{ env.OUTPUT_FOLDER }}
@@ -380,12 +384,12 @@ jobs:
380384
developer-id-application-password: ${{ secrets.APPLE_CERT_DEVELOPER_ID_APPLICATION_PWD }}
381385
developer-id-installer-base64: ${{ secrets.APPLE_CERT_DEVELOPER_ID_INSTALLER }}
382386
developer-id-installer-password: ${{ secrets.APPLE_CERT_DEVELOPER_ID_INSTALLER_PWD }}
383-
dmg-background-path: ./.github/build/macOS/${{ env.BUILD_TYPE }}/dmg.png
387+
dmg-background-path: ${{ env.BUILD_ASSETS_FOLDER }}/macOS/${{ env.BUILD_TYPE }}/dmg.png
384388
dmg-icon-position: "239 203"
385389
dmg-icon-size: "100"
386390
dmg-link-position: "565 203"
387391
dmg-text-size: "12"
388-
dmg-volume-icon-path: ./.github/build/macOS/${{ env.BUILD_TYPE }}/dmg.icns
392+
dmg-volume-icon-path: ${{ env.BUILD_ASSETS_FOLDER }}/macOS/${{ env.BUILD_TYPE }}/dmg.icns
389393
dmg-volume-name: ${{ steps.process-app-name.outputs.product-name }}
390394
dmg-window-position: "200 120"
391395
dmg-window-size: "800 500"
@@ -423,7 +427,7 @@ jobs:
423427
name: ${{ needs.get-info.outputs.update-title }}
424428
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }}
425429

426-
build-web:
430+
build-web-compat:
427431
runs-on: ubuntu-latest
428432
needs: [get-info, build-core, auto-test]
429433
if: ${{ !always()}}
@@ -443,7 +447,7 @@ jobs:
443447
npx love.js ${{ env.CORE_LOVE_PACKAGE_PATH }} ${{ env.OUTPUT_FOLDER }} -t "${{ needs.get-info.outputs.app-name }}" -m ${{ env.MEMORY_LIMIT }} -c
444448
- name: Move assets
445449
run: |
446-
mv ./.github/build/web/${{ env.BUILD_TYPE }}/* ${{ env.OUTPUT_FOLDER }}
450+
mv ${{ env.BUILD_ASSETS_FOLDER }}/web/${{ env.BUILD_TYPE }}/* ${{ env.OUTPUT_FOLDER }}
447451
- name: Initialize Love.js Api Player
448452
run: |
449453
pushd ${{ env.OUTPUT_FOLDER }}
@@ -472,6 +476,7 @@ jobs:
472476
needs: [get-info, build-core, auto-test]
473477
if: ${{ !always()}}
474478
env:
479+
COLD_CLEAR_FOLDER: ./ColdClear
475480
OUTPUT_FOLDER: ./build
476481
RELEASE_FOLDER: ./release
477482
steps:
@@ -491,16 +496,16 @@ jobs:
491496
with:
492497
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
493498
- name: Download ColdClear
494-
uses: ./.github/actions/get-cc
499+
uses: ./.github/actions/get-unzip
495500
with:
496-
platform: Windows
497-
dir: ./ColdClear
501+
url: ${{ env.COLD_CLEAR_DOWNLOAD_URL }}/Windows.zip
502+
dir: ${{ env.COLD_CLEAR_FOLDER }}
498503
- name: Update Windows template
499504
shell: python3 {0}
500505
run: |
501506
version_string = "${{ needs.get-info.outputs.version-string }}"
502507
file_version = (f"{version_string.replace('.', ',')},0")
503-
with open("./.github/build/windows/${{ env.BUILD_TYPE }}/template.rc", "r+", encoding="utf8") as file:
508+
with open("${{ env.BUILD_ASSETS_FOLDER }}/windows/${{ env.BUILD_TYPE }}/template.rc", "r+", encoding="utf8") as file:
504509
data = file.read()
505510
data = data\
506511
.replace("@Version", version_string)\
@@ -512,11 +517,11 @@ jobs:
512517
id: build-packages
513518
uses: love-actions/love-actions-windows@v1
514519
with:
515-
icon-path: ./.github/build/windows/${{ env.BUILD_TYPE }}/icon.ico
516-
rc-path: ./.github/build/windows/${{ env.BUILD_TYPE }}/template.rc
520+
icon-path: ${{ env.BUILD_ASSETS_FOLDER }}/windows/${{ env.BUILD_TYPE }}/icon.ico
521+
rc-path: ${{ env.BUILD_ASSETS_FOLDER }}/windows/${{ env.BUILD_TYPE }}/template.rc
517522
love-package: ${{ env.CORE_LOVE_PACKAGE_PATH }}
518-
extra-assets-x86: ./ColdClear/x86/CCloader.dll ./ColdClear/x86/cold_clear.dll ./.github/build/extraLibs/Windows_x64/discord-rpc.dll
519-
extra-assets-x64: ./ColdClear/x64/CCloader.dll ./ColdClear/x64/cold_clear.dll ./.github/build/extraLibs/Windows_x86/discord-rpc.dll
523+
extra-assets-x86: ${{ env.COLD_CLEAR_FOLDER }}/x86/CCloader.dll ${{ env.COLD_CLEAR_FOLDER }}/x86/cold_clear.dll ${{ env.BUILD_ASSETS_FOLDER }}/extraLibs/Windows_x64/discord-rpc.dll
524+
extra-assets-x64: ${{ env.COLD_CLEAR_FOLDER }}/x64/CCloader.dll ${{ env.COLD_CLEAR_FOLDER }}/x64/cold_clear.dll ${{ env.BUILD_ASSETS_FOLDER }}/extraLibs/Windows_x86/discord-rpc.dll
520525
product-name: ${{ steps.process-app-name.outputs.product-name }}
521526
app-id: ${{ secrets.WINDOWS_APP_ID }}
522527
project-website: https://www.studio26f.org/
@@ -569,7 +574,7 @@ jobs:
569574
build-android,
570575
build-linux,
571576
build-macos-portable,
572-
build-web,
577+
build-web-compat,
573578
build-windows,
574579
]
575580
env:

0 commit comments

Comments
 (0)