-
Notifications
You must be signed in to change notification settings - Fork 1
Publish repository artifacts #14
Comments
GitHub announced support for Swift as part of the Package Registry in June 2019: ...but from these links it looks like implementation is still in-progress:
@aaronbrethorst @ualch9 Do you know anything about https://swiftpackageregistry.com/? It's mentioned towards the end of the link in the 2nd bullet above. |
Oh, actually looks like https://swiftpackageregistry.com/ doesn't host artifacts, it's just a registry for packages hosted elsewhere, so that doesn't help. FWIW, clicking through the top packages registered there, all of them I looked at hosted the Swift package files in the same GitHub repo as the project. |
If we do host within the same repo here, one potential way to avoid a huge issue with binaries in version control is to only publish updates to the Swift package when tagging a new release (not every commit to @ualch9 would the above work with Swift packages, to your knowledge? You mentioned something about needing to update on every commit previously. |
I was thinking, we can just upload a zip file to the GitHub Releases tab. |
@ualch9 I'm not sure I understand where the zip file comes in. Do you mean that looking at https://github.com/ualch9/opentripplanner-library-swift/blob/main/Package.swift, we would replace the So from: // swift-tools-version:5.3
import PackageDescription
let package = Package(
name: "OpenTripPlannerClientLibrary",
platforms: [
.iOS(.v13)
],
products: [
.library(
name: "OpenTripPlannerClientLibrary",
targets: ["OpenTripPlannerClientLibrary"]
),
],
targets: [
.binaryTarget(
name: "OpenTripPlannerClientLibrary",
path: "./OpenTripPlannerClientLibrary.xcframework" // <- This changes to a zip file?
),
]
) ...to: // swift-tools-version:5.3
import PackageDescription
let package = Package(
name: "OpenTripPlannerClientLibrary",
platforms: [
.iOS(.v13)
],
products: [
.library(
name: "OpenTripPlannerClientLibrary",
targets: ["OpenTripPlannerClientLibrary"]
),
],
targets: [
.binaryTarget(
name: "OpenTripPlannerClientLibrary",
path: "https://github.com/ualch9/opentripplanner-library-swift/releases/download/0.5/opentripplanner-library-swift-main.zip"
),
]
) |
After reading https://developer.apple.com/documentation/xcode/creating_a_standalone_swift_package_with_xcode, I think it would use ...
targets: [
.binaryTarget(
name: "OpenTripPlannerClientLibrary",
url: "https://github.com/ualch9/opentripplanner-library-swift/releases/download/0.5/opentripplanner-library-swift-main.zip"
),
]
... |
Yes, although I believe you will also need a
.binaryTarget(
name: "PSPDFKit",
url: "https://customers.pspdfkit.com/pspdfkit/xcframework/10.3.0.zip",
checksum: "885b1564f5419f2a49fc532ed038049596def549c094d361ba772851f0327034") I will try out the url/checksum property on my machine sometime in the next day and let you know. |
@barbeau Sorry I got to this late,
The package repo now only consists of a single Package.swift file. https://github.com/ualch9/opentripplanner-library-swift Xcode defaults to using git version tags when determining which binary release to download. The screenshot shows that since |
Nice! Thanks @ualch9 for testing this! This approach should work for iOS and is something I can automate via GitHub Actions (compiling, creating zip, creating release tag), so I'll plan to follow this approach on this repo. |
Recent article for publishing Android artifacts to Maven Central: |
Is your feature request related to a problem? Please describe.
We need a place to publish the artifacts from this library:
JCenter Bintray is deprecated, so we need other options.
Describe the solution you'd like
GitHub Packages may be a solution. This would be nice for integration with CI as it would be relatively straightforward to publish from GitHub Actions.
Looks like there are GitHub guides for:
Android would be similar to Gradle with some changes for AARs vs JARs. This example from the android-maps-utils project may be useful:
I need to look more for Swift SPM examples.
Describe alternatives you've considered
Normal GitHub repo was mentioned as a possibility and showcased in a few demos online, but @ualch9 noted in #12 (comment):
Additional context
There was some discussion of Swift SPM dependencies in #7 (comment) and #7 (comment).
cc @aaronbrethorst
The text was updated successfully, but these errors were encountered: