Merge pull request #156 from Trebor-Huang/main

add CI for macOS
This commit is contained in:
flaribbit
2021-08-01 11:35:00 +08:00
committed by GitHub
2 changed files with 89 additions and 0 deletions

View File

@@ -86,3 +86,26 @@ jobs:
with:
name: Android
path: ${{steps.sign_app.outputs.signedReleaseFile}}
build-macOS:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
- name: Pack love
run : zip -r Techmino.love document media parts Zframework conf.lua font.ttf main.lua
- name: Download template
run: |
curl -OL https://github.com/26F-Studio/Techmino/releases/download/v0.15.1/Techmino.app.zip
unzip Techmino.app.zip
- name: Modify template
run: |
python3 .github/workflows/updateOSXVersion.py
mv Techmino.love Techmino.app/Contents/Resources
- name: Pack Techmino
run: |
zip -r -y Techmino-Packed.app.zip Techmino.app
- name: Artifact
uses: actions/upload-artifact@v1.0.0
with:
name: macOS
path: Techmino-Packed.app.zip

66
.github/workflows/updateOSXVersion.py vendored Normal file
View File

@@ -0,0 +1,66 @@
import re, datetime
info = r"""<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>19B88</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>love</string>
<key>CFBundleIconFile</key>
<string>iconfile</string>
<key>CFBundleIdentifier</key>
<string>org.love2d.MrZ.Techmino</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Techmino</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>%s</string>
<key>CFBundleSignature</key>
<string>LoVe</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>11C504</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>19B90</string>
<key>DTSDKName</key>
<string>macosx10.15</string>
<key>DTXcode</key>
<string>1130</string>
<key>DTXcodeBuild</key>
<string>11C504</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.games</string>
<key>LSMinimumSystemVersion</key>
<string>10.7</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>©2020-%d 26F Studio, GNU LGPLv3.0</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<false/>
</dict>
</plist>
"""
with open("conf.lua", "r") as file:
data = file.read()
versionCode = re.search("build=(\\d+)", data).group(1)
# versionName = re.search('short="([^"]+)', data).group(1)
print(versionCode)
with open("Techmino.app/Contents/info.plist", "w") as file:
file.write(info % (versionCode, datetime.datetime.today().year))