gha-setup-swift
gha-setup-swift copied to clipboard
Confusing options
If I give a tag name, what is the branch name used for (and vice-versa)? Either one uniquely identifies a release. Please clarify in the README.
Oh, yeah… I don't know how to fix the README for the semantics you've got, but branch is not a branch name and tag is not a tag name. For 5.9 the branch would be release/5.9 and the tag would be swift-5.9-RELEASE but what I actually have to pass is something like
branch: swift-5.9-release
tag: 5.9-RELEASE
Perhaps the option names are poor, naming is difficult! I'm open to renaming the options in a backwards compatible manner. The names themselves are references to the URL:
https://download.swift.org/development/windows10/swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a/swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a-windows10.exe
which appears to be:
https://download.swift.org/[branch]/[host]/[tag]/[tag]-[host][suffix]
In the ideal scenario, we would be able to use just the release version and or snapshot (for a release train or stable train) as a single parameter and derive everything from that.
BTW, the tag terminology is also on the download page as well.
We should really discuss how to fix this. I just came back here and find myself opting for https://github.com/SwiftyLab/setup-swift/ because I can't figure out what these instructions mean. Presumably your Windows support is better, but at least for simple use cases I totally understand how to use the other one.
i have also found this extremely frustrating although the problem is hardly limited to this particular project. identifying toolchains is hard.
Clearly doesn't have to be this hard. The swiftylab component makes it trivial. Anyone could implement the same API.
Continuing from https://github.com/swift-actions/setup-swift/issues/634#issuecomment-1980787840
@compnerd wrote:
I know that you are frustrated by those options, but they are what apple uses. I'm happy to rename them, but we need the two parameters (or at least a way to derive the two). compnerd/gha-setup-swift does work on other platforms as well, and is much easier to evolve when working with the Windows platform. I don't mind co-maintaining an action if it is designed to take the needs for evolving the Windows support in mind.
Well, the names are confusing, but even if you do that there needs to be
- a clear explanation of what the names mean, i.e. what they map to in the Swift repository, and
- most especially, for the vast majority out there who only want to use released versions of Swift, how to go from an official version number to these settings.
Ideally, though (and you really need to do this if you want uptake of usage) there would be one option you could set that would take an official number, and, if set, would be used to derive the other settings.
could this be as simple in the instructions as saying,
for an official release version X, use
with: branch: swift-${{ X }}-release tag: ${{ X }}-RELEASE
?
Yeah, I'm totally happy to have the documentation say that.