{"id":13872488,"url":"https://github.com/swift-actions/setup-swift","last_synced_at":"2025-05-15T12:06:04.127Z","repository":{"id":36974361,"uuid":"206653632","full_name":"swift-actions/setup-swift","owner":"swift-actions","description":"GitHub Action that setup a Swift environment","archived":false,"fork":false,"pushed_at":"2025-04-29T18:38:13.000Z","size":29234,"stargazers_count":281,"open_issues_count":42,"forks_count":68,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-05T19:52:40.807Z","etag":null,"topics":["ci","github-actions","setup-swift","swift"],"latest_commit_sha":null,"homepage":"","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/swift-actions.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2019-09-05T20:40:25.000Z","updated_at":"2025-05-05T15:36:21.000Z","dependencies_parsed_at":"2024-01-16T09:55:52.094Z","dependency_job_id":"192eefa9-ad79-49b6-9104-3b5a855cc075","html_url":"https://github.com/swift-actions/setup-swift","commit_stats":{"total_commits":413,"total_committers":18,"mean_commits":"22.944444444444443","dds":0.4334140435835351,"last_synced_commit":"65540b95f51493d65f5e59e97dcef9629ddf11bf"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swift-actions%2Fsetup-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swift-actions%2Fsetup-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swift-actions%2Fsetup-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swift-actions%2Fsetup-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swift-actions","download_url":"https://codeload.github.com/swift-actions/setup-swift/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254337613,"owners_count":22054253,"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":["ci","github-actions","setup-swift","swift"],"created_at":"2024-08-05T23:00:44.464Z","updated_at":"2025-05-15T12:05:59.112Z","avatar_url":"https://github.com/swift-actions.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Setup Swift\n\u003cp\u003e\n  \u003ca href=\"https://github.com/features/actions\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/GitHub-Action-blue?logo=github\" alt=\"GitHub Action\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://help.github.com/en/actions/automating-your-workflow-with-github-actions/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/platform-macOS%20%7C%20Ubuntu%20%7C%20Windows-lightgray\" alt=\"Supports macOS, Ubuntu \u0026 Windows\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://swift.org\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Swift-6.0.2-F05138?logo=swift\u0026logoColor=white\" alt=\"Swift 6.1.0\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/swift-actions/setup-swift/releases/latest\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/v/release/swift-actions/setup-swift?sort=semver\" alt=\"Latest release\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n[GitHub Action](https://github.com/features/actions) that will setup a [Swift](https://swift.org) environment with a specific version. Works on both Ubuntu and macOS runners.\n\n## Usage\n\nTo run the action with the latest swift version available, simply add the action as a step in your workflow:\n\n```yaml\n- uses: swift-actions/setup-swift@v2\n```\n\nAfter the environment is configured you can run swift 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```yaml\n- uses: swift-actions/setup-swift@v2\n- name: Get swift version\n  run: swift --version # Swift 6.1.0\n```\n\nA specific Swift version can be set using the `swift-version` input:\n\n```yaml\n- uses: swift-actions/setup-swift@v2\n  with:\n    swift-version: \"5.1.0\"\n- name: Get swift version\n  run: swift --version # Swift 5.1.0\n```\n\nWorks perfect together with matrixes: \n\n```yaml\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: swift-actions/setup-swift@v2\n  with:\n    swift-version: ${{ matrix.swift }}\n- name: Get swift version\n  run: swift --version\n```\n\n## Note about versions\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\n\nIn other words specifying...\n- `\"5.1.0\"` will resolve to version `5.1`\n- `\"5.1\"` will resolve to latest patch version (aka `5.1.1`)\n- `\"5\"` will resolve to latest minor and patch version (aka `5.10`)\n\n### Caveats\n\nYAML interprets eg. `5.0` as a float, this action will then interpret that as `5` which will result in eg. Swift 5.5 being resolved. Quote your inputs! Thus:\n\n```\n- uses: swift-actions/setup-swift@v2\n  with:\n    swift-version: '5.0'\n```\n\nNot:\n\n```\n- uses: swift-actions/setup-swift@v2\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 you define a specific version (like `v2.0.1`) or use the major version tag (like `v2`).\n\n### Specific version\n\nWe recommend using 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. That way you will automatically get notifed when the action updates and you can read the changelog directly in the PR opened by dependabot.\n\n### Major version tag\n\nIf you don't plan on keeping tabs on updates or don't want to use Dependabot but still would like to always use the latest version, you can use the main version tag.\n\n## Legal\nUses MIT license. \nThe Swift logo is a trademark of Apple Inc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswift-actions%2Fsetup-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswift-actions%2Fsetup-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswift-actions%2Fsetup-swift/lists"}