mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-15 17:30:27 +08:00
ci: 临时禁用 macos build
This commit is contained in:
366
.github/workflows/ci.yml
vendored
366
.github/workflows/ci.yml
vendored
@@ -333,219 +333,219 @@ jobs:
|
||||
release/*.AppImage
|
||||
release/*.tar.gz
|
||||
|
||||
macOS-Core:
|
||||
name: Build Core for macOS
|
||||
needs: meta
|
||||
runs-on: macos-26
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [arm64, x86_64]
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
show-progress: false
|
||||
# macOS-Core:
|
||||
# name: Build Core for macOS
|
||||
# needs: meta
|
||||
# runs-on: macos-26
|
||||
# strategy:
|
||||
# matrix:
|
||||
# arch: [arm64, x86_64]
|
||||
# fail-fast: false
|
||||
# steps:
|
||||
# - name: Checkout repository
|
||||
# uses: actions/checkout@v6
|
||||
# with:
|
||||
# show-progress: false
|
||||
|
||||
- name: Fetch submodules
|
||||
run: |
|
||||
git submodule update --init --depth 1 src/MaaUtils
|
||||
# - name: Fetch submodules
|
||||
# run: |
|
||||
# git submodule update --init --depth 1 src/MaaUtils
|
||||
|
||||
# ninja 1.13.1 is already installed and up-to-date.
|
||||
# - name: Install dependencies
|
||||
# run: |
|
||||
# brew install ninja
|
||||
# # ninja 1.13.1 is already installed and up-to-date.
|
||||
# # - name: Install dependencies
|
||||
# # run: |
|
||||
# # brew install ninja
|
||||
|
||||
- name: Cache MaaDeps
|
||||
id: cache-maadeps
|
||||
uses: actions/cache@v5
|
||||
continue-on-error: true
|
||||
with:
|
||||
path: ./src/MaaUtils/MaaDeps
|
||||
key: ${{ runner.os }}-${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-maadeps-${{ hashFiles('tools/maadeps-download.py') }}
|
||||
# - name: Cache MaaDeps
|
||||
# id: cache-maadeps
|
||||
# uses: actions/cache@v5
|
||||
# continue-on-error: true
|
||||
# with:
|
||||
# path: ./src/MaaUtils/MaaDeps
|
||||
# key: ${{ runner.os }}-${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-maadeps-${{ hashFiles('tools/maadeps-download.py') }}
|
||||
|
||||
- name: Bootstrap MaaDeps
|
||||
run: |
|
||||
python3 tools/maadeps-download.py ${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-osx
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# - name: Bootstrap MaaDeps
|
||||
# run: |
|
||||
# python3 tools/maadeps-download.py ${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-osx
|
||||
# env:
|
||||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Configure, build and install
|
||||
run: |
|
||||
cmake -B build --preset ${{ matrix.arch == 'x86_64' && 'macos-publish-x64' || 'macos-publish-arm64' }} -DMAA_HASH_VERSION='${{ needs.meta.outputs.tag }}'
|
||||
cmake --build --preset ${{ matrix.arch == 'x86_64' && 'macos-publish-x64' || 'macos-publish-arm64' }} --parallel $(sysctl -n hw.logicalcpu)
|
||||
cmake --install build --config RelWithDebInfo
|
||||
# - name: Configure, build and install
|
||||
# run: |
|
||||
# cmake -B build --preset ${{ matrix.arch == 'x86_64' && 'macos-publish-x64' || 'macos-publish-arm64' }} -DMAA_HASH_VERSION='${{ needs.meta.outputs.tag }}'
|
||||
# cmake --build --preset ${{ matrix.arch == 'x86_64' && 'macos-publish-x64' || 'macos-publish-arm64' }} --parallel $(sysctl -n hw.logicalcpu)
|
||||
# cmake --install build --config RelWithDebInfo
|
||||
|
||||
- name: Upload MAA to GitHub
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: MAACore-macos-${{ matrix.arch }}
|
||||
path: "install/*.dylib"
|
||||
# - name: Upload MAA to GitHub
|
||||
# uses: actions/upload-artifact@v7
|
||||
# with:
|
||||
# name: MAACore-macos-${{ matrix.arch }}
|
||||
# path: "install/*.dylib"
|
||||
|
||||
macOS-GUI:
|
||||
name: Build GUI for macOS
|
||||
needs: [meta, macOS-Core]
|
||||
runs-on: macos-26
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
show-progress: false
|
||||
# macOS-GUI:
|
||||
# name: Build GUI for macOS
|
||||
# needs: [meta, macOS-Core]
|
||||
# runs-on: macos-26
|
||||
# steps:
|
||||
# - name: Checkout repository
|
||||
# uses: actions/checkout@v6
|
||||
# with:
|
||||
# show-progress: false
|
||||
|
||||
- name: Install dependencies
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
run: |
|
||||
brew install graphicsmagick imagemagick
|
||||
npm install -g create-dmg
|
||||
# - name: Install dependencies
|
||||
# if: startsWith(github.ref, 'refs/tags/v')
|
||||
# run: |
|
||||
# brew install graphicsmagick imagemagick
|
||||
# npm install -g create-dmg
|
||||
|
||||
- name: Fetch submodules
|
||||
run: |
|
||||
git submodule update --init --depth 1 src/MaaMacGui
|
||||
# - name: Fetch submodules
|
||||
# run: |
|
||||
# git submodule update --init --depth 1 src/MaaMacGui
|
||||
|
||||
- name: Download MAA (arm64) from GitHub
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: MAACore-macos-arm64
|
||||
path: install-arm64
|
||||
# - name: Download MAA (arm64) from GitHub
|
||||
# uses: actions/download-artifact@v8
|
||||
# with:
|
||||
# name: MAACore-macos-arm64
|
||||
# path: install-arm64
|
||||
|
||||
- name: Download MAA (x64) from GitHub
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: MAACore-macos-x86_64
|
||||
path: install-x86_64
|
||||
# - name: Download MAA (x64) from GitHub
|
||||
# uses: actions/download-artifact@v8
|
||||
# with:
|
||||
# name: MAACore-macos-x86_64
|
||||
# path: install-x86_64
|
||||
|
||||
- name: Install Developer ID certificate
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: apple-actions/import-codesign-certs@v6
|
||||
with:
|
||||
p12-file-base64: ${{ secrets.HGUANDL_SIGN_CERT_P12 }}
|
||||
p12-password: ${{ secrets.HGUANDL_SIGN_CERT_PASSWD }}
|
||||
# - name: Install Developer ID certificate
|
||||
# if: startsWith(github.ref, 'refs/tags/v')
|
||||
# uses: apple-actions/import-codesign-certs@v6
|
||||
# with:
|
||||
# p12-file-base64: ${{ secrets.HGUANDL_SIGN_CERT_P12 }}
|
||||
# p12-password: ${{ secrets.HGUANDL_SIGN_CERT_PASSWD }}
|
||||
|
||||
- name: Download provisioning profiles
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: apple-actions/download-provisioning-profiles@v5
|
||||
with:
|
||||
bundle-id: "com.hguandl.MeoAsstMac"
|
||||
issuer-id: ${{ secrets.HGUANDL_APPSTORE_ISSUER }}
|
||||
api-key-id: ${{ secrets.HGUANDL_APPSTORE_KEYID }}
|
||||
api-private-key: ${{ secrets.HGUANDL_APPSTORE_KEY }}
|
||||
# - name: Download provisioning profiles
|
||||
# if: startsWith(github.ref, 'refs/tags/v')
|
||||
# uses: apple-actions/download-provisioning-profiles@v5
|
||||
# with:
|
||||
# bundle-id: "com.hguandl.MeoAsstMac"
|
||||
# issuer-id: ${{ secrets.HGUANDL_APPSTORE_ISSUER }}
|
||||
# api-key-id: ${{ secrets.HGUANDL_APPSTORE_KEYID }}
|
||||
# api-private-key: ${{ secrets.HGUANDL_APPSTORE_KEY }}
|
||||
|
||||
- name: Setup Xcode toolchain
|
||||
if: false
|
||||
run: |
|
||||
sudo xcode-select -s /Applications/Xcode_16.1.app/Contents/Developer
|
||||
# - name: Setup Xcode toolchain
|
||||
# if: false
|
||||
# run: |
|
||||
# sudo xcode-select -s /Applications/Xcode_16.1.app/Contents/Developer
|
||||
|
||||
- name: Build universal binaries
|
||||
run: |
|
||||
mkdir build
|
||||
for LIB_NAME in $(ls install-arm64); do
|
||||
lipo -create install-arm64/$LIB_NAME install-x86_64/$LIB_NAME -output build/$LIB_NAME
|
||||
done
|
||||
# - name: Build universal binaries
|
||||
# run: |
|
||||
# mkdir build
|
||||
# for LIB_NAME in $(ls install-arm64); do
|
||||
# lipo -create install-arm64/$LIB_NAME install-x86_64/$LIB_NAME -output build/$LIB_NAME
|
||||
# done
|
||||
|
||||
- name: Archive runtime files
|
||||
run: |
|
||||
mkdir runtime && cd runtime
|
||||
name='MAA-${{ needs.meta.outputs.tag }}-macos-runtime-universal'
|
||||
mkdir "$name" && cd "$name"
|
||||
cp -v ../../build/*.dylib .
|
||||
ln -vs libonnxruntime*.dylib libonnxruntime.dylib
|
||||
ln -vs libopencv_world4*.dylib libopencv_world4.dylib
|
||||
cp -vr ../../resource .
|
||||
cd .. || exit 1
|
||||
zip -yrX9 "$name.zip" "$name"
|
||||
# - name: Archive runtime files
|
||||
# run: |
|
||||
# mkdir runtime && cd runtime
|
||||
# name='MAA-${{ needs.meta.outputs.tag }}-macos-runtime-universal'
|
||||
# mkdir "$name" && cd "$name"
|
||||
# cp -v ../../build/*.dylib .
|
||||
# ln -vs libonnxruntime*.dylib libonnxruntime.dylib
|
||||
# ln -vs libopencv_world4*.dylib libopencv_world4.dylib
|
||||
# cp -vr ../../resource .
|
||||
# cd .. || exit 1
|
||||
# zip -yrX9 "$name.zip" "$name"
|
||||
|
||||
- name: Upload MAA runtime to GitHub
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: MAA-macos-runtime-universal
|
||||
path: runtime/MAA-${{ needs.meta.outputs.tag }}-macos-runtime-universal.zip
|
||||
# - name: Upload MAA runtime to GitHub
|
||||
# uses: actions/upload-artifact@v7
|
||||
# with:
|
||||
# name: MAA-macos-runtime-universal
|
||||
# path: runtime/MAA-${{ needs.meta.outputs.tag }}-macos-runtime-universal.zip
|
||||
|
||||
- name: Build XCFramework
|
||||
run: |
|
||||
xcodebuild -create-xcframework -library libMaaCore.dylib -headers ../include -output MaaCore.xcframework
|
||||
xcodebuild -create-xcframework -library libMaaUtils.dylib -output MaaUtils.xcframework
|
||||
xcodebuild -create-xcframework -library libfastdeploy_ppocr.dylib -output fastdeploy_ppocr.xcframework
|
||||
xcodebuild -create-xcframework -library libonnxruntime.*.dylib -output ONNXRuntime.xcframework
|
||||
xcodebuild -create-xcframework -library libopencv*.dylib -output OpenCV.xcframework
|
||||
working-directory: build
|
||||
# - name: Build XCFramework
|
||||
# run: |
|
||||
# xcodebuild -create-xcframework -library libMaaCore.dylib -headers ../include -output MaaCore.xcframework
|
||||
# xcodebuild -create-xcframework -library libMaaUtils.dylib -output MaaUtils.xcframework
|
||||
# xcodebuild -create-xcframework -library libfastdeploy_ppocr.dylib -output fastdeploy_ppocr.xcframework
|
||||
# xcodebuild -create-xcframework -library libonnxruntime.*.dylib -output ONNXRuntime.xcframework
|
||||
# xcodebuild -create-xcframework -library libopencv*.dylib -output OpenCV.xcframework
|
||||
# working-directory: build
|
||||
|
||||
- name: Setup GUI version
|
||||
run: |
|
||||
RELEASE_COUNT=$(git ls-remote --tags origin | grep refs/tags/v | awk 'END{print NR}')
|
||||
echo 'MARKETING_VERSION = ${{ needs.meta.outputs.tag }}' | tee src/MaaMacGui/Version.xcconfig
|
||||
echo 'CURRENT_PROJECT_VERSION = '"${RELEASE_COUNT}" | tee -a src/MaaMacGui/Version.xcconfig
|
||||
# - name: Setup GUI version
|
||||
# run: |
|
||||
# RELEASE_COUNT=$(git ls-remote --tags origin | grep refs/tags/v | awk 'END{print NR}')
|
||||
# echo 'MARKETING_VERSION = ${{ needs.meta.outputs.tag }}' | tee src/MaaMacGui/Version.xcconfig
|
||||
# echo 'CURRENT_PROJECT_VERSION = '"${RELEASE_COUNT}" | tee -a src/MaaMacGui/Version.xcconfig
|
||||
|
||||
- name: Build MAA
|
||||
run: |
|
||||
if ${{ startsWith(github.ref, 'refs/tags/v') }}; then
|
||||
xcodebuild -scheme MAA archive -archivePath MAA.xcarchive
|
||||
else
|
||||
xcodebuild CODE_SIGNING_ALLOWED=NO -scheme MAA archive -archivePath MAA.xcarchive
|
||||
fi
|
||||
working-directory: src/MaaMacGui
|
||||
# - name: Build MAA
|
||||
# run: |
|
||||
# if ${{ startsWith(github.ref, 'refs/tags/v') }}; then
|
||||
# xcodebuild -scheme MAA archive -archivePath MAA.xcarchive
|
||||
# else
|
||||
# xcodebuild CODE_SIGNING_ALLOWED=NO -scheme MAA archive -archivePath MAA.xcarchive
|
||||
# fi
|
||||
# working-directory: src/MaaMacGui
|
||||
|
||||
- name: Export MAA
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
run: |
|
||||
xcodebuild -exportArchive -archivePath MAA.xcarchive -exportOptionsPlist ExportOptions.plist -exportPath Export
|
||||
working-directory: src/MaaMacGui
|
||||
# - name: Export MAA
|
||||
# if: startsWith(github.ref, 'refs/tags/v')
|
||||
# run: |
|
||||
# xcodebuild -exportArchive -archivePath MAA.xcarchive -exportOptionsPlist ExportOptions.plist -exportPath Export
|
||||
# working-directory: src/MaaMacGui
|
||||
|
||||
- name: Create disk image
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
run: |
|
||||
create-dmg Export/MAA.app
|
||||
mv MAA*.dmg MAA.dmg
|
||||
working-directory: src/MaaMacGui
|
||||
# - name: Create disk image
|
||||
# if: startsWith(github.ref, 'refs/tags/v')
|
||||
# run: |
|
||||
# create-dmg Export/MAA.app
|
||||
# mv MAA*.dmg MAA.dmg
|
||||
# working-directory: src/MaaMacGui
|
||||
|
||||
- name: Archive debug symbols
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
run: |
|
||||
ditto -c -k --keepParent MAA.app.dSYM MAA.app.dSYM.zip
|
||||
working-directory: src/MaaMacGui/MAA.xcarchive/dSYMs
|
||||
# - name: Archive debug symbols
|
||||
# if: startsWith(github.ref, 'refs/tags/v')
|
||||
# run: |
|
||||
# ditto -c -k --keepParent MAA.app.dSYM MAA.app.dSYM.zip
|
||||
# working-directory: src/MaaMacGui/MAA.xcarchive/dSYMs
|
||||
|
||||
- name: Place packages
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
run: |
|
||||
GIT_TAG=${{ needs.meta.outputs.tag }}
|
||||
APP_DMG=MAA-${GIT_TAG}-macos-universal.dmg
|
||||
APP_SYM=MAAComponent-DebugSymbol-${GIT_TAG}-macos-universal.zip
|
||||
mkdir -p release
|
||||
mv src/MaaMacGui/MAA.dmg release/${APP_DMG}
|
||||
mv src/MaaMacGui/MAA.xcarchive/dSYMs/MAA.app.dSYM.zip release/${APP_SYM}
|
||||
# - name: Place packages
|
||||
# if: startsWith(github.ref, 'refs/tags/v')
|
||||
# run: |
|
||||
# GIT_TAG=${{ needs.meta.outputs.tag }}
|
||||
# APP_DMG=MAA-${GIT_TAG}-macos-universal.dmg
|
||||
# APP_SYM=MAAComponent-DebugSymbol-${GIT_TAG}-macos-universal.zip
|
||||
# mkdir -p release
|
||||
# mv src/MaaMacGui/MAA.dmg release/${APP_DMG}
|
||||
# mv src/MaaMacGui/MAA.xcarchive/dSYMs/MAA.app.dSYM.zip release/${APP_SYM}
|
||||
|
||||
- name: Notarize image
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: nick-fields/retry@v4
|
||||
with:
|
||||
max_attempts: 3
|
||||
timeout_minutes: 15
|
||||
command: |
|
||||
cd release
|
||||
echo "$APPSTORE_KEY" > "AuthKey_${APPSTORE_KEYID}.p8"
|
||||
dmg="MAA-${{ needs.meta.outputs.tag }}-macos-universal.dmg"
|
||||
xcrun notarytool submit -k "AuthKey_${APPSTORE_KEYID}.p8" -d "$APPSTORE_KEYID" -i "$ISSUER_ID" --wait ${dmg}
|
||||
env:
|
||||
APPSTORE_KEYID: ${{ secrets.HGUANDL_APPSTORE_KEYID }}
|
||||
APPSTORE_KEY: ${{ secrets.HGUANDL_APPSTORE_KEY }}
|
||||
ISSUER_ID: ${{ secrets.HGUANDL_APPSTORE_ISSUER }}
|
||||
# - name: Notarize image
|
||||
# if: startsWith(github.ref, 'refs/tags/v')
|
||||
# uses: nick-fields/retry@v4
|
||||
# with:
|
||||
# max_attempts: 3
|
||||
# timeout_minutes: 15
|
||||
# command: |
|
||||
# cd release
|
||||
# echo "$APPSTORE_KEY" > "AuthKey_${APPSTORE_KEYID}.p8"
|
||||
# dmg="MAA-${{ needs.meta.outputs.tag }}-macos-universal.dmg"
|
||||
# xcrun notarytool submit -k "AuthKey_${APPSTORE_KEYID}.p8" -d "$APPSTORE_KEYID" -i "$ISSUER_ID" --wait ${dmg}
|
||||
# env:
|
||||
# APPSTORE_KEYID: ${{ secrets.HGUANDL_APPSTORE_KEYID }}
|
||||
# APPSTORE_KEY: ${{ secrets.HGUANDL_APPSTORE_KEY }}
|
||||
# ISSUER_ID: ${{ secrets.HGUANDL_APPSTORE_ISSUER }}
|
||||
|
||||
- name: Attach notarization tickets
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
run: |
|
||||
dmg="MAA-${{ needs.meta.outputs.tag }}-macos-universal.dmg"
|
||||
xcrun stapler staple ${dmg}
|
||||
working-directory: release
|
||||
# - name: Attach notarization tickets
|
||||
# if: startsWith(github.ref, 'refs/tags/v')
|
||||
# run: |
|
||||
# dmg="MAA-${{ needs.meta.outputs.tag }}-macos-universal.dmg"
|
||||
# xcrun stapler staple ${dmg}
|
||||
# working-directory: release
|
||||
|
||||
- name: Upload MAA to GitHub
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: MAA-macos-universal
|
||||
path: ${{ startsWith(github.ref, 'refs/tags/v') && 'release/MAA*' || 'src/MaaMacGui/MAA.xcarchive/**' }}
|
||||
# - name: Upload MAA to GitHub
|
||||
# uses: actions/upload-artifact@v7
|
||||
# with:
|
||||
# name: MAA-macos-universal
|
||||
# path: ${{ startsWith(github.ref, 'refs/tags/v') && 'release/MAA*' || 'src/MaaMacGui/MAA.xcarchive/**' }}
|
||||
|
||||
release:
|
||||
name: Publish Release
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
needs: [meta, windows, ubuntu, macOS-Core, macOS-GUI]
|
||||
needs: [meta, windows, ubuntu] # , macOS-Core, macOS-GUI
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download MAA from GitHub
|
||||
@@ -556,7 +556,7 @@ jobs:
|
||||
- name: Clean up files
|
||||
run: |
|
||||
mv -vf assets/changelog/* .
|
||||
rm -rf assets/MAACore-macos-*
|
||||
# rm -rf assets/MAACore-macos-*
|
||||
cd assets
|
||||
# find . -type f | xargs mv -fvt .
|
||||
find . -type f | while read f; do mv -fvt . $f; done
|
||||
|
||||
Reference in New Issue
Block a user