step-security/Setup Swift environment for macOS, Linux and Windows

Setup Swift environment by optionally downloading and adding it to the PATH.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Stale
License
None
namedescriptionrequireddefault
swift-versionSwift version to configure, accepts valid semantic version, "latest", "current". Configures latest version for open ended semantic version provided, i.e. configures 5.1.1 for 5.1, configures 4.2.4 for 4. Provide exact semantic version to configure the same version, i.e. configures 5.1 for 5.1.0, configures 5.0 for 5.0.0. Provide toolchain download URL to configure custom toolchains, i.e. https://github.com/swiftwasm/swift/releases/download/swift-wasm-5.10-SNAPSHOT-2024-03-30-a/swift-wasm-5.10-SNAPSHOT-2024-03-30-a-ubuntu22.04_x86_64.tar.gz, https://github.com/swiftwasm/swift/releases/download/swift-wasm-5.10-SNAPSHOT-2024-03-30-a/swift-wasm-5.10-SNAPSHOT-2024-03-30-a-macos_x86_64.pkgnolatest
developmentWhether to include development snapshots matching provided version, not required if provided version has no stable release.nofalse
check-latestWhether to use latest Swift toolchains available in swift.org, instead of using the snapshot this action was tested with. Enabling this option may break this action, use cautiously and disable if any issue. Specific git ref for apple/swift-org-website repo can be provided, to use toolchains published in that ref.nofalse
dry-runWhether to only get the toolchain data based on version input and skip intallation. Can be used with actions that perform custom installations, i.e. using docker tag in Linux.nofalse
cache-snapshotWhether to cache downloaded toolchain snapshots. Enabled by default, can be disabled in case of storage constraints.notrue
visual-studio-componentsSemi-colon separated list of components to include in the Visual Studio installation along with required ones. i.e. Microsoft.VisualStudio.Component.VC.ATL;Microsoft.VisualStudio.Component.VC.CMake.Project;Microsoft.VisualStudio.Component.Windows10SDKno""
prefer-oss-toolchainWhether to prefer installing Swift open source toolchain over using Xcode integrated toolchain. This is always assumed `true` if `sdks` input is specified. i.e. Enable this option for installing static SDK: https://www.swift.org/documentation/articles/static-linux-getting-started.htmlnofalse
prefer-visual-studio-linkerWhether to prefer using the Visual Studio linker over the default linker. This is unsafe and not recommended to set. If you are getting any linker errors with this option, try setting `update-sdk-modules` to `true`.nofalse
update-sdk-modulesUpdate SDK module definitions to latest version after installation (Windows only).nofalse
sdksSemi-colon separated list of Swift SDKs to install along with the main toolchain. Available SDKs are based on platforms available for the specified version. Examples: "static-linux", "static-linux;wasm", "static-linux;wasm;android".no""
namedescription
swift-versionThe actual Swift version that was configured.
toolchainJSON formatted toolchain snapshot metadata that was configured.
sdksJSON formatted SDK snapshots metadata that were configured.