diff --git a/.github/actions/xcbuild/action.yml b/.github/actions/xcbuild/action.yml index 0facc0bae..c2a774ecc 100644 --- a/.github/actions/xcbuild/action.yml +++ b/.github/actions/xcbuild/action.yml @@ -25,9 +25,6 @@ inputs: KEYCHAIN_PASSWORD: required: false default: mysecretpassword - KEYCHAIN_PROFILE: - required: false - default: build-profile XC_WORKSPACE: required: false default: Kiwix.xcodeproj/project.xcworkspace/ diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 74d0e1ab4..36fcdbb3a 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -9,6 +9,12 @@ name: CD # |-----------------|---------|------------------------|----------------|---------------------| # | UPLOAD_FOLDER | nightly | - | - | release/kiwix-macos | # |-----------------|---------|------------------------|----------------|---------------------| + +# Signing certificates: +# - iOS/macOS + app-store: Apple Distribution +# - iOS + FTP: Apple Development +# - macOS + FTP: Developer ID + on: schedule: - cron: '32 1 * * *' # Nightly download.kiwix.org @ 01:32 @@ -52,6 +58,13 @@ jobs: - name: Install python dependencies run: pip install pyyaml==6.0.1 + # https://developer.apple.com/help/account/reference/supported-capabilities-macos + - name: Remove In App Purchase capability for macOS FTP (Developer ID signing) + if: matrix.platform == 'macOS' && matrix.destination == 'ftp' + run: | + sed -i '' '/in-app-payments/d' project.yml + plutil -insert HIDE_DONATION -bool true Support/Info.plist + - name: Set VERSION from code shell: python run: | @@ -111,8 +124,8 @@ jobs: if: matrix.platform == 'iOS' && contains(env.UPLOAD_TO, matrix.destination) run: echo "EXTRA_XCODEBUILD=-sdk iphoneos ${{ env.APPLE_AUTH_PARAMS }}" >> $GITHUB_ENV - - name: Set EXTRA_XCODEBUILD for macOS AppStore - if: matrix.platform == 'macOS' && matrix.destination == 'app-store' + - name: Set macOS extra xcode params + if: matrix.platform == 'macOS' && contains(env.UPLOAD_TO, matrix.destination) run: echo "EXTRA_XCODEBUILD=${{ env.APPLE_AUTH_PARAMS }}" >> $GITHUB_ENV - name: Set macOS FTP export method, and Developer ID Certificate @@ -150,7 +163,6 @@ jobs: DEPLOYMENT_SIGNING_CERTIFICATE_P12_PASSWORD: ${{ env.SIGNING_CERTIFICATE_P12_PASSWORD }} KEYCHAIN: ${{ env.KEYCHAIN }} KEYCHAIN_PASSWORD: ${{ env.KEYCHAIN_PASSWORD }} - KEYCHAIN_PROFILE: ${{ env.KEYCHAIN_PROFILE }} EXTRA_XCODEBUILD: ${{ env.EXTRA_XCODEBUILD }} - name: Add altool credentials to Keychain diff --git a/App/App_macOS.swift b/App/App_macOS.swift index f7c48b887..52bee99e9 100644 --- a/App/App_macOS.swift +++ b/App/App_macOS.swift @@ -196,7 +196,7 @@ struct RootView: View { } .frame(minWidth: 160) .safeAreaInset(edge: .bottom) { - if Payment.paymentButtonType() != nil { + if Payment.paymentButtonType() != nil && Brand.hideDonation != true { SupportKiwixButton { openWindow(id: "donation") } diff --git a/Model/Brand.swift b/Model/Brand.swift index d9a13055a..26a8c636a 100644 --- a/Model/Brand.swift +++ b/Model/Brand.swift @@ -51,6 +51,11 @@ enum Brand { static let aboutText: String = Config.value(for: .aboutText) ?? "settings.about.description".localized static let aboutWebsite: String = Config.value(for: .aboutWebsite) ?? "https://www.kiwix.org" + // currently only used under the Kiwix brand + // if this is set to true in Support/Info.plist the support/donation button is hidden (for macOS FTP) + // if not set, we fall back to false, and display the support/donation button + // for non Kiwix brands, it has no effect + static let hideDonation: Bool = Config.value(for: .hideDonation) ?? false static var defaultExternalLinkPolicy: ExternalLinkLoadingPolicy { guard let policyString: String = Config.value(for: .externalLinkDefaultPolicy), @@ -81,6 +86,7 @@ enum Config: String { case showSearchSnippetInSettings = "SETTINGS_SHOW_SEARCH_SNIPPET" case aboutText = "CUSTOM_ABOUT_TEXT" case aboutWebsite = "CUSTOM_ABOUT_WEBSITE" + case hideDonation = "HIDE_DONATION" static func value(for key: Config) -> T? where T: LosslessStringConvertible { guard let object = Bundle.main.object(forInfoDictionaryKey: key.rawValue) else { diff --git a/project.yml b/project.yml index 796a2db5e..2136e4c57 100644 --- a/project.yml +++ b/project.yml @@ -98,7 +98,7 @@ targets: entitlements: properties: com.apple.security.files.downloads.read-write: true - com.apple.developer.in-app-payments: [merchant.org.kiwix.apple] + com.apple.developer.in-app-payments: [merchant.org.kiwix.apple] # this line is removed for macOS FTP settings: base: MARKETING_VERSION: "3.7.0"