diff --git a/Package.swift b/Package.swift index 18b9b98..4b00774 100644 --- a/Package.swift +++ b/Package.swift @@ -74,9 +74,25 @@ let package = Package( // we're building in the Swift.org CI system alongside other projects in the Swift toolchain and // we can depend on local versions of our dependencies instead of fetching them remotely. if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil { + + // If the `SWIFT_CERTIFICATES_ALLOW_SWIFT_CRYPTO_BETA` environment variable is set + // swift-certificates will accept swift-crypto beta releases as a dependency. + // + // Note: A beta release can only be used if other packages in the dependency tree + // that have a direct dependency on swift-crypto accept beta releases as well. + if ProcessInfo.processInfo.environment["SWIFT_CERTIFICATES_ALLOW_SWIFT_CRYPTO_BETA"] == nil { + package.dependencies += [ + .package(url: "https://github.com/apple/swift-crypto.git", "3.12.3"..<"5.0.0") + ] + } else { + print("Accepting beta versions of swift-crypto!") + package.dependencies += [ + .package(url: "https://github.com/apple/swift-crypto.git", "3.12.3"..<"5.0.0-beta.max") + ] + } + package.dependencies += [ - .package(url: "https://github.com/apple/swift-crypto.git", "3.12.3"..<"5.0.0"), - .package(url: "https://github.com/apple/swift-asn1.git", from: "1.1.0"), + .package(url: "https://github.com/apple/swift-asn1.git", from: "1.1.0") ] } else { package.dependencies += [