Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tayloraswift/swift-install-action
install the swift compiler for linux ci
https://github.com/tayloraswift/swift-install-action
swift
Last synced: 16 days ago
JSON representation
install the swift compiler for linux ci
- Host: GitHub
- URL: https://github.com/tayloraswift/swift-install-action
- Owner: tayloraswift
- Created: 2024-08-25T21:02:10.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2024-09-18T03:46:13.000Z (about 2 months ago)
- Last Synced: 2024-09-18T06:29:49.579Z (about 2 months ago)
- Topics: swift
- Homepage:
- Size: 14.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Swift installation action
Supported runners:
- macOS
- LinuxIf the action completes successfully, it sets the environment variable `SWIFT_INSTALLATION` to the path to the toolchain resources. This is the directory that would normally be named `usr` in a Swift installation.
### Configuration
Other GitHub actions that install the Swift toolchain tend to suffer from deployment lag when new versions of Swift are released. This action is designed to be more flexible and to allow installing toolchains by speculatively building a URL.
The action requires two inputs, `swift-prefix` and `swift-id`. Their values should be destructured from the URL of the Swift toolchain download like this:
#### macOS
```bash
'https://download.swift.org/' swift-prefix '/' swift-id '-osx.pkg'
```#### Linux (all distributions)
```bash
'https://download.swift.org/' swift-prefix '/' swift-id '.tar.gz'
```## Usage examples
### Ubuntu 24.04 with Swift 6.0
```yaml
linux:
runs-on: ubuntu-24.04
name: Ubuntu 24.04steps:
- name: Install Swift
uses: tayloraswift/swift-install-action@master
with:
swift-prefix: "swift-6.0-release/ubuntu2404/swift-6.0-RELEASE"
swift-id: "swift-6.0-RELEASE-ubuntu24.04"- name: Check Swift
run: swift --version
```### macOS with Swift 6.0
```yaml
macos:
runs-on: macos-14
name: macOSsteps:
- name: Install Swift
uses: tayloraswift/swift-install-action@master
with:
swift-prefix: "swift-6.0-release/xcode/swift-6.0-RELEASE"
swift-id: "swift-6.0-RELEASE"- name: Check Swift
run: swift --version
```Please note, on macOS, the `swift-id` does not include a distribution name.