Skip to content

Commit 2c2b63f

Browse files
authored
revert: swift package release workflow and follow-ups (#404)
Reverts the SPM release flow, which broke all builds: - 732c439 feat: swift package release workflow (#395) - 736365c ci: spm build - c453116 ci: next handling for build targets - e652dd0 ci: spm version handling - 838ed31 chore: allow local builds/packs to use local spm - 0d92c89 chore: ensure next tag gates targets during spm verifications Unrelated changes that touched the same workflow are preserved: the dependabot action bumps (#398, #400, #401) and the test timeout headroom from 54bcc22.
1 parent 721633a commit 2c2b63f

13 files changed

Lines changed: 109 additions & 836 deletions

File tree

.github/workflows/npm_release.yml

Lines changed: 68 additions & 382 deletions
Large diffs are not rendered by default.

build_all_ios.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ rm -rf ./dist
77
./build_nativescript.sh --no-vision
88
./build_tklivesync.sh --no-vision
99
./prepare_dSYMs.sh
10-
./build_spm_artifacts.sh ios
1110
./build_npm_ios.sh

build_all_vision.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ rm -rf ./dist
77
./build_nativescript.sh --no-catalyst --no-iphone --no-sim
88
./build_tklivesync.sh --no-catalyst --no-iphone --no-sim
99
./prepare_dSYMs.sh
10-
./build_spm_artifacts.sh visionos
1110
./build_npm_vision.sh

build_npm_ios.sh

Lines changed: 11 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -11,65 +11,26 @@ cp ./package.json "$OUTPUT_DIR"
1111

1212
cp -r "./project-template-ios/" "$OUTPUT_DIR/framework"
1313

14-
# The NativeScript / TKLiveSync xcframeworks are NO LONGER bundled in npm. They
15-
# are published as GitHub Release artifacts and consumed via SwiftPM
16-
# (github.com/NativeScript/ios-spm). Stamp the runtime version into the packaged
17-
# template's SwiftPM reference so it resolves the matching release.
18-
NPM_VERSION=$(node -e "console.log(require('./package.json').version)")
19-
node ./scripts/stamp-template-version.mjs \
20-
"$OUTPUT_DIR/framework/__PROJECT_NAME__.xcodeproj/project.pbxproj" \
21-
"$NPM_VERSION"
14+
cp -r "dist/NativeScript.xcframework" "$OUTPUT_DIR/framework/internal"
15+
cp -r "dist/TKLiveSync.xcframework" "$OUTPUT_DIR/framework/internal"
2216

23-
# Local builds have no ios-spm release tag to resolve, so by default (outside
24-
# CI) rewrite the template to a LOCAL SwiftPM package over the xcframeworks
25-
# just built into dist/. Force with NS_SPM_LOCAL=1, disable with NS_SPM_LOCAL=0.
26-
# The resulting .tgz embeds an absolute path into this checkout — local
27-
# `ns platform add ios --framework-path=dist/nativescript-ios-*.tgz` use only.
28-
if [[ "${NS_SPM_LOCAL:-}" == "1" || ( -z "${CI:-}" && "${NS_SPM_LOCAL:-}" != "0" ) ]]; then
29-
LOCAL_SPM_DIR="$(pwd)/dist/local-spm"
30-
rm -rf "$LOCAL_SPM_DIR"
31-
mkdir -p "$LOCAL_SPM_DIR"
32-
cp -R "dist/NativeScript.xcframework" "$LOCAL_SPM_DIR/"
33-
cp -R "dist/TKLiveSync.xcframework" "$LOCAL_SPM_DIR/"
34-
cat > "$LOCAL_SPM_DIR/Package.swift" <<'EOF'
35-
// swift-tools-version: 5.10
36-
// Local dev override of github.com/NativeScript/ios-spm: same product shape,
37-
// but binaryTargets point at the freshly built xcframeworks in this folder.
38-
import PackageDescription
39-
40-
let package = Package(
41-
name: "NativeScriptSDK",
42-
platforms: [
43-
.iOS(.v13),
44-
.macCatalyst(.v13),
45-
],
46-
products: [
47-
.library(name: "NativeScript", targets: ["NativeScript", "TKLiveSync"]),
48-
.library(name: "NativeScriptSDK", targets: ["NativeScript", "TKLiveSync"]),
49-
],
50-
dependencies: [],
51-
targets: [
52-
.binaryTarget(name: "NativeScript", path: "NativeScript.xcframework"),
53-
.binaryTarget(name: "TKLiveSync", path: "TKLiveSync.xcframework"),
54-
]
55-
)
56-
EOF
57-
node ./scripts/stamp-template-local-spm.mjs \
58-
"$OUTPUT_DIR/framework/__PROJECT_NAME__.xcodeproj/project.pbxproj" \
59-
"$LOCAL_SPM_DIR"
60-
fi
61-
62-
# Build-time metadata generator is still shipped in npm (Phase 1). See the
63-
# distribution plan for moving this to an on-demand artifact (Phase 2).
6417
mkdir -p "$OUTPUT_DIR/framework/internal/metadata-generator-x86_64"
6518
cp -r "metadata-generator/dist/x86_64/." "$OUTPUT_DIR/framework/internal/metadata-generator-x86_64"
6619

6720
mkdir -p "$OUTPUT_DIR/framework/internal/metadata-generator-arm64"
6821
cp -r "metadata-generator/dist/arm64/." "$OUTPUT_DIR/framework/internal/metadata-generator-arm64"
6922

23+
# Add xcframeworks to .zip (NPM modules do not support symlinks, unzipping is done by {N} CLI)
24+
(
25+
set -e
26+
cd $OUTPUT_DIR/framework/internal
27+
zip -qr --symlinks XCFrameworks.zip *.xcframework
28+
rm -rf *.xcframework
29+
)
30+
7031
pushd "$OUTPUT_DIR"
7132
npm pack
7233
mv *.tgz ../
7334
popd
7435

75-
checkpoint "npm package created."
36+
checkpoint "npm package created."

build_npm_vision.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,26 @@ cp ./package.json "$OUTPUT_DIR"
1111

1212
cp -r "./project-template-vision/" "$OUTPUT_DIR/framework"
1313

14-
# The NativeScript / TKLiveSync xcframeworks are NO LONGER bundled in npm. They
15-
# are published as GitHub Release artifacts and consumed via SwiftPM
16-
# (github.com/NativeScript/ios-spm). Stamp the runtime version into the packaged
17-
# template's SwiftPM reference so it resolves the matching release.
18-
NPM_VERSION=$(node -e "console.log(require('./package.json').version)")
19-
node ./scripts/stamp-template-version.mjs \
20-
"$OUTPUT_DIR/framework/__PROJECT_NAME__.xcodeproj/project.pbxproj" \
21-
"$NPM_VERSION"
22-
23-
# Build-time metadata generator is still shipped in npm (Phase 1). See the
24-
# distribution plan for moving this to an on-demand artifact (Phase 2).
14+
cp -r "dist/NativeScript.xcframework" "$OUTPUT_DIR/framework/internal"
15+
cp -r "dist/TKLiveSync.xcframework" "$OUTPUT_DIR/framework/internal"
16+
2517
mkdir -p "$OUTPUT_DIR/framework/internal/metadata-generator-x86_64"
2618
cp -r "metadata-generator/dist/x86_64/." "$OUTPUT_DIR/framework/internal/metadata-generator-x86_64"
2719

2820
mkdir -p "$OUTPUT_DIR/framework/internal/metadata-generator-arm64"
2921
cp -r "metadata-generator/dist/arm64/." "$OUTPUT_DIR/framework/internal/metadata-generator-arm64"
3022

23+
# Add xcframeworks to .zip (NPM modules do not support symlinks, unzipping is done by {N} CLI)
24+
(
25+
set -e
26+
cd $OUTPUT_DIR/framework/internal
27+
zip -qr --symlinks XCFrameworks.zip *.xcframework
28+
rm -rf *.xcframework
29+
)
30+
3131
pushd "$OUTPUT_DIR"
3232
npm pack
3333
mv *.tgz ../
3434
popd
3535

36-
checkpoint "npm package created."
36+
checkpoint "npm package created."

build_spm_artifacts.sh

Lines changed: 0 additions & 83 deletions
This file was deleted.

project-template-ios/__PROJECT_NAME__.xcodeproj/project.pbxproj

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
AA10000000000000000000C1 /* NativeScript in Frameworks */ = {isa = PBXBuildFile; productRef = AA10000000000000000000B1 /* NativeScript */; };
10+
39940D9122C4EF600050DDE1 /* NativeScript.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 39940D8C22C4EAAA0050DDE1 /* NativeScript.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
11+
39940E1C22C5DFFF0050DDE1 /* TKLiveSync.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 39940E1B22C5DFFF0050DDE1 /* TKLiveSync.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1112
858B842D18CA22B800AB12DE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 858B833A18CA111C00AB12DE /* InfoPlist.strings */; };
1213
AAA0AADB2A54B96B00EE55A4 /* NativeScriptStart.m in Sources */ = {isa = PBXBuildFile; fileRef = AAA0AADA2A54B96B00EE55A4 /* NativeScriptStart.m */; };
1314
CD45EE7C18DC2D5800FB50C0 /* app in Resources */ = {isa = PBXBuildFile; fileRef = CD45EE7A18DC2D5800FB50C0 /* app */; };
@@ -21,6 +22,8 @@
2122
dstPath = "";
2223
dstSubfolderSpec = 10;
2324
files = (
25+
39940D9122C4EF600050DDE1 /* NativeScript.xcframework in Embed Frameworks */,
26+
39940E1C22C5DFFF0050DDE1 /* TKLiveSync.xcframework in Embed Frameworks */,
2427
);
2528
name = "Embed Frameworks";
2629
runOnlyForDeploymentPostprocessing = 0;
@@ -32,6 +35,8 @@
3235
391174B721F1D99900BA2583 /* plugins-release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "plugins-release.xcconfig"; sourceTree = SOURCE_ROOT; };
3336
391174B821F1D99900BA2583 /* plugins-debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "plugins-debug.xcconfig"; sourceTree = SOURCE_ROOT; };
3437
39940D8122C4E84C0050DDE1 /* __PROJECT_NAME__.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = __PROJECT_NAME__.entitlements; sourceTree = "<group>"; };
38+
39940D8C22C4EAAA0050DDE1 /* NativeScript.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = NativeScript.xcframework; path = internal/NativeScript.xcframework; sourceTree = "<group>"; };
39+
39940E1B22C5DFFF0050DDE1 /* TKLiveSync.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = TKLiveSync.xcframework; path = internal/TKLiveSync.xcframework; sourceTree = "<group>"; };
3540
42C751E2232B769100186695 /* nativescript-pre-link */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "nativescript-pre-link"; path = "internal/nativescript-pre-link"; sourceTree = SOURCE_ROOT; };
3641
42C751E3232B769100186695 /* strip-dynamic-framework-architectures.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = "strip-dynamic-framework-architectures.sh"; path = "internal/strip-dynamic-framework-architectures.sh"; sourceTree = SOURCE_ROOT; };
3742
42C751E4232B769100186695 /* nsld.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = nsld.sh; path = internal/nsld.sh; sourceTree = SOURCE_ROOT; };
@@ -58,7 +63,6 @@
5863
isa = PBXFrameworksBuildPhase;
5964
buildActionMask = 2147483647;
6065
files = (
61-
AA10000000000000000000C1 /* NativeScript in Frameworks */,
6266
);
6367
runOnlyForDeploymentPostprocessing = 0;
6468
};
@@ -111,6 +115,8 @@
111115
858B833018CA111C00AB12DE /* Frameworks */ = {
112116
isa = PBXGroup;
113117
children = (
118+
39940E1B22C5DFFF0050DDE1 /* TKLiveSync.xcframework */,
119+
39940D8C22C4EAAA0050DDE1 /* NativeScript.xcframework */,
114120
);
115121
name = Frameworks;
116122
sourceTree = "<group>";
@@ -170,9 +176,6 @@
170176
dependencies = (
171177
);
172178
name = __PROJECT_NAME__;
173-
packageProductDependencies = (
174-
AA10000000000000000000B1 /* NativeScript */,
175-
);
176179
productName = JDBridgeApp;
177180
productReference = 858B843318CA22B800AB12DE /* __PROJECT_NAME__.app */;
178181
productType = "com.apple.product-type.application";
@@ -203,9 +206,6 @@
203206
Base,
204207
);
205208
mainGroup = 858B832518CA111C00AB12DE;
206-
packageReferences = (
207-
AA10000000000000000000A1 /* XCRemoteSwiftPackageReference "ios-spm" */,
208-
);
209209
productRefGroup = 858B832F18CA111C00AB12DE /* Products */;
210210
projectDirPath = "";
211211
projectRoot = "";
@@ -498,25 +498,6 @@
498498
defaultConfigurationName = Release;
499499
};
500500
/* End XCConfigurationList section */
501-
502-
/* Begin XCRemoteSwiftPackageReference section */
503-
AA10000000000000000000A1 /* XCRemoteSwiftPackageReference "ios-spm" */ = {
504-
isa = XCRemoteSwiftPackageReference;
505-
repositoryURL = "https://github.com/NativeScript/ios-spm.git";
506-
requirement = {
507-
kind = exactVersion;
508-
version = "__NS_RUNTIME_VERSION__";
509-
};
510-
};
511-
/* End XCRemoteSwiftPackageReference section */
512-
513-
/* Begin XCSwiftPackageProductDependency section */
514-
AA10000000000000000000B1 /* NativeScript */ = {
515-
isa = XCSwiftPackageProductDependency;
516-
package = AA10000000000000000000A1 /* XCRemoteSwiftPackageReference "ios-spm" */;
517-
productName = NativeScript;
518-
};
519-
/* End XCSwiftPackageProductDependency section */
520501
};
521502
rootObject = 858B832618CA111C00AB12DE /* Project object */;
522503
}

project-template-ios/internal/nativescript-build.xcconfig

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
// * NativeScript build related flags
22
// * Add [sdk=*] after each one to avoid conflict with CocoaPods flags
3-
// * NativeScript + TKLiveSync are provided by the SwiftPM "NativeScript" product
4-
// * (github.com/NativeScript/ios-spm), so SwiftPM links/embeds them automatically.
5-
// * The explicit -framework NativeScript / -framework TKLiveSync / -F internal are
6-
// * intentionally omitted. SwiftPM stages the resolved framework slice into
7-
// * CONFIGURATION_BUILD_DIR (below), which is where the metadata generator finds it.
8-
OTHER_LDFLAGS[sdk=*] = $(inherited) -ObjC -sectcreate __DATA __TNSMetadata "$(CONFIGURATION_BUILD_DIR)/metadata-$(CURRENT_ARCH).bin" -licucore -lz -lc++ -framework Foundation -framework UIKit -framework CoreGraphics -framework CoreServices -framework Security
3+
OTHER_LDFLAGS[sdk=*] = $(inherited) -ObjC -sectcreate __DATA __TNSMetadata "$(CONFIGURATION_BUILD_DIR)/metadata-$(CURRENT_ARCH).bin" -framework NativeScript -framework TKLiveSync -F"$(SRCROOT)/internal" -licucore -lz -lc++ -framework Foundation -framework UIKit -framework CoreGraphics -framework CoreServices -framework Security
94

105
// We need to add CONFIGURATION_BUILD_DIR here so that we can explicitly quote-escape any paths in it, because the implicitly added path by Xcode is not always escaped
116
FRAMEWORK_SEARCH_PATHS[sdk=*] = $(inherited) "$(SRCROOT)/internal/" "$(CONFIGURATION_BUILD_DIR)"

0 commit comments

Comments
 (0)