Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

Commit 8ceb052

Browse files
committed
Add a hidden flag to output the zip file location to .build/xcframework-zipfile.url
1 parent a5e5c70 commit 8ceb052

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Sources/CreateXCFramework/Command+Options.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ extension Command {
4545

4646
@Option(help: ArgumentHelp("The version number to append to the name of the zip file\n\nIf the target you are packaging is a dependency, swift-create-xcframework will look into the package graph and locate the version number the dependency resolved to. As there is no standard way to specify the version inside your Swift Package, --zip-version lets you specify it manually.", valueName: "version"))
4747
var zipVersion: String?
48+
49+
@Flag(help: .hidden)
50+
var githubAction: Bool
4851

4952

5053
// MARK: - Targets

Sources/CreateXCFramework/Zipper.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ struct Zipper {
4646
case let .signalled(signal: signal):
4747
throw XcodeBuilder.Error.signalExit(signal)
4848
}
49+
50+
// notify the action if we have one
51+
if self.package.options.githubAction {
52+
let data = Data(zipURL.path.utf8)
53+
let url = Foundation.URL(fileURLWithPath: self.package.options.buildPath).appendingPathComponent("xcframework-zipfile.url")
54+
try data.write(to: url)
55+
}
4956
}
5057

5158
private func zipCommand (source: Foundation.URL, target: Foundation.URL) -> [String] {

0 commit comments

Comments
 (0)