CI update workflow (#1175)
(cherry picked from commit 64ddb09060)
Co-authored-by: MrZ_26 <1046101471@qq.com>
This commit is contained in:
32
.github/actions/get-cc/action.yml
vendored
32
.github/actions/get-cc/action.yml
vendored
@@ -1,32 +0,0 @@
|
|||||||
name: 'get cc'
|
|
||||||
description: 'download cc into specific dir'
|
|
||||||
inputs:
|
|
||||||
tag:
|
|
||||||
required: false
|
|
||||||
default: "11.4.2"
|
|
||||||
platform:
|
|
||||||
required: true
|
|
||||||
dir:
|
|
||||||
required: false
|
|
||||||
default: '.'
|
|
||||||
repo:
|
|
||||||
required: false
|
|
||||||
default: 26F-Studio/cold_clear_ai_love2d_wrapper
|
|
||||||
temp-file:
|
|
||||||
required: false
|
|
||||||
default: temp.zip
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- run: |
|
|
||||||
echo "tag="$(if [ -z "${{ inputs.tag }}" ]
|
|
||||||
then curl -w '%{url_effective}' -I -L -s -S https://github.com/${{ inputs.repo }}/releases/latest -o /dev/null | grep -o '\<[^/]*$'
|
|
||||||
else echo ${{ inputs.tag }}
|
|
||||||
fi) >> $GITHUB_OUTPUT
|
|
||||||
id: get-tag
|
|
||||||
shell: bash
|
|
||||||
- uses: ./.github/actions/get-unzip
|
|
||||||
with:
|
|
||||||
url: https://github.com/${{ inputs.repo }}/releases/download/${{ steps.get-tag.outputs.tag }}/${{ inputs.platform }}.zip
|
|
||||||
dir: ${{ inputs.dir }}
|
|
||||||
temp-file: ${{ inputs.temp-file }}
|
|
||||||
304
.github/workflows/main.yml
vendored
304
.github/workflows/main.yml
vendored
@@ -8,9 +8,11 @@ on:
|
|||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
BUILD_ASSETS_FOLDER: ./.github/build
|
||||||
BUILD_TYPE: ${{ fromJSON('["dev", "release"]')[startsWith(github.ref, 'refs/tags/v')] }}
|
BUILD_TYPE: ${{ fromJSON('["dev", "release"]')[startsWith(github.ref, 'refs/tags/v')] }}
|
||||||
CORE_LOVE_PACKAGE_PATH: ./core.love
|
COLD_CLEAR_DOWNLOAD_URL: https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper/releases/download/11.5
|
||||||
CORE_LOVE_ARTIFACT_NAME: core_love_package
|
CORE_LOVE_ARTIFACT_NAME: core_love_package
|
||||||
|
CORE_LOVE_PACKAGE_PATH: ./core.love
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
get-info:
|
get-info:
|
||||||
@@ -25,7 +27,7 @@ jobs:
|
|||||||
commit-hash: ${{ steps.git-info.outputs.commit-hash }}
|
commit-hash: ${{ steps.git-info.outputs.commit-hash }}
|
||||||
base-name: ${{ steps.assemble-base-name.outputs.base-name }}
|
base-name: ${{ steps.assemble-base-name.outputs.base-name }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Install lua
|
- name: Install lua
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install lua5.3 -y
|
sudo apt-get install lua5.3 -y
|
||||||
@@ -73,7 +75,7 @@ jobs:
|
|||||||
OUTPUT_FOLDER: ./build
|
OUTPUT_FOLDER: ./build
|
||||||
RELEASE_FOLDER: ./release
|
RELEASE_FOLDER: ./release
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Process app name
|
- name: Process app name
|
||||||
@@ -95,13 +97,13 @@ jobs:
|
|||||||
build-list: ./media/ ./parts/ ./Zframework/ ./conf.lua ./main.lua ./version.lua ./legals.md ./license.txt
|
build-list: ./media/ ./parts/ ./Zframework/ ./conf.lua ./main.lua ./version.lua ./legals.md ./license.txt
|
||||||
package-path: ${{ env.CORE_LOVE_PACKAGE_PATH }}
|
package-path: ${{ env.CORE_LOVE_PACKAGE_PATH }}
|
||||||
- name: Upload core love package
|
- name: Upload core love package
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
|
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
|
||||||
path: ${{ env.CORE_LOVE_PACKAGE_PATH }}
|
path: ${{ env.CORE_LOVE_PACKAGE_PATH }}
|
||||||
- name: Add icon to love package
|
- name: Add icon to love package
|
||||||
run: |
|
run: |
|
||||||
cp ./.github/build/linux/${{ env.BUILD_TYPE }}/icon.png media/image/icon.png
|
cp ${{ env.BUILD_ASSETS_FOLDER }}/linux/${{ env.BUILD_TYPE }}/icon.png media/image/icon.png
|
||||||
zip -u ${{ env.CORE_LOVE_PACKAGE_PATH }} media/image/icon.png
|
zip -u ${{ env.CORE_LOVE_PACKAGE_PATH }} media/image/icon.png
|
||||||
rm media/image/icon.png
|
rm media/image/icon.png
|
||||||
- name: Rename love package
|
- name: Rename love package
|
||||||
@@ -109,7 +111,7 @@ jobs:
|
|||||||
mkdir -p ${{ env.OUTPUT_FOLDER }}
|
mkdir -p ${{ env.OUTPUT_FOLDER }}
|
||||||
mv ${{ env.CORE_LOVE_PACKAGE_PATH }} ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.love
|
mv ${{ env.CORE_LOVE_PACKAGE_PATH }} ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.love
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ needs.get-info.outputs.base-name }}_Core_love
|
name: ${{ needs.get-info.outputs.base-name }}_Core_love
|
||||||
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.love
|
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.love
|
||||||
@@ -132,45 +134,46 @@ jobs:
|
|||||||
auto-test:
|
auto-test:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
needs: build-core
|
needs: build-core
|
||||||
|
env:
|
||||||
|
APPIMAGE_PATH: ./love.AppImage
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
# - name: Love actions for testing
|
- name: Love actions for testing
|
||||||
# uses: love-actions/love-actions-test@v1
|
uses: love-actions/love-actions-test@v1
|
||||||
# with:
|
with:
|
||||||
# font-path: ./parts/fonts/proportional.otf
|
font-path: ./parts/fonts/proportional.otf
|
||||||
# language-folder: ./parts/language
|
language-folder: ./parts/language
|
||||||
# - name: Download core love package
|
- name: Download core love package
|
||||||
# uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4
|
||||||
# with:
|
with:
|
||||||
# name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
|
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
|
||||||
# - name: Download love
|
- name: Download love
|
||||||
# shell: bash
|
shell: bash
|
||||||
# run: |
|
run: |
|
||||||
# curl -OL --retry 5 https://github.com/love2d/love/releases/download/11.4/love-11.4-x86_64.AppImage
|
curl --retry 5 https://github.com/love2d/love/releases/download/11.5/love-11.5-x86_64.AppImage -o ${{ env.APPIMAGE_PATH }}
|
||||||
# chmod +x love-11.4-x86_64.AppImage
|
chmod +x ${{ env.APPIMAGE_PATH }}
|
||||||
# - name: Prepare PulseAudio and AppImage
|
- name: Install dependencies
|
||||||
# shell: bash
|
shell: bash
|
||||||
# run: |
|
run: |
|
||||||
# sudo apt-get update
|
sudo apt-get update
|
||||||
# sudo apt-get install pulseaudio pulseaudio-utils pavucontrol alsa-oss alsa-utils libfuse2 -y
|
sudo apt-get install alsa-oss alsa-utils libfuse2 pavucontrol pulseaudio pulseaudio-utils x11-xserver-utils xvfb -y
|
||||||
# - name: Run automated test
|
- name: Run automated test
|
||||||
# uses: coactions/setup-xvfb@v1
|
shell: bash
|
||||||
# with:
|
run: |
|
||||||
# run: |
|
xvfb-run --auto-servernum ${{ env.APPIMAGE_PATH }} ${{ env.CORE_LOVE_PACKAGE_PATH }} --test
|
||||||
# ./love-11.4-x86_64.AppImage ${{ env.CORE_LOVE_PACKAGE_PATH }} --test
|
|
||||||
|
|
||||||
build-android:
|
build-android:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [get-info, build-core, auto-test]
|
needs: [get-info, build-core, auto-test]
|
||||||
# if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
if: ${{ !always()}}
|
|
||||||
env:
|
env:
|
||||||
|
COLD_CLEAR_FOLDER: ./libAndroid
|
||||||
OUTPUT_FOLDER: ./build
|
OUTPUT_FOLDER: ./build
|
||||||
RELEASE_FOLDER: ./release
|
RELEASE_FOLDER: ./release
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Process app name
|
- name: Process app name
|
||||||
@@ -179,6 +182,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
|
with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
|
||||||
if "${{ env.BUILD_TYPE }}" == "dev":
|
if "${{ env.BUILD_TYPE }}" == "dev":
|
||||||
f.write('bundle-id=org.f26_studio.' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '.snapshot\n')
|
f.write('bundle-id=org.f26_studio.' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '.snapshot\n')
|
||||||
@@ -187,17 +191,17 @@ jobs:
|
|||||||
f.write('bundle-id=org.f26_studio.' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
|
f.write('bundle-id=org.f26_studio.' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
|
||||||
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '-', '${{ needs.get-info.outputs.app-name }}') + '\n')
|
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '-', '${{ needs.get-info.outputs.app-name }}') + '\n')
|
||||||
- name: Download core love package
|
- name: Download core love package
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
|
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
|
||||||
- name: Download ColdClear
|
- name: Download ColdClear
|
||||||
uses: ./.github/actions/get-cc
|
uses: ./.github/actions/get-unzip
|
||||||
with:
|
with:
|
||||||
platform: Android
|
url: ${{ env.COLD_CLEAR_DOWNLOAD_URL }}/Android.zip
|
||||||
dir: ./libAndroid
|
dir: ${{ env.COLD_CLEAR_FOLDER }}
|
||||||
- name: Build Android packages
|
- name: Build Android packages
|
||||||
id: build-packages
|
id: build-packages
|
||||||
uses: love-actions/love-actions-android@main
|
uses: love-actions/love-actions-android@v2
|
||||||
with:
|
with:
|
||||||
app-name: ${{ needs.get-info.outputs.app-name }}
|
app-name: ${{ needs.get-info.outputs.app-name }}
|
||||||
bundle-id: ${{ steps.process-app-name.outputs.bundle-id }}
|
bundle-id: ${{ steps.process-app-name.outputs.bundle-id }}
|
||||||
@@ -207,15 +211,15 @@ jobs:
|
|||||||
keystore-key-password: ${{ secrets.ANDROID_KEYSTORE_KEYPASSWORD }}
|
keystore-key-password: ${{ secrets.ANDROID_KEYSTORE_KEYPASSWORD }}
|
||||||
keystore-store-password: ${{ secrets.ANDROID_KEYSTORE_STOREPASSWORD }}
|
keystore-store-password: ${{ secrets.ANDROID_KEYSTORE_STOREPASSWORD }}
|
||||||
love-package: ${{ env.CORE_LOVE_PACKAGE_PATH }}
|
love-package: ${{ env.CORE_LOVE_PACKAGE_PATH }}
|
||||||
resource-path: ./.github/build/android/${{ env.BUILD_TYPE }}/res
|
resource-path: ${{ env.BUILD_ASSETS_FOLDER }}/android/${{ env.BUILD_TYPE }}/res
|
||||||
extra-assets: ./libAndroid/
|
extra-assets: ${{ env.COLD_CLEAR_FOLDER }}
|
||||||
custom-scheme: studio26f://oauth
|
custom-scheme: studio26f://oauth
|
||||||
product-name: ${{ steps.process-app-name.outputs.product-name }}
|
product-name: ${{ steps.process-app-name.outputs.product-name }}
|
||||||
version-string: ${{ needs.get-info.outputs.version-string }}
|
version-string: ${{ needs.get-info.outputs.version-string }}
|
||||||
version-code: ${{ needs.get-info.outputs.version-code }}
|
version-code: ${{ needs.get-info.outputs.version-code }}
|
||||||
output-folder: ${{ env.OUTPUT_FOLDER }}
|
output-folder: ${{ env.OUTPUT_FOLDER }}
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ needs.get-info.outputs.base-name }}_Android_release
|
name: ${{ needs.get-info.outputs.base-name }}_Android_release
|
||||||
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}-release.apk
|
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}-release.apk
|
||||||
@@ -238,12 +242,12 @@ jobs:
|
|||||||
build-linux:
|
build-linux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [get-info, build-core, auto-test]
|
needs: [get-info, build-core, auto-test]
|
||||||
if: ${{ !always()}}
|
|
||||||
env:
|
env:
|
||||||
|
COLD_CLEAR_FOLDER: ./ColdClear
|
||||||
OUTPUT_FOLDER: ./build
|
OUTPUT_FOLDER: ./build
|
||||||
RELEASE_FOLDER: ./release
|
RELEASE_FOLDER: ./release
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Process app name
|
- name: Process app name
|
||||||
@@ -258,45 +262,45 @@ jobs:
|
|||||||
f.write('bundle-id=org.26f-studio.' + product_name + '\n')
|
f.write('bundle-id=org.26f-studio.' + product_name + '\n')
|
||||||
f.write('product-name=' + product_name + '\n')
|
f.write('product-name=' + product_name + '\n')
|
||||||
- name: Download core love package
|
- name: Download core love package
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
|
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
|
||||||
- name: Add icon to love package
|
- name: Add icon to love package
|
||||||
run: |
|
run: |
|
||||||
cp ./.github/build/linux/${{ env.BUILD_TYPE }}/icon.png media/image/icon.png
|
cp ${{ env.BUILD_ASSETS_FOLDER }}/linux/${{ env.BUILD_TYPE }}/icon.png media/image/icon.png
|
||||||
zip -u ${{ env.CORE_LOVE_PACKAGE_PATH }} media/image/icon.png
|
zip -u ${{ env.CORE_LOVE_PACKAGE_PATH }} media/image/icon.png
|
||||||
rm media/image/icon.png
|
rm media/image/icon.png
|
||||||
- name: Download ColdClear
|
- name: Download ColdClear
|
||||||
uses: ./.github/actions/get-cc
|
uses: ./.github/actions/get-unzip
|
||||||
with:
|
with:
|
||||||
platform: Linux
|
url: ${{ env.COLD_CLEAR_DOWNLOAD_URL }}/Linux.zip
|
||||||
dir: ./ColdClear
|
dir: ${{ env.COLD_CLEAR_FOLDER }}
|
||||||
- name: Process ColdClear
|
- name: Process ColdClear
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cd ./ColdClear
|
cd ${{ env.COLD_CLEAR_FOLDER }}
|
||||||
mkdir -p ./lib/lua/5.1
|
mkdir -p ./lib/lua/5.1
|
||||||
mv ./x64/CCloader.so ./lib/lua/5.1
|
mv ./x64/CCloader.so ./lib/lua/5.1
|
||||||
- name: Build Linux packages
|
- name: Build Linux packages
|
||||||
id: build-packages
|
id: build-packages
|
||||||
uses: love-actions/love-actions-linux@v1
|
uses: love-actions/love-actions-linux@v2
|
||||||
with:
|
with:
|
||||||
app-name: ${{ needs.get-info.outputs.app-name }}
|
app-name: ${{ needs.get-info.outputs.app-name }}
|
||||||
bundle-id: ${{ steps.process-app-name.outputs.bundle-id }}
|
bundle-id: ${{ steps.process-app-name.outputs.bundle-id }}
|
||||||
description: Techmino is fun!
|
description: Techmino is fun!
|
||||||
version-string: ${{ needs.get-info.outputs.version-string }}
|
version-string: ${{ needs.get-info.outputs.version-string }}
|
||||||
icon-path: ./.github/build/linux/${{ env.BUILD_TYPE }}/icon.png
|
icon-path: ${{ env.BUILD_ASSETS_FOLDER }}/linux/${{ env.BUILD_TYPE }}/icon.png
|
||||||
love-package: ${{ env.CORE_LOVE_PACKAGE_PATH }}
|
love-package: ${{ env.CORE_LOVE_PACKAGE_PATH }}
|
||||||
lib-path: ./ColdClear/lib
|
lib-path: ${{ env.COLD_CLEAR_FOLDER }}/lib
|
||||||
product-name: ${{ steps.process-app-name.outputs.product-name }}
|
product-name: ${{ steps.process-app-name.outputs.product-name }}
|
||||||
output-folder: ${{ env.OUTPUT_FOLDER }}
|
output-folder: ${{ env.OUTPUT_FOLDER }}
|
||||||
- name: Upload AppImage artifact
|
- name: Upload AppImage artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ needs.get-info.outputs.base-name }}_Linux_AppImage
|
name: ${{ needs.get-info.outputs.base-name }}_Linux_AppImage
|
||||||
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.AppImage
|
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.AppImage
|
||||||
- name: Upload Debian artifact
|
- name: Upload Debian artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ needs.get-info.outputs.base-name }}_Linux_Debian
|
name: ${{ needs.get-info.outputs.base-name }}_Linux_Debian
|
||||||
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.deb
|
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.deb
|
||||||
@@ -319,122 +323,18 @@ jobs:
|
|||||||
name: ${{ needs.get-info.outputs.update-title }}
|
name: ${{ needs.get-info.outputs.update-title }}
|
||||||
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }}
|
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }}
|
||||||
|
|
||||||
build-macos-portable:
|
build-web-compat:
|
||||||
runs-on: macos-latest
|
|
||||||
needs: [get-info, build-core, auto-test]
|
|
||||||
# if: github.event_name != 'pull_request'
|
|
||||||
if: ${{ !always()}}
|
|
||||||
env:
|
|
||||||
OUTPUT_FOLDER: ./build
|
|
||||||
RELEASE_FOLDER: ./release
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
- name: Process app name
|
|
||||||
id: process-app-name
|
|
||||||
shell: python3 {0}
|
|
||||||
run: |
|
|
||||||
import os
|
|
||||||
import re
|
|
||||||
with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
|
|
||||||
f.write('bundle-id=org.26f-studio.techmino\n')
|
|
||||||
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
|
|
||||||
- name: Download core love package
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
|
|
||||||
- name: Download ColdClear
|
|
||||||
uses: ./.github/actions/get-cc
|
|
||||||
with:
|
|
||||||
platform: macOS
|
|
||||||
dir: ./ColdClear
|
|
||||||
- name: Process ColdClear
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
rm ./ColdClear/universal/libcold_clear.a
|
|
||||||
- name: Use Xcode 15.3
|
|
||||||
# Xcode 15.4 segfaults
|
|
||||||
# see https://forums.developer.apple.com/forums/thread/757398
|
|
||||||
uses: mobiledevops/xcode-select-version-action@v1
|
|
||||||
with:
|
|
||||||
xcode-select-version: 15.3
|
|
||||||
- name: Build macOS packages
|
|
||||||
id: build-packages
|
|
||||||
uses: love-actions/love-actions-macos-portable@v1
|
|
||||||
with:
|
|
||||||
app-name: ${{ needs.get-info.outputs.app-name }}
|
|
||||||
bundle-id: ${{ steps.process-app-name.outputs.bundle-id }}
|
|
||||||
copyright: "Copyright © 2019-2023 26F-Studio. Some Rights Reserved."
|
|
||||||
icon-path: ./.github/build/macOS/${{ env.BUILD_TYPE }}/icon.icns
|
|
||||||
love-ref: "11.5"
|
|
||||||
love-package: ${{ env.CORE_LOVE_PACKAGE_PATH }}
|
|
||||||
libs-path: ./ColdClear/universal/
|
|
||||||
product-name: ${{ steps.process-app-name.outputs.product-name }}
|
|
||||||
version-string: ${{ needs.get-info.outputs.version-string }}
|
|
||||||
output-folder: ${{ env.OUTPUT_FOLDER }}
|
|
||||||
account-username: ${{ secrets.APPLE_ACCOUNT_USERNAME }}
|
|
||||||
account-password: ${{ secrets.APPLE_ACCOUNT_PASSWORD }}
|
|
||||||
team-id: "${{ secrets.APPLE_DEVELOPER_TEAM_ID }}"
|
|
||||||
developer-id-application-base64: ${{ secrets.APPLE_CERT_DEVELOPER_ID_APPLICATION }}
|
|
||||||
developer-id-application-password: ${{ secrets.APPLE_CERT_DEVELOPER_ID_APPLICATION_PWD }}
|
|
||||||
developer-id-installer-base64: ${{ secrets.APPLE_CERT_DEVELOPER_ID_INSTALLER }}
|
|
||||||
developer-id-installer-password: ${{ secrets.APPLE_CERT_DEVELOPER_ID_INSTALLER_PWD }}
|
|
||||||
dmg-background-path: ./.github/build/macOS/${{ env.BUILD_TYPE }}/dmg.png
|
|
||||||
dmg-icon-position: "239 203"
|
|
||||||
dmg-icon-size: "100"
|
|
||||||
dmg-link-position: "565 203"
|
|
||||||
dmg-text-size: "12"
|
|
||||||
dmg-volume-icon-path: ./.github/build/macOS/${{ env.BUILD_TYPE }}/dmg.icns
|
|
||||||
dmg-volume-name: ${{ steps.process-app-name.outputs.product-name }}
|
|
||||||
dmg-window-position: "200 120"
|
|
||||||
dmg-window-size: "800 500"
|
|
||||||
- name: Upload pkg artifact
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: ${{ needs.get-info.outputs.base-name }}_macOS_portable_pkg
|
|
||||||
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.pkg
|
|
||||||
- name: Upload dmg artifact
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: ${{ needs.get-info.outputs.base-name }}_macOS_portable_dmg
|
|
||||||
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.dmg
|
|
||||||
- name: Upload bare artifact
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: ${{ needs.get-info.outputs.base-name }}_macOS_portable_bare
|
|
||||||
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.zip
|
|
||||||
- name: Prepare for release
|
|
||||||
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
mkdir -p ${{ env.RELEASE_FOLDER }}
|
|
||||||
cp ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.pkg ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_macOS_portable.pkg
|
|
||||||
cp ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}.dmg ${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_macOS_portable.dmg
|
|
||||||
- name: Upload release
|
|
||||||
if: ${{ startsWith(github.ref, 'refs/tags/pre') || startsWith(github.ref, 'refs/tags/v') }}
|
|
||||||
uses: ncipollo/release-action@v1
|
|
||||||
with:
|
|
||||||
allowUpdates: true
|
|
||||||
artifacts: |
|
|
||||||
${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_macOS_portable.pkg
|
|
||||||
${{ env.RELEASE_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_macOS_portable.dmg
|
|
||||||
body: ${{ needs.get-info.outputs.update-note }}
|
|
||||||
name: ${{ needs.get-info.outputs.update-title }}
|
|
||||||
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre') }}
|
|
||||||
|
|
||||||
build-web:
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [get-info, build-core, auto-test]
|
needs: [get-info, build-core, auto-test]
|
||||||
env:
|
env:
|
||||||
MEMORY_LIMIT: 128000000
|
MEMORY_LIMIT: 128000000
|
||||||
OUTPUT_FOLDER: ./build
|
OUTPUT_FOLDER: ./build
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Download core love package
|
- name: Download core love package
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
|
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
|
||||||
- name: Build web packages
|
- name: Build web packages
|
||||||
@@ -442,7 +342,7 @@ jobs:
|
|||||||
npx love.js ${{ env.CORE_LOVE_PACKAGE_PATH }} ${{ env.OUTPUT_FOLDER }} -t "${{ needs.get-info.outputs.app-name }}" -m ${{ env.MEMORY_LIMIT }} -c
|
npx love.js ${{ env.CORE_LOVE_PACKAGE_PATH }} ${{ env.OUTPUT_FOLDER }} -t "${{ needs.get-info.outputs.app-name }}" -m ${{ env.MEMORY_LIMIT }} -c
|
||||||
- name: Move assets
|
- name: Move assets
|
||||||
run: |
|
run: |
|
||||||
mv ./.github/build/web/${{ env.BUILD_TYPE }}/* ${{ env.OUTPUT_FOLDER }}
|
mv ${{ env.BUILD_ASSETS_FOLDER }}/web/${{ env.BUILD_TYPE }}/* ${{ env.OUTPUT_FOLDER }}
|
||||||
- name: Initialize Love.js Api Player
|
- name: Initialize Love.js Api Player
|
||||||
run: |
|
run: |
|
||||||
pushd ${{ env.OUTPUT_FOLDER }}
|
pushd ${{ env.OUTPUT_FOLDER }}
|
||||||
@@ -453,7 +353,7 @@ jobs:
|
|||||||
rm globalizeFS.js
|
rm globalizeFS.js
|
||||||
popd
|
popd
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ needs.get-info.outputs.base-name }}_Web
|
name: ${{ needs.get-info.outputs.base-name }}_Web
|
||||||
path: ${{ env.OUTPUT_FOLDER }}
|
path: ${{ env.OUTPUT_FOLDER }}
|
||||||
@@ -468,13 +368,13 @@ jobs:
|
|||||||
|
|
||||||
build-windows:
|
build-windows:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
if: ${{ !always()}}
|
|
||||||
needs: [get-info, build-core, auto-test]
|
needs: [get-info, build-core, auto-test]
|
||||||
env:
|
env:
|
||||||
|
COLD_CLEAR_FOLDER: ./ColdClear
|
||||||
OUTPUT_FOLDER: ./build
|
OUTPUT_FOLDER: ./build
|
||||||
RELEASE_FOLDER: ./release
|
RELEASE_FOLDER: ./release
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Process app name
|
- name: Process app name
|
||||||
@@ -486,20 +386,20 @@ jobs:
|
|||||||
with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
|
with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
|
||||||
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
|
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
|
||||||
- name: Download core love package
|
- name: Download core love package
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
|
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
|
||||||
- name: Download ColdClear
|
- name: Download ColdClear
|
||||||
uses: ./.github/actions/get-cc
|
uses: ./.github/actions/get-unzip
|
||||||
with:
|
with:
|
||||||
platform: Windows
|
url: ${{ env.COLD_CLEAR_DOWNLOAD_URL }}/Windows.zip
|
||||||
dir: ./ColdClear
|
dir: ${{ env.COLD_CLEAR_FOLDER }}
|
||||||
- name: Update Windows template
|
- name: Update Windows template
|
||||||
shell: python3 {0}
|
shell: python3 {0}
|
||||||
run: |
|
run: |
|
||||||
version_string = "${{ needs.get-info.outputs.version-string }}"
|
version_string = "${{ needs.get-info.outputs.version-string }}"
|
||||||
file_version = (f"{version_string.replace('.', ',')},0")
|
file_version = (f"{version_string.replace('.', ',')},0")
|
||||||
with open("./.github/build/windows/${{ env.BUILD_TYPE }}/template.rc", "r+", encoding="utf8") as file:
|
with open("${{ env.BUILD_ASSETS_FOLDER }}/windows/${{ env.BUILD_TYPE }}/template.rc", "r+", encoding="utf8") as file:
|
||||||
data = file.read()
|
data = file.read()
|
||||||
data = data\
|
data = data\
|
||||||
.replace("@Version", version_string)\
|
.replace("@Version", version_string)\
|
||||||
@@ -509,30 +409,30 @@ jobs:
|
|||||||
file.write(data)
|
file.write(data)
|
||||||
- name: Build Windows packages
|
- name: Build Windows packages
|
||||||
id: build-packages
|
id: build-packages
|
||||||
uses: love-actions/love-actions-windows@v1
|
uses: love-actions/love-actions-windows@v2
|
||||||
with:
|
with:
|
||||||
icon-path: ./.github/build/windows/${{ env.BUILD_TYPE }}/icon.ico
|
icon-path: ${{ env.BUILD_ASSETS_FOLDER }}/windows/${{ env.BUILD_TYPE }}/icon.ico
|
||||||
rc-path: ./.github/build/windows/${{ env.BUILD_TYPE }}/template.rc
|
rc-path: ${{ env.BUILD_ASSETS_FOLDER }}/windows/${{ env.BUILD_TYPE }}/template.rc
|
||||||
love-package: ${{ env.CORE_LOVE_PACKAGE_PATH }}
|
love-package: ${{ env.CORE_LOVE_PACKAGE_PATH }}
|
||||||
extra-assets-x86: ./ColdClear/x86/CCloader.dll ./ColdClear/x86/cold_clear.dll ./.github/build/extraLibs/Windows_x64/discord-rpc.dll
|
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
|
||||||
extra-assets-x64: ./ColdClear/x64/CCloader.dll ./ColdClear/x64/cold_clear.dll ./.github/build/extraLibs/Windows_x86/discord-rpc.dll
|
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
|
||||||
product-name: ${{ steps.process-app-name.outputs.product-name }}
|
product-name: ${{ steps.process-app-name.outputs.product-name }}
|
||||||
app-id: ${{ secrets.WINDOWS_APP_ID }}
|
app-id: ${{ secrets.WINDOWS_APP_ID }}
|
||||||
project-website: https://www.studio26f.org/
|
project-website: https://www.studio26f.org/
|
||||||
installer-languages: ChineseSimplified.isl ChineseTraditional.isl English.isl Spanish.isl French.isl Indonesian.isl Japanese.isl Portuguese.isl
|
installer-languages: ChineseSimplified.isl ChineseTraditional.isl English.isl Spanish.isl French.isl Indonesian.isl Japanese.isl Portuguese.isl
|
||||||
output-folder: ${{ env.OUTPUT_FOLDER }}
|
output-folder: ${{ env.OUTPUT_FOLDER }}
|
||||||
- name: Upload 32-bit artifact
|
- name: Upload 32-bit artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ needs.get-info.outputs.base-name }}_Windows_x86
|
name: ${{ needs.get-info.outputs.base-name }}_Windows_x86
|
||||||
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_x86.zip
|
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_x86.zip
|
||||||
- name: Upload 64-bit artifact
|
- name: Upload 64-bit artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ needs.get-info.outputs.base-name }}_Windows_x64
|
name: ${{ needs.get-info.outputs.base-name }}_Windows_x64
|
||||||
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_x64.zip
|
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_x64.zip
|
||||||
- name: Upload installer artifact
|
- name: Upload installer artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ needs.get-info.outputs.base-name }}_Windows_installer
|
name: ${{ needs.get-info.outputs.base-name }}_Windows_installer
|
||||||
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_installer.exe
|
path: ${{ env.OUTPUT_FOLDER }}/${{ steps.process-app-name.outputs.product-name }}_installer.exe
|
||||||
@@ -567,24 +467,30 @@ jobs:
|
|||||||
build-core,
|
build-core,
|
||||||
build-android,
|
build-android,
|
||||||
build-linux,
|
build-linux,
|
||||||
build-macos-portable,
|
build-web-compat,
|
||||||
build-web,
|
|
||||||
build-windows,
|
build-windows,
|
||||||
]
|
]
|
||||||
env:
|
env:
|
||||||
ACTION_TYPE: ${{ fromJSON('[["Development", "Pre-release"], ["Release", "Release"]]')[startsWith(github.ref, 'refs/tags/v')][startsWith(github.ref, 'refs/tags/pre')] }}
|
ACTION_TYPE: ${{ fromJSON('[["Development", "Pre-release"], ["Release", "Release"]]')[startsWith(github.ref, 'refs/tags/v')][startsWith(github.ref, 'refs/tags/pre')] }}
|
||||||
steps:
|
steps:
|
||||||
- name: Cleanup
|
- name: Cleanup
|
||||||
uses: geekyeggo/delete-artifact@v2
|
uses: geekyeggo/delete-artifact@v5
|
||||||
with:
|
with:
|
||||||
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
|
name: ${{ env.CORE_LOVE_ARTIFACT_NAME }}
|
||||||
- name: Send Discord message
|
- name: Send Discord message
|
||||||
if: github.event_name != 'pull_request'
|
if: github.ref == 'refs/heads/main'
|
||||||
uses: Sniddl/discord-commits@v1.6
|
shell: python
|
||||||
with:
|
run: |
|
||||||
webhook: ${{ secrets.DISCORD_WEBHOOK }}
|
import requests
|
||||||
message: "Github Actions for **${{ github.repository }}**."
|
import json
|
||||||
embed: '{
|
|
||||||
|
headers = {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
}
|
||||||
|
payload = json.dumps({
|
||||||
|
"content": "Github Actions for **${{ github.repository }}**.",
|
||||||
|
"embeds": [
|
||||||
|
{
|
||||||
"author": {
|
"author": {
|
||||||
"name": "${{ needs.get-info.outputs.app-name }} [${{ env.ACTION_TYPE }}]",
|
"name": "${{ needs.get-info.outputs.app-name }} [${{ env.ACTION_TYPE }}]",
|
||||||
"url": "https://github.com/${{ github.repository }}"
|
"url": "https://github.com/${{ github.repository }}"
|
||||||
@@ -597,8 +503,22 @@ jobs:
|
|||||||
},
|
},
|
||||||
"color": 36863,
|
"color": 36863,
|
||||||
"fields": [
|
"fields": [
|
||||||
{"name":"Version","value":"${{ needs.get-info.outputs.version-string }}","inline": true},
|
{
|
||||||
{"name":"Package Name","value":"${{ needs.get-info.outputs.base-name }}","inline": true},
|
"name": "Version",
|
||||||
{"name":"Status","value":"**Automatic Test:** ${{ needs.auto-test.result }}\n**Core:** ${{ needs.build-core.result }}\n**Android:** ${{ needs.build-android.result }}\n**Linux:** ${{ needs.build-linux.result }}\n**macOS portable:** ${{ needs.build-macos-portable.result }}\n**Windows:** ${{ needs.build-windows.result }}"}
|
"value": "${{ needs.get-info.outputs.version-string }}",
|
||||||
|
"inline": True
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Package Name",
|
||||||
|
"value": "${{ needs.get-info.outputs.base-name }}",
|
||||||
|
"inline": True
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Status",
|
||||||
|
"value": "**Automatic Test:** ${{ needs.auto-test.result }}\n**Core:** ${{ needs.build-core.result }}\n**Android:** ${{ needs.build-android.result }}\n**Linux:** ${{ needs.build-linux.result }}\n**Web compatible:** ${{ needs.build-web-compat.result }}\n**Windows:** ${{ needs.build-windows.result }}"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}'
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
requests.request("POST", "${{ secrets.DISCORD_WEBHOOK }}", headers=headers, data=payload)
|
||||||
|
|||||||
2
conf.lua
2
conf.lua
@@ -29,7 +29,7 @@ function love.conf(t)
|
|||||||
end
|
end
|
||||||
|
|
||||||
t.identity=identity -- Saving folder
|
t.identity=identity -- Saving folder
|
||||||
t.version="11.4"
|
t.version="11.5"
|
||||||
t.gammacorrect=false
|
t.gammacorrect=false
|
||||||
t.appendidentity=true -- Search files in source then in save directory
|
t.appendidentity=true -- Search files in source then in save directory
|
||||||
t.accelerometerjoystick=false -- Accelerometer=joystick on ios/android
|
t.accelerometerjoystick=false -- Accelerometer=joystick on ios/android
|
||||||
|
|||||||
Reference in New Issue
Block a user