Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 8.1.2 #1346

Merged
merged 5 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/ci-podspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ on:
- PromiseKit.podspec
jobs:
lint:
runs-on: macos-latest
runs-on: macos-14
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 15.2
- uses: maxim-lobanov/setup-cocoapods@v1
with:
version: 1.15.0
- uses: actions/checkout@v2
with:
submodules: true
Expand Down
34 changes: 5 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@ jobs:
- run: git diff --exit-code

test:
runs-on: macos-latest
runs-on: macos-14
strategy:
matrix:
dst:
- platform=macOS
- platform=tvOS Simulator,OS=15.0,name=Apple TV
- platform=iOS Simulator,OS=15.0,name=iPhone 12
- "platform=macOS,arch=arm64,id=0000FE00-392BB8A41C01F642"
- "platform=iOS Simulator,OS=17.0.1,name=iPhone 14"
- "platform=tvOS Simulator,OS=17.2,name=Apple TV"
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 13.1
xcode-version: 15.2
- uses: actions/checkout@v2
- uses: sersoft-gmbh/xcodebuild-action@v1
with:
Expand All @@ -95,27 +95,3 @@ jobs:
action: test
enable-code-coverage: true
- uses: codecov/codecov-action@v1

carthage:
runs-on: ${{ matrix.macos }}
strategy:
matrix:
xcode: [^11, ^12, ^13]
macos: [macos-11]
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode }}
- uses: actions/checkout@v2

- uses: mingjun97/file-regex-replace@v1
with:
regex: SWIFT_TREAT_WARNINGS_AS_ERRORS = NO
replacement: SWIFT_TREAT_WARNINGS_AS_ERRORS = YES
include: project.pbxproj

- run: |
if [ ${{ matrix.xcode }} != ^11 ]; then
echo "CARTHAGE_ARGS=--use-xcframeworks" >> $GITHUB_ENV
fi
- run: carthage build --no-skip-current --no-use-binaries $CARTHAGE_ARGS
3 changes: 1 addition & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ jobs:
strategy:
matrix:
xcode:
- ^13
- ^14
- ^15
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
Expand Down
3 changes: 3 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ pkg.products = [

let pmk: Target = .target(name: "PromiseKit")
pmk.path = "Sources"
pmk.resources = [
.process("Resources/PrivacyInfo.xcprivacy")
]
pmk.exclude = [
"AnyPromise.swift",
"AnyPromise.m",
Expand Down
9 changes: 7 additions & 2 deletions PromiseKit.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "PromiseKit"

s.version = '8.1.1'
s.version = '8.1.2'

s.source = {
:git => "https://github.com/mxcl/#{s.name}.git",
Expand All @@ -19,7 +19,7 @@ Pod::Spec.new do |s|
s.default_subspecs = 'CorePromise', 'UIKit', 'Foundation'
s.requires_arc = true

s.swift_versions = ['3.2', '3.3', '3.4', '4.0', '4.1', '4.2', '4.3', '4.4', '5.0', '5.1', '5.2', '5.3', '5.4', '5.5']
s.swift_version = '3.2', '3.3', '3.4', '4.0', '4.1', '4.2', '4.3', '4.4', '5.0', '5.1', '5.2', '5.3', '5.4', '5.5'

# CocoaPods requires us to specify the root deployment targets
# even though for us it is nonsense. Our root spec has no
Expand All @@ -28,11 +28,16 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.13'
s.watchos.deployment_target = '4.0'
s.tvos.deployment_target = '10.0'
s.visionos.deployment_target = '1.0'

s.pod_target_xcconfig = {
'OTHER_SWIFT_FLAGS' => '-DPMKCocoaPods',
}

s.resource_bundles = {
'SwifterSwift_Privacy' => 'Sources/Resources/PrivacyInfo.xcprivacy'
}

s.subspec 'Accounts' do |ss|
ss.ios.source_files = ss.osx.source_files = 'Extensions/Accounts/Sources/**/*'
ss.exclude_files = 'Extensions/Accounts/Sources/*.plist'
Expand Down
27 changes: 23 additions & 4 deletions PromiseKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@
9E4170F8287D88C800A3B4B5 /* Async.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Async.swift; path = Sources/Async.swift; sourceTree = "<group>"; };
9E4170FA287D8DBD00A3B4B5 /* AsyncTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AsyncTests.swift; sourceTree = "<group>"; };
9E66231526FE5A8C00FA25CB /* RaceTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RaceTests.m; sourceTree = "<group>"; };
9E8028F72BDCEDBC0081E2D1 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
9EC774262991495C00803027 /* Combine.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Combine.swift; path = Sources/Combine.swift; sourceTree = "<group>"; };
9EC774282991497900803027 /* CombineTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CombineTests.swift; sourceTree = "<group>"; };
C013F7372048E3B6006B57B1 /* MockNodeEnvironment.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MockNodeEnvironment.swift; path = "Tests/JS-A+/MockNodeEnvironment.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -458,6 +459,7 @@
63B18AEB1F2D205C00B79E37 /* CustomStringConvertible.swift */,
63D9B2F020338D5D0075C00B /* Deprecations.swift */,
085B96BE21A9B37C00E5E22F /* LogEvent.swift */,
9E8028F82BDCEDBC0081E2D1 /* Resources */,
);
name = Sources.swift;
sourceTree = "<group>";
Expand Down Expand Up @@ -497,6 +499,15 @@
name = Features;
sourceTree = "<group>";
};
9E8028F82BDCEDBC0081E2D1 /* Resources */ = {
isa = PBXGroup;
children = (
9E8028F72BDCEDBC0081E2D1 /* PrivacyInfo.xcprivacy */,
);
name = Resources;
path = Sources/Resources;
sourceTree = "<group>";
};
C0244E6B2047ACAF00ACB4AC /* JS/A+ */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -946,7 +957,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 8.1.1;
CURRENT_PROJECT_VERSION = 8.1.2;
DEBUG_INFORMATION_FORMAT = dwarf;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand Down Expand Up @@ -976,6 +987,7 @@
TVOS_DEPLOYMENT_TARGET = 11.0;
VERSIONING_SYSTEM = "apple-generic";
WATCHOS_DEPLOYMENT_TARGET = 4.0;
XROS_DEPLOYMENT_TARGET = 1.0;
};
name = Debug;
};
Expand Down Expand Up @@ -1008,7 +1020,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 8.1.1;
CURRENT_PROJECT_VERSION = 8.1.2;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand All @@ -1034,6 +1046,7 @@
TVOS_DEPLOYMENT_TARGET = 11.0;
VERSIONING_SYSTEM = "apple-generic";
WATCHOS_DEPLOYMENT_TARGET = 4.0;
XROS_DEPLOYMENT_TARGET = 1.0;
};
name = Release;
};
Expand Down Expand Up @@ -1087,8 +1100,11 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_PACKAGE_TYPE = FMWK;
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "$(AVAILABLE_PLATFORMS)";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_TREAT_WARNINGS_AS_ERRORS = NO;
TARGETED_DEVICE_FAMILY = "1,2,3,4";
TARGETED_DEVICE_FAMILY = "1,2,3,4,6,7";
};
name = Debug;
};
Expand Down Expand Up @@ -1142,8 +1158,11 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_PACKAGE_TYPE = FMWK;
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "$(AVAILABLE_PLATFORMS)";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SWIFT_TREAT_WARNINGS_AS_ERRORS = NO;
TARGETED_DEVICE_FAMILY = "1,2,3,4";
TARGETED_DEVICE_FAMILY = "1,2,3,4,6,7";
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion Sources/Async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public extension Promise {
try await withCheckedThrowingContinuation { continuation in
done { value in
continuation.resume(returning: value)
}.catch { error in
}.catch(policy: .allErrors) { error in
continuation.resume(throwing: error)
}
}
Expand Down
8 changes: 8 additions & 0 deletions Sources/Resources/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyTracking</key>
<false/>
</dict>
</plist>
50 changes: 50 additions & 0 deletions Tests/CorePromise/AsyncTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,55 @@ class AsyncTests: XCTestCase {

}
#endif

#if swift(>=5.5)
#if canImport(_Concurrency)
@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
func testAsyncPromiseCancel() async throws {
do {
let p = after(seconds: 0).done { _ in
throw LocalError.cancel
}.done {
XCTFail()
}
p.catch { _ in
XCTFail()
}
try await p.async()
XCTAssert(false)
} catch {
guard let cancellableError = error as? CancellableError else { return XCTFail("Unexpected error type") }
XCTAssertTrue(cancellableError.isCancelled)
}
}

@available(iOS, deprecated: 13.0)
@available(macOS, deprecated: 10.15)
@available(tvOS, deprecated: 13.0)
@available(watchOS, deprecated: 6.0)
func testAsyncPromiseCancel() {

}
#else
func testAsyncPromiseCancel() {

}
#endif
#else
func testAsyncPromiseCancel() {

}
#endif
}

private enum LocalError: CancellableError {
case notCancel
case cancel

var isCancelled: Bool {
switch self {
case .notCancel: return false
case .cancel: return true
}
}
}
2 changes: 2 additions & 0 deletions Tests/CorePromise/XCTestManifests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ extension AsyncTests {
static let __allTests__AsyncTests = [
("testAsyncGuaranteeValue", testAsyncGuaranteeValue),
("testAsyncGuaranteeValue", testAsyncGuaranteeValue),
("testAsyncPromiseCancel", testAsyncPromiseCancel),
("testAsyncPromiseCancel", testAsyncPromiseCancel),
("testAsyncPromiseThrow", testAsyncPromiseThrow),
("testAsyncPromiseThrow", testAsyncPromiseThrow),
("testAsyncPromiseValue", testAsyncPromiseValue),
Expand Down
7 changes: 7 additions & 0 deletions tea.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://tea.xyz/what-is-this-file
# created with https://mash.pkgx.sh/mxcl/tea-register
---
version: 1.0.0
codeOwners:
- '0x5E2DE4A68df811AAAD32d71fb065e6946fA5C8d9' # mxcl
quorum: 1
Loading