{"id":24840396,"url":"https://github.com/swiftylab/setup-swift","last_synced_at":"2025-07-13T09:39:42.307Z","repository":{"id":190467972,"uuid":"682598836","full_name":"SwiftyLab/setup-swift","owner":"SwiftyLab","description":"GitHub Action to setup Swift environment","archived":false,"fork":false,"pushed_at":"2025-07-01T09:47:11.000Z","size":4571,"stargazers_count":15,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-06T20:18:07.912Z","etag":null,"topics":["action","actions","ci","github-actions","setup-swift","setup-swift-action","swift","swift-package-manager","swift-server","swift-windows"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/setup-swift-environment-for-macos-linux-and-windows","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SwiftyLab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["soumyamahunt"],"patreon":null,"open_collective":"soumyamahunt","ko_fi":"soumyamahunt","tidelift":null,"community_bridge":null,"liberapay":"soumyamahunt","issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-08-24T14:11:50.000Z","updated_at":"2025-07-01T08:55:20.000Z","dependencies_parsed_at":"2023-10-10T13:31:42.251Z","dependency_job_id":"9be42ea9-515a-41c5-bb54-a8ea8119c6b4","html_url":"https://github.com/SwiftyLab/setup-swift","commit_stats":null,"previous_names":["swiftylab/setup-swift"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/SwiftyLab/setup-swift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftyLab%2Fsetup-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftyLab%2Fsetup-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftyLab%2Fsetup-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftyLab%2Fsetup-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SwiftyLab","download_url":"https://codeload.github.com/SwiftyLab/setup-swift/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftyLab%2Fsetup-swift/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265121396,"owners_count":23714503,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["action","actions","ci","github-actions","setup-swift","setup-swift-action","swift","swift-package-manager","swift-server","swift-windows"],"created_at":"2025-01-31T06:56:11.352Z","updated_at":"2025-07-13T09:39:42.301Z","avatar_url":"https://github.com/SwiftyLab.png","language":"TypeScript","readme":"# Setup Swift\n\n[![GitHub Action](https://img.shields.io/github/v/tag/SwiftyLab/setup-swift?logo=github\u0026label=GitHub)](https://github.com/marketplace/actions/setup-swift-environment-for-macos-linux-and-windows)\n[![Supports macOS, Linux \u0026 Windows](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-blue?label=platform)](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources)\n[![CI/CD](https://github.com/SwiftyLab/setup-swift/actions/workflows/main.yml/badge.svg)](https://github.com/SwiftyLab/setup-swift/actions/workflows/main.yml)\n[![CodeFactor](https://www.codefactor.io/repository/github/swiftylab/setup-swift/badge)](https://www.codefactor.io/repository/github/swiftylab/setup-swift)\n[![codecov](https://codecov.io/gh/SwiftyLab/setup-swift/graph/badge.svg?token=XWfSpWQ6gC)](https://codecov.io/gh/SwiftyLab/setup-swift)\n[![Get it from Marketplace](https://img.shields.io/badge/Get_it-from_Marketplace-blue?logo=github)](https://github.com/marketplace/actions/setup-swift-environment-for-macos-linux-and-windows)\n\n[GitHub Action](https://github.com/features/actions) that will setup [Swift](https://swift.org) environment with specified version.\nThis action supports the following functionalities:\n\n- Works on Linux, macOS and Windows across all architectures.\n- Supports [installing latest major/minor/patch](#specifying-version).\n- Provides snapshots as soon as published in `swift.org`.\n- Verifies toolchain snapshots before installation (`gpg` for Linux and Windows, `pkgutil` for macOS) .\n- Allows development snapshots by enabling `development` flag and optional version.\n- Prefers existing Xcode installations.\n- Caches installed setup in tool cache and actions cache(Swift 5.10 and after does not support caching on Windows).\n- Allows fetching snapshot metadata without installation (can be used to setup docker images).\n\n## Latest supported toolchains\n\n| Release Type | Latest Available |\n|--------------|------------------|\n| Stable | [![Latest Release](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fswiftylab.github.io%2Fsetup-swift%2Fmetadata.json\u0026query=%24.release.name\u0026logo=swift\u0026logoColor=white\u0026label=Swift\u0026color=orange)](https://www.swift.org/download/#releases)\u003cbr/\u003e[![Latest Release Tag](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fswiftylab.github.io%2Fsetup-swift%2Fmetadata.json\u0026query=%24.release.tag\u0026logo=swift\u0026logoColor=white\u0026label=tag\u0026color=orange)](https://www.swift.org/download/#releases) |\n| Development | [![Latest Development Snapshot](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fswiftylab.github.io%2Fsetup-swift%2Fmetadata.json\u0026query=%24.dev.name\u0026logo=swift\u0026logoColor=white\u0026label=Swift\u0026color=orange)](https://www.swift.org/download/#snapshots)\u003cbr/\u003e[![Latest Development Snapshot Tag](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fswiftylab.github.io%2Fsetup-swift%2Fmetadata.json\u0026query=%24.dev.tag\u0026logo=swift\u0026logoColor=white\u0026label=tag\u0026color=orange)](https://www.swift.org/download/#snapshots)\u003cbr/\u003e[![Latest Development Snapshot Date](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fswiftylab.github.io%2Fsetup-swift%2Fmetadata.json\u0026query=%24.dev.date\u0026logo=swift\u0026logoColor=white\u0026label=date)](https://www.swift.org/download/#snapshots) |\n| Trunk Development | [![Latest Trunk Development Snapshot Tag](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fswiftylab.github.io%2Fsetup-swift%2Fmetadata.json\u0026query=%24.snapshot.tag\u0026logo=swift\u0026logoColor=white\u0026label=tag\u0026color=orange)](https://www.swift.org/download/#snapshots)\u003cbr/\u003e[![Latest Trunk Development Snapshot Date](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fswiftylab.github.io%2Fsetup-swift%2Fmetadata.json\u0026query=%24.snapshot.date\u0026logo=swift\u0026logoColor=white\u0026label=date)](https://www.swift.org/download/#snapshots) |\n\n## Usage\n\nTo run the action with the latest stable release swift version available, simply add the action as a step in your workflow:\n\n```yml\n- uses: SwiftyLab/setup-swift@latest\n```\n\nOr use the latest development snapshots by enabling the `development` flag:\n\n```yml\n- uses: SwiftyLab/setup-swift@latest\n  with:\n    development: true\n```\n\nAfter the environment is configured you can run swift and xcode commands using the standard [`run`](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsrun) step:\n\n```yml\n- uses: SwiftyLab/setup-swift@latest\n- name: Get swift version\n  run: swift --version\n- name: Get swift version in macOS\n  if: runner.os == 'macOS'\n  run: xcrun --toolchain ${{ env.TOOLCHAINS }} swift --version\n```\n\nA specific Swift version can be set using the `swift-version` input, [see the format](#specifying-version):\n\n```yml\n- uses: SwiftyLab/setup-swift@latest\n  with:\n    swift-version: \"5.1.0\"\n- name: Get swift version\n  run: swift --version # Swift 5.1.0\n- name: Get swift version in macOS\n  if: runner.os == 'macOS'\n  run: xcrun --toolchain ${{ env.TOOLCHAINS }} swift --version # Swift 5.1.0\n```\n\nWorks perfect together with job matrixes:\n\n```yml\nname: Swift ${{ matrix.swift }} on ${{ matrix.os }}\nruns-on: ${{ matrix.os }}\nstrategy:\n  matrix:\n    os: [ubuntu-latest, macos-latest]\n    swift: [\"5.4.3\", \"5.2.4\"]\nsteps:\n- uses: SwiftyLab/setup-swift@latest\n  with:\n    swift-version: ${{ matrix.swift }}\n- name: Get swift version\n  run: swift --version\n```\n\n**See [action.yml](action.yml) for complete list of inputs and outputs, see [wiki](https://github.com/SwiftyLab/setup-swift/wiki) for inner workings of this action.**\n\n## Specifying version\n\nThis project uses strict semantic versioning to determine what version of Swift to configure. This differs slightly from the official convention used by Swift.\n\nFor example, Swift is available as version `5.1` but using this as value for `swift-version` will be interpreted as a version _range_ of `5.1.X` where `X` is the latest patch version available for that major and minor version.\n\nIn other words specifying...\n\n- `\"5.1\"` will resolve to latest patch version (aka `5.1.5`)\n- `\"5.1.0\"` will resolve to version `5.1`\n- `\"4\"` will resolve to latest minor and patch version (aka `4.2.4`)\n- `\"4.0.0\"` will resolve to version `4.0`\n\n\u003cdetails\u003e\n  \u003csummary\u003eAdditionally, to use custom toolchains, download URL can be provided. The download URL must point to a `tar` archive for `Linux`, `pkg` file for `macOS` and `exe` file for `Windows`.\u003c/summary\u003e\n\n  i.e. for `macOS`: 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.pkg\n  for `Linux`: 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\n\n  \u003e [!IMPORTANT]\n  \u003e When using custom toolchains, please ensure that the toolchain can be installed and used on the GitHub runner, this action won't be able to validate this for custom toolchains.\n\u003c/details\u003e\n\n### Caveats\n\nYAML interprets eg. `4.0` as a float, this action will then interpret that as `4` which will result in eg. Swift `4.2.4` being resolved. Quote your inputs! Thus surround version input with quotations:\n\n```yml\n- uses: SwiftyLab/setup-swift@v1\n  with:\n    swift-version: '5.0'\n```\n\nNot:\n\n```yml\n- uses: SwiftyLab/setup-swift@v1\n  with:\n    swift-version: 5.0\n```\n\n## Keeping the action up-to-date\n\nYou have two options for keeping this action up-to-date: either use the `latest` tag to always have the latest changes or define a specific version (like `v1.0.0`).\n\n### Latest version tag (Recommended)\n\nYou can use the `latest` tag to always have the latest changes. This action is updated automatically as soon as new toolchain snapshots are published in [swift.org](https://github.com/apple/swift-org-website), by using the `latest` tag you have access to these data automagically.\n\n### Specific version\n\nYou can the specific version tag together with [Dependabot](https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/about-dependabot-version-updates) to keep the action up-to-date. You will automatically get notifed when the action updates and you can read the changelog directly in the PR opened by dependabot.\n\n## License\n\n`setup-swift` is released under the MIT license. [See LICENSE](LICENSE) for details.\nThe Swift logo is a trademark of Apple Inc.\n","funding_links":["https://github.com/sponsors/soumyamahunt","https://opencollective.com/soumyamahunt","https://ko-fi.com/soumyamahunt","https://liberapay.com/soumyamahunt"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftylab%2Fsetup-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswiftylab%2Fsetup-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftylab%2Fsetup-swift/lists"}