{"id":16829832,"url":"https://github.com/mxcl/get-swift-version","last_synced_at":"2025-04-11T04:10:19.835Z","repository":{"id":49206184,"uuid":"379646764","full_name":"mxcl/get-swift-version","owner":"mxcl","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-22T11:03:21.000Z","size":125,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T02:12:14.583Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mxcl.png","metadata":{"funding":{"github":"mxcl","patreon":"mxcl"},"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-06-23T15:19:58.000Z","updated_at":"2024-11-04T17:29:40.000Z","dependencies_parsed_at":"2024-02-22T12:25:20.451Z","dependency_job_id":"8c8945a5-5eaf-491c-9ef4-e33100fabdfd","html_url":"https://github.com/mxcl/get-swift-version","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxcl%2Fget-swift-version","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxcl%2Fget-swift-version/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxcl%2Fget-swift-version/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxcl%2Fget-swift-version/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mxcl","download_url":"https://codeload.github.com/mxcl/get-swift-version/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248339224,"owners_count":21087215,"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":[],"created_at":"2024-10-13T11:35:56.141Z","updated_at":"2025-04-11T04:10:19.803Z","avatar_url":"https://github.com/mxcl.png","language":"JavaScript","funding_links":["https://github.com/sponsors/mxcl","https://patreon.com/mxcl"],"categories":[],"sub_categories":[],"readme":"# mxcl/get-swift-version\n\nA multiplatform action to extract the active Swift version into various step outputs.\n\n## [Sponsor @mxcl](https://github.com/sponsors/mxcl)\n\nI can only afford to maintain projects I need or that are sponsored. Thanks.\n\n## Usage\n\n```yaml\njobs:\n  my-job:\n    runs-on: ubuntu-latest\n    steps:\n      - use: mxcl/get-swift-version@v1\n        id: swift\n      - run: echo ${{ steps.swift.outputs.version }}\n      - run: echo ${{ steps.swift.outputs.major-version }}\n      - run: echo ${{ steps.swift.outputs.minor-version }}\n      - run: echo ${{ steps.swift.outputs.patch-version }}\n      - run: echo ${{ steps.swift.outputs.marketing-version }}\n```\n\nWill output:\n\n```\n5.4.1\n5\n4\n1\n5.4\n```\n\n## Enforce Swift Version\n\nOptionally this action can enforce an expected Swift version:\n\n```yaml\njobs:\n  my-job:\n    runs-on: ubuntu-latest\n    steps:\n      - use: mxcl/get-swift-version@v1\n        with:\n          requires: ~5.4  # a semantically versioned constraint\n```\n\nIf the Swift version is not \u003e=5.4 and \u003c 5.5 the action will fail.\n\n# Suggested with `actions/cache`\n\n```yaml\n- uses: mxcl/get-swift-version@v1\n  id: swift\n- uses: actions/cache@v2\n  with:\n    path: .build\n    key: ${{ runner.os }}-swift-${{ steps.swift.outputs.marketing-version }}-${{ hashFiles('Package.resolved') }}\n    restore-keys: ${{ runner.os }}-swift-${{ steps.swift.outputs.marketing-version }}\n  if: ${{ steps.swift.outputs.marketing-version \u003e 5.1 }}\n```\n\nWith Swift \u003e=5.5 this will save you quite a bit of build time while ensuring major changes\nto the build files formats with new marketing versions will not break your CI.\n\n# The `marketing-version` is more useful than you think\n\n```yaml\njobs:\n  my-job:\n    runs-on: ubuntu-latest\n    steps:\n      - use: mxcl/get-swift-version@v1\n        id: swift\n      - run: echo ARGS=--enable-code-coverage \u003e\u003e $GITHUB_ENV\n        if: ${{ steps.swift.outputs.marketing-version \u003e 5.1 }}\n```\n\nBecause `marketing-version` is always “floaty”, GHA can do a numeric comparison operator on it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmxcl%2Fget-swift-version","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmxcl%2Fget-swift-version","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmxcl%2Fget-swift-version/lists"}