From 85761ab7b9ca2eeaf826b05d584c88724539476a Mon Sep 17 00:00:00 2001 From: Jamie McDonald Date: Mon, 27 Nov 2023 22:51:54 +0000 Subject: [PATCH] Add release config --- .github/workflows/push.yml | 4 +-- .github/workflows/release.yml | 40 +++++++++++++++++++++--- macOS/Arrivals.xcodeproj/project.pbxproj | 10 ++++-- 3 files changed, 43 insertions(+), 11 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index cd5c459..a3f812f 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -28,7 +28,6 @@ jobs: macOS: name: macOS app - if: false runs-on: macos-13 steps: @@ -52,5 +51,4 @@ jobs: run: | xcodebuild -project macOS/Arrivals.xcodeproj \ -scheme Arrivals \ - -destination 'platform=macOS' \ - -configuration Debug + -configuration Debug build CONFIGURATION_BUILD_DIR=./target/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 088c452..1fad29e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,9 +31,39 @@ jobs: run: | xcodebuild -project macOS/Arrivals.xcodeproj \ -scheme Arrivals \ - -destination 'platform=macOS' \ - -configuration Release + -configuration Release build CONFIGURATION_BUILD_DIR=./target/ -# TODO -# - name: Sign -# - name: Upload Artifact + - name: Sign + env: + MACOS_CERTIFICATE: ${{ secrets.PROD_MACOS_CERTIFICATE }} + MACOS_CERTIFICATE_PWD: ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }} + MACOS_CERTIFICATE_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }} + MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }} + run: | + echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12 + + security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain + security default-keychain -s build.keychain + security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain + security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign + security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_CI_KEYCHAIN_PWD" build.keychain + + /usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" --options runtime macOS/target/Arrivals.app -v + + - name: Notarize + env: + PROD_MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }} + PROD_MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }} + PROD_MACOS_NOTARIZATION_PWD: ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }} + run: | + xcrun notarytool store-credentials "notarytool-profile" --apple-id "$PROD_MACOS_NOTARIZATION_APPLE_ID" --team-id "$PROD_MACOS_NOTARIZATION_TEAM_ID" --password "$PROD_MACOS_NOTARIZATION_PWD" + + ditto -c -k --keepParent "macOS/target/Arrivals.app" "arrivals.zip" + xcrun notarytool submit "arrivals.zip" --keychain-profile "notarytool-profile" --wait + + xcrun stapler staple "macOS/target/Arrivals.app" + + - uses: actions/upload-artifact@v3 + with: + name: Arrivals + path: macOS/target/Arrivals.app diff --git a/macOS/Arrivals.xcodeproj/project.pbxproj b/macOS/Arrivals.xcodeproj/project.pbxproj index 3a83db7..19383d1 100644 --- a/macOS/Arrivals.xcodeproj/project.pbxproj +++ b/macOS/Arrivals.xcodeproj/project.pbxproj @@ -439,13 +439,15 @@ FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)"; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Arrivals/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = "TfL Arrivals"; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INFOPLIST_KEY_LSUIElement = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", ); - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 0.1; OTHER_LDFLAGS = ( "$(inherited)", "-framework", @@ -466,6 +468,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = Arrivals/Arrivals.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; @@ -477,13 +480,15 @@ FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)"; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Arrivals/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = "TfL Arrivals"; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INFOPLIST_KEY_LSUIElement = YES; INFOPLIST_KEY_NSHumanReadableCopyright = ""; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", ); - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 0.1; OTHER_LDFLAGS = ( "$(inherited)", "-framework", @@ -492,7 +497,6 @@ PRODUCT_BUNDLE_IDENTIFIER = com.jdamcd.Arrivals; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; - "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; };