Skip to content
Soumya Ranjan Mahunt edited this page Apr 1, 2024 · 4 revisions

Welcome to the setup-swift wiki! Your one stop for frequent questions and details about this action.

Basic Workings

This action uses swift.org repo to get toolchains version data to compare with user provided version inputs. Specific commit id stored in GitHub pages metadata is used for fetching swift.org repo. This commit id can be overridden with providing custom commit hash, branch name, tag or any other git ref in the check-latest option, or just providing true will fetch the latest commit in default branch.

The GitHub pages metadata is updated if new changes published in swift.org repo that don't break this action, the CI of this action takes care of this update and testing if any breaking changes automatically.

FAQs

What does check‐latest actually do?

This action parses the content of swift.org repo for latest toolchains, which allows no manual interference to add support for newly published toolchains as long as there is no breaking change.

The limitation with having only this approach is as soon as a braking change introduced in swift.org repo toolchain format, this action would have broken. Hence this action keeps a specific snapshot of swift.org repo that is tested exhaustively with the CI of this action and used for parsing toolchains data. This snapshot is also updated daily after passing all the requirements.

check-latest flag allows you to circumvent this, if set as true this action takes the latest snapshot instead of using the pre-saved snapshot, or providing specific git ref in this option will use that specific ref instead of the pre-saved snapshot. For example, if the swift.org snapshot this action uses has Swift 5.9.2 as the stable toolchain, and latest toolchain available in swift.org is Swift 5.10, with check-latest enabled the latest published Swift 5.10 in swift.org can be installed by this action.

Caution

Enabling check-latest comes at a cost of breaking actions if there is a breaking change in swift.org.

Why GitHub pages has 404 error?

This action only stores swift.org repo latest supported commit hash metadata in GitHub pages metadata.json file. There is no other usage of GitHub pages by this action, no static site is hosted in GitHub pages.

Clone this wiki locally