From 25f87cae53bbe3f1ec7ed4aad356b55e5bb810e1 Mon Sep 17 00:00:00 2001 From: Trebor Huang <2300936257@qq.com> Date: Sun, 1 Aug 2021 02:49:28 +0800 Subject: [PATCH] [no ci] CI for OS X MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 依赖于一个还没上传的模板,还没决定这个要放在哪,所以链接留空。 --- .github/workflows/build.yml | 27 +++++++++++ .github/workflows/updateOSXVersion.py | 66 +++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 .github/workflows/updateOSXVersion.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 106a9214..645b720d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -86,3 +86,30 @@ 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 [[template-link]] + 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 diff --git a/.github/workflows/updateOSXVersion.py b/.github/workflows/updateOSXVersion.py new file mode 100644 index 00000000..bcab5e94 --- /dev/null +++ b/.github/workflows/updateOSXVersion.py @@ -0,0 +1,66 @@ +import re, datetime +info = r""" + + + + BuildMachineOSBuild + 19B88 + CFBundleDevelopmentRegion + English + CFBundleExecutable + love + CFBundleIconFile + iconfile + CFBundleIdentifier + org.love2d.MrZ.Techmino + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Techmino + CFBundlePackageType + APPL + CFBundleShortVersionString + %s + CFBundleSignature + LoVe + CFBundleSupportedPlatforms + + MacOSX + + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 11C504 + DTPlatformVersion + GM + DTSDKBuild + 19B90 + DTSDKName + macosx10.15 + DTXcode + 1130 + DTXcodeBuild + 11C504 + LSApplicationCategoryType + public.app-category.games + LSMinimumSystemVersion + 10.7 + NSHighResolutionCapable + + NSHumanReadableCopyright + ©2020-%d 26F Studio, GNU LGPLv3.0 + NSPrincipalClass + NSApplication + NSSupportsAutomaticGraphicsSwitching + + + +""" + +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))