Skip to content
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
21 changes: 11 additions & 10 deletions .github/workflows/native-sdk-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
# implements the Unity side and pushes it onto the same PR.
#
# Android is pinned exactly in Plugins/Android/.../build.gradle. iOS is pinned
# in two places that this workflow keeps identical: the Podfile lines written
# by Editor/SuperwallPostBuildProcessor.cs, and the SPM requirement in
# ci~/ios-harness/Package.swift. A floating requirement (`~> 4.0`, `from:`) is
# in two places that this workflow keeps identical: SuperwallKitMinimumVersion
# in Editor/SuperwallPostBuildProcessor.cs (the Swift package requirement added
# to the exported Xcode project, up to the next major), and the SPM requirement
# in ci~/ios-harness/Package.swift. A floating harness requirement (`from:`) is
# replaced with an exact version on the first bump.
#
# Secrets:
Expand Down Expand Up @@ -123,11 +124,11 @@ jobs:
if [ "$PLATFORM" = android ]; then
CURRENT="$(sed -nE "s/.*com\.superwall\.sdk:superwall-android:([^']+)'.*/\1/p" Plugins/Android/SuperwallSDK.androidlib/build.gradle)"
else
# Exact SPM pin once one exists; otherwise the Podfile requirement,
# which starts out as a floating range (`~> 4.0`).
# Exact SPM pin in the harness once one exists; otherwise the
# minimum version the post-build processor requires.
CURRENT="$(sed -nE 's/.*Superwall-iOS", exact: "([^"]+)".*/\1/p' ci~/ios-harness/Package.swift)"
if [ -z "$CURRENT" ]; then
CURRENT="$(sed -nE "s/.*pod 'SuperwallKit', '([^']+)'.*/\1/p" Editor/SuperwallPostBuildProcessor.cs | head -1)"
CURRENT="$(sed -nE 's/.*SuperwallKitMinimumVersion = "([^"]+)".*/\1/p' Editor/SuperwallPostBuildProcessor.cs | head -1)"
fi
fi
[ -n "$CURRENT" ] || { echo "::error::Could not read the current $PLATFORM pin"; exit 1; }
Expand Down Expand Up @@ -178,9 +179,9 @@ jobs:
sed -i -E "s/superwall-android $CURRENT/superwall-android $VERSION/" \
Plugins/Android/SuperwallSDK.androidlib/build.gradle
else
# Podfile text (three copies) and the SPM harness must name the
# same version. `from:` becomes `exact:` the first time.
sed -i -E "s/(pod 'SuperwallKit', ')[^']+'/\1$VERSION'/" \
# The exported project's package requirement and the SPM harness
# must name the same version. `from:` becomes `exact:` the first time.
sed -i -E "s/(SuperwallKitMinimumVersion = \")[^\"]+\"/\1$VERSION\"/" \
Editor/SuperwallPostBuildProcessor.cs
sed -i -E "s#(Superwall-iOS\", )(from|exact): \"[^\"]+\"#\1exact: \"$VERSION\"#" \
ci~/ios-harness/Package.swift
Expand Down Expand Up @@ -242,7 +243,7 @@ jobs:
if [ "$PLATFORM" = android ]; then
PLATFORM_NOTES="The Android bridge is Plugins/Android/SuperwallSDK.androidlib (Kotlin). Compile it with \`(cd ci~/android-harness && gradle :SuperwallSDK:assembleRelease -PagpVersion=8.5.2 --no-daemon)\`. C# cannot be compiled on this runner (no Unity); say so in the PR description."
else
PLATFORM_NOTES="The iOS bridge is Plugins/iOS/SuperwallUnityBridge.swift. The Podfile lines live in Editor/SuperwallPostBuildProcessor.cs and the SPM pin in ci~/ios-harness/Package.swift; keep them on the same version. This runner is Linux: Swift cannot be compiled here, and neither can C# (no Unity). Be careful and precise, and say in the PR description that iOS was not compiled locally."
PLATFORM_NOTES="The iOS bridge is Plugins/iOS/SuperwallUnityBridge.swift. The Swift package requirement of the exported Xcode project is SuperwallKitMinimumVersion in Editor/SuperwallPostBuildProcessor.cs (asserted by Tests/Editor/SwiftPackageRequirementTests.cs) and the harness pin is in ci~/ios-harness/Package.swift; keep them on the same version. This runner is Linux: Swift cannot be compiled here, and neither can C# (no Unity). Be careful and precise, and say in the PR description that iOS was not compiled locally."
fi
DELIM="PROMPT_$(openssl rand -hex 8)"
{
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# Changelog
All notable changes to this package will be documented in this file.

## [0.6.0]

### Breaking Changes
* iOS: SuperwallKit now comes from Swift Package Manager instead of CocoaPods. The post-build processor adds the `https://github.com/superwall/Superwall-iOS` package (from 4.19.1 up to the next major version) to the exported Xcode project, links `SuperwallKit` to `UnityFramework` and copies SuperwallKit's resource bundle into it. It no longer writes a Podfile, so CocoaPods is no longer required. Open `Unity-iPhone.xcodeproj`; Xcode resolves the package on first open or build. Projects that use other pods (for example through External Dependency Manager) keep their Podfile and workspace as before.
* iOS: a Target minimum iOS Version below 15.0 is no longer raised for SuperwallKit, because Swift packages build for the app's own deployment target. The build still logs a warning; raise the target to 15.0 or the Xcode build fails to link SuperwallKit.

### Fixes
* iOS: 0.4.1 and 0.5.0 required SuperwallKit 4.19.1 from CocoaPods, but SuperwallKit 4.19.0 and later aren't published there (the newest pod is 4.18.3), so `pod install` failed with `None of your spec sources contain a spec satisfying the dependency: SuperwallKit (< 5.0, >= 4.19.1)` and the Xcode build couldn't link SuperwallKit. Getting it from Swift Package Manager fixes this.

### Migration
* A Replace build needs no changes. An Append build over an iOS project exported by an earlier version keeps the old Podfile: the post-build processor removes its SuperwallKit pod and runs `pod install`, so the workspace doesn't link SuperwallKit from both the pod and the Swift package. If `pod install` can't run, the build logs a warning with the command to run yourself, or make a Replace build.

## [0.5.0]

### Enhancements
Expand Down
Loading
Loading