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_BUILD_NUMBER=`ci/build-number.sh ios`
bundle exec fastlane --env ios,beta store_beta
- name: Publish on TestFlight (macOS)
run: |
export PILOT_APP_VERSION=`ci/version-number.sh mac`
export PILOT_BUILD_NUMBER=`ci/build-number.sh mac`
bundle exec fastlane --env mac,beta store_beta
# - name: Publish on TestFlight (macOS)
# run: |
# export PILOT_APP_VERSION=`ci/version-number.sh mac`
# export PILOT_BUILD_NUMBER=`ci/build-number.sh mac`
# bundle exec fastlane --env mac,beta store_beta
submit_for_app_review:
if: github.ref == 'refs/heads/stable'
runs-on: ubuntu-latest

View File

@ -97,6 +97,11 @@ extension NSViewController {
vc.delegate = delegate
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 {

View File

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

View File

@ -264,5 +264,12 @@ class ProfileCustomizationViewController: NSTabViewController {
tabViewItems[4].label = L10n.NetworkSettings.Dns.title
tabViewItems[5].label = L10n.NetworkSettings.Proxy.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"
#endif
#else
// FIXME: skip TestFlight on macOS until beta condition is clearly determined
return false
#endif
}