Restrict macOS features in beta

- Providers
- Trusted networks

Skip macOS deployment to TestFlight until beta check is fixed.
This commit is contained in:
Davide De Rosa 2021-11-11 16:26:33 +01:00
parent 8fa31b0323
commit 1eeb356874
5 changed files with 21 additions and 5 deletions

View File

@ -102,11 +102,11 @@ jobs:
export PILOT_APP_VERSION=`ci/version-number.sh ios` export PILOT_APP_VERSION=`ci/version-number.sh ios`
export PILOT_BUILD_NUMBER=`ci/build-number.sh ios` export PILOT_BUILD_NUMBER=`ci/build-number.sh ios`
bundle exec fastlane --env ios,beta store_beta bundle exec fastlane --env ios,beta store_beta
- name: Publish on TestFlight (macOS) # - name: Publish on TestFlight (macOS)
run: | # run: |
export PILOT_APP_VERSION=`ci/version-number.sh mac` # export PILOT_APP_VERSION=`ci/version-number.sh mac`
export PILOT_BUILD_NUMBER=`ci/build-number.sh mac` # export PILOT_BUILD_NUMBER=`ci/build-number.sh mac`
bundle exec fastlane --env mac,beta store_beta # bundle exec fastlane --env mac,beta store_beta
submit_for_app_review: submit_for_app_review:
if: github.ref == 'refs/heads/stable' if: github.ref == 'refs/heads/stable'
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -97,6 +97,11 @@ extension NSViewController {
vc.delegate = delegate vc.delegate = delegate
presentAsModalWindow(vc) presentAsModalWindow(vc)
} }
func presentBetaFeatureUnavailable(_ title: String) {
let alert = Macros.warning(title, "The requested feature is unavailable in beta.")
alert.present(in: view.window, withOK: "OK", handler: nil)
}
} }
extension NSView { extension NSView {

View File

@ -89,6 +89,9 @@ class OrganizerViewController: NSViewController {
} }
do { do {
try ProductManager.shared.verifyEligible(forProvider: metadata) try ProductManager.shared.verifyEligible(forProvider: metadata)
} catch ProductError.beta {
presentBetaFeatureUnavailable("Providers")
return
} catch { } catch {
presentPurchaseScreen(forProduct: metadata.product) presentPurchaseScreen(forProduct: metadata.product)
return return

View File

@ -264,5 +264,12 @@ class ProfileCustomizationViewController: NSTabViewController {
tabViewItems[4].label = L10n.NetworkSettings.Dns.title tabViewItems[4].label = L10n.NetworkSettings.Dns.title
tabViewItems[5].label = L10n.NetworkSettings.Proxy.title tabViewItems[5].label = L10n.NetworkSettings.Proxy.title
tabViewItems[6].label = L10n.NetworkSettings.Mtu.title tabViewItems[6].label = L10n.NetworkSettings.Mtu.title
do {
try ProductManager.shared.verifyEligible(forFeature: .trustedNetworks)
} catch ProductError.beta {
tabViewItems.remove(at: 2)
} catch {
}
} }
} }

View File

@ -104,6 +104,7 @@ public class ProductManager: NSObject {
return Bundle.main.appStoreReceiptURL?.lastPathComponent == "sandboxReceipt" return Bundle.main.appStoreReceiptURL?.lastPathComponent == "sandboxReceipt"
#endif #endif
#else #else
// FIXME: skip TestFlight on macOS until beta condition is clearly determined
return false return false
#endif #endif
} }