aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2022-05-15 08:38:42 +0000
committerSaturneric <[email protected]>2022-05-15 08:38:42 +0000
commit516c117bf49c3e0616e9f53ae9b6c8d756618ef7 (patch)
treeb24367f58c52acc9993e4b5c8bf3d0d2519d3335
parentMerge remote-tracking branch 'origin/develop-2.0.8' into develop-2.0.8 (diff)
downloadGpgFrontend-516c117bf49c3e0616e9f53ae9b6c8d756618ef7.tar.gz
GpgFrontend-516c117bf49c3e0616e9f53ae9b6c8d756618ef7.zip
feat: update macOS App Bundle ci
-rw-r--r--.github/workflows/release.yml39
-rw-r--r--CMakeLists.txt5
-rw-r--r--resource/plist/ExportOptions.plist.in21
-rw-r--r--src/CMakeLists.txt3
4 files changed, 52 insertions, 16 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 5696c692..f1df8768 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -141,34 +141,43 @@ jobs:
cmake --build ${{github.workspace}}/build --config {{$env.BUILD_TYPE}} -- -v
if: matrix.os == 'ubuntu-18.04'
- - name: Build GpgFrontend (macOS)
+ - name: Build & Export GpgFrontend (macOS)
# Build your GpgFrontend with the given configuration
run: |
- cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- cmake --build ${{github.workspace}}/build --config {{$env.BUILD_TYPE}} -- -v
- if: matrix.os == 'macos-10.15'
-
- - name: Build & Sign App Bundle (macOS)
- run: |
- security -v unlock-keychain -p gpgfrontend
- macdeployqt ${{github.workspace}}/build/release/GpgFrontend.app
- codesign --deep --force --options=runtime -s "Developer ID Application: Yu Hu (4279AWUL3X)" ${{github.workspace}}/build/release/GpgFrontend.app -v
- mkdir ${{github.workspace}}/build/tmp/
+ cmake -B ${{github.workspace}}/build -G Xcode \
+ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
+ -DGPGFRONTEND_XOCDE_CODE_SIGN_IDENTITY="${{secrets.GPGFRONTEND_XOCDE_CODE_SIGN_IDENTITY}}" \
+ -DGPGFRONTEND_XCODE_TEAM_ID="${{secrets.GPGFRONTEND_XCODE_TEAM_ID}}" \
+ -DGPGFRONTEND_XOCDE_APPID="${{secrets.GPGFRONTEND_XOCDE_APPID}}" \
+ -DGPGFRONTEND_XOCDE_PROVISIONING_PROFILE_UUID="${{secrets.GPGFRONTEND_XOCDE_PROVISIONING_PROFILE_UUID}}"
+ xcodebuild -list -project ${{github.workspace}}/build/GpgFrontend.xcodeproj
+ cd ${{github.workspace}}/build/
+ xcodebuild -scheme GpgFrontend -configuration Release -archivePath ${{github.workspace}}/build/GpgFrontend.xcarchive archive
+ mkdir ${{github.workspace}}/build/package
+ xcodebuild -exportArchive -archivePath ${{github.workspace}}/build/GpgFrontend.xcarchive \
+ -exportOptionsPlist ${{github.workspace}}/build/ExportOptions.plist \
+ -exportPath ${{github.workspace}}/build/package/
if: matrix.os == 'macos-10.15'
- name: Package & Sign App Bundle (macOS)
run: |
security -v unlock-keychain -p gpgfrontend
- hdiutil create ${{github.workspace}}/build/tmp/tmp.dmg -ov -volname "GpgFrontend" -fs HFS+ -srcfolder ${{github.workspace}}/build/release/
+ ditto -c -k --keepParent ${{github.workspace}}/build/package/GpgFrontend.app ${{github.workspace}}/build/package/GpgFrontend.app.zip
+
+ hdiutil create ${{github.workspace}}/build/tmp/tmp.dmg -ov -volname "GpgFrontend" -fs HFS+ -srcfolder ${{github.workspace}}/build/package/GpgFrontend.app
mkdir ${{github.workspace}}/build/artifactOut
hdiutil convert ${{github.workspace}}/build/tmp/tmp.dmg -format UDZO -o ${{github.workspace}}/build/artifactOut/GpgFrontend.dmg
- codesign -s "Developer ID Application: Yu Hu (4279AWUL3X)" ${{github.workspace}}/build/artifactOut/GpgFrontend.dmg
- mv ${{github.workspace}}/build/artifactOut/GpgFrontend.dmg ${{github.workspace}}/build/artifactOut/GpgFrontend-${{steps.vars.outputs.sha_short}}-x86_64.dmg
+ codesign -s "${{secrets.GPGFRONTEND_XOCDE_CODE_SIGN_IDENTITY}}" ${{github.workspace}}/build/artifactOut/GpgFrontend.dmg
+ mv ${{github.workspace}}/build/package/GpgFrontend.app.zip ${{github.workspace}}/build/artifactOut/GpgFrontend-${{steps.vars.outputs.sha_short}}-x86_64.zip
if: matrix.os == 'macos-10.15'
- name: Notarize Release Build (macOS)
run: |
- xcrun altool --notarize-app -f ${{github.workspace}}/build/artifactOut/GpgFrontend-${{steps.vars.outputs.sha_short}}-x86_64.dmg --primary-bundle-id pub.gpgfrontend.gpgfrontend -u ${{secrets.APPLE_DEVELOPER_ID}} -p ${{secrets.APPLE_DEVELOPER_ID_SECRET}}
+ xcrun altool --notarize-app \
+ -f ${{github.workspace}}/build/package/GpgFrontend.app.zip \
+ --primary-bundle-id ${{secrets.GPGFRONTEND_XOCDE_APPID}} \
+ -u ${{secrets.APPLE_DEVELOPER_ID}} \
+ -p ${{secrets.APPLE_DEVELOPER_ID_SECRET}}
if: matrix.os == 'macos-10.15'
- name: Package App Image (Linux)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e93de668..eecb01b0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,7 +57,10 @@ option(GPGFRONTEND_BUILD_TYPE_STABLE
option(GPGFRONTEND_GENERATE_LINUX_INSTALL_SOFTWARE "Generate an installable version" OFF)
option(GPGFRONTEND_GENERATE_APP_PACKAGE_DEB "Generate DEB package" OFF)
option(GPGFRONTEND_CONFIGURE_FOR_XCODE_BUILD "Generate a version that can be successfully compiled and packaged in Xcode" OFF)
-option(GPGFRONTEND_XOCDE_CODE_SIGN_IDENTITY "GpgFrontend Signing Certificate" "")
+option(GPGFRONTEND_XCODE_TEAM_ID "GpgFrontend Apple Team ID" "NONE")
+option(GPGFRONTEND_XOCDE_CODE_SIGN_IDENTITY "GpgFrontend Signing Certificate" "NONE")
+option(GPGFRONTEND_XOCDE_APPID "GpgFrontend Apple AppID" "NONE")
+option(GPGFRONTEND_XOCDE_PROVISIONING_PROFILE_UUID "GpgFrontend ProvisioningProfile UUID" "NONE")
# analyse options
if (GPGFRONTEND_BUILD_TYPE_TEST_CORE)
diff --git a/resource/plist/ExportOptions.plist.in b/resource/plist/ExportOptions.plist.in
new file mode 100644
index 00000000..48a6567d
--- /dev/null
+++ b/resource/plist/ExportOptions.plist.in
@@ -0,0 +1,21 @@
+<?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>method</key>
+ <string>developer-id</string>
+ <key>teamID</key>
+ <string>@GPGFRONTEND_XCODE_TEAM_ID@</string>
+ <key>compileBitcode</key>
+ <true/>
+ <key>signingStyle</key>
+ <string>automatic</string>
+ <key>signingCertificate</key>
+ <string>@GPGFRONTEND_XOCDE_CODE_SIGN_IDENTITY@</string>
+ <key>provisioningProfiles</key>
+ <dict>
+ <key>@GPGFRONTEND_XOCDE_APPID@</key>
+ <string>@GPGFRONTEND_XOCDE_PROVISIONING_PROFILE_UUID@</string>
+ </dict>
+</dict>
+</plist> \ No newline at end of file
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 736f7440..fb38cb9a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -129,6 +129,9 @@ if (BASIC_ENV_CONFIG)
configure_file(${CMAKE_SOURCE_DIR}/src/GpgFrontend.h.in ${CMAKE_SOURCE_DIR}/src/GpgFrontend.h @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/src/GpgFrontendBuildInfo.h.in ${CMAKE_SOURCE_DIR}/src/GpgFrontendBuildInfo.h @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/src/GpgFrontendBuildInstallInfo.h.in ${CMAKE_SOURCE_DIR}/src/GpgFrontendBuildInstallInfo.h @ONLY)
+ if(APPLE)
+ configure_file(${CMAKE_SOURCE_DIR}/resource/plist/ExportOptions.plist.in ${CMAKE_BINARY_DIR}/ExportOptions.plist @ONLY)
+ endif ()
endif ()
if (APPLICATION_BUILD)