├── .github
├── CODEOWNERS
├── actions
│ └── generate-action-code
│ │ └── action.yml
├── codeql
│ └── config.yml
├── dependabot.yml
└── workflows
│ ├── codeql-analysis.yml
│ ├── deploy.yml
│ ├── enable-auto-merge.yml
│ ├── tag-update.yml
│ └── tests.yml
├── .gitignore
├── LICENSE
├── README.md
├── action.yml
├── dist
├── index.js
└── license.txt
├── package-lock.json
├── package.json
├── src
└── main.ts
└── tsconfig.json
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | # Global
2 | * @ffried
3 |
4 | # Workflow & Deployment related files
5 | .github/* @ffried
6 | action.yml @ffried
7 |
8 | # Project & Source files
9 | /*.json @ffried
10 | *.ts @ffried
11 |
--------------------------------------------------------------------------------
/.github/actions/generate-action-code/action.yml:
--------------------------------------------------------------------------------
1 | name: Generate Action Code
2 | description: Generates the action code
3 |
4 | runs:
5 | using: composite
6 | steps:
7 | - uses: actions/setup-node@v5
8 | with:
9 | node-version: 20
10 | check-latest: true
11 | cache: 'npm'
12 | - name: Generate action code
13 | shell: bash
14 | run: |
15 | npm clean-install
16 | npm run build
17 | npm run pack
18 |
--------------------------------------------------------------------------------
/.github/codeql/config.yml:
--------------------------------------------------------------------------------
1 | paths-ignore:
2 | - node_modules
3 | - dist
4 | - lib
5 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 |
3 | updates:
4 | - package-ecosystem: "github-actions"
5 | directory: "/"
6 | open-pull-requests-limit: 10
7 | schedule:
8 | interval: "daily"
9 | time: "07:00"
10 | timezone: "Europe/Berlin"
11 | assignees:
12 | - ffried
13 | reviewers:
14 | - ffried
15 | - package-ecosystem: "github-actions"
16 | directory: ".github/actions/generate-action-code"
17 | open-pull-requests-limit: 10
18 | schedule:
19 | interval: "daily"
20 | time: "07:00"
21 | timezone: "Europe/Berlin"
22 | assignees:
23 | - ffried
24 | reviewers:
25 | - ffried
26 | - package-ecosystem: "npm"
27 | directory: "/"
28 | open-pull-requests-limit: 10
29 | schedule:
30 | interval: "daily"
31 | time: "07:00"
32 | timezone: "Europe/Berlin"
33 | assignees:
34 | - ffried
35 | reviewers:
36 | - ffried
37 |
--------------------------------------------------------------------------------
/.github/workflows/codeql-analysis.yml:
--------------------------------------------------------------------------------
1 | name: CodeQL
2 |
3 | on:
4 | push:
5 | branches: [ main ]
6 | paths-ignore: [ 'dist/*.js' ]
7 | pull_request:
8 | # The branches below must be a subset of the branches above
9 | branches: [ main ]
10 | schedule:
11 | - cron: '15 11 * * 1'
12 |
13 | jobs:
14 | analyze:
15 | name: Analyze
16 | runs-on: ubuntu-latest
17 | permissions:
18 | actions: read
19 | contents: read
20 | security-events: write
21 |
22 | strategy:
23 | fail-fast: false
24 | matrix:
25 | language: [ 'javascript' ]
26 |
27 | steps:
28 | - name: Checkout repository
29 | uses: actions/checkout@v5
30 |
31 | - name: Initialize CodeQL
32 | uses: github/codeql-action/init@v3
33 | with:
34 | config-file: ./.github/codeql/config.yml
35 | languages: ${{ matrix.language }}
36 |
37 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
38 | # If this step fails, then you should remove it and run the build manually (see below)
39 | - name: Autobuild
40 | uses: github/codeql-action/autobuild@v3
41 |
42 | # ℹ️ Command-line programs to run using the OS shell.
43 | # 📚 https://git.io/JvXDl
44 |
45 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
46 | # and modify them (or add more) to build your code if your project
47 | # uses a compiled language
48 |
49 | #- run: |
50 | # make bootstrap
51 | # make release
52 |
53 | - name: Perform CodeQL Analysis
54 | uses: github/codeql-action/analyze@v3
55 |
--------------------------------------------------------------------------------
/.github/workflows/deploy.yml:
--------------------------------------------------------------------------------
1 | name: Deploy Action Code
2 |
3 | on:
4 | push:
5 | branches: [ main ]
6 | paths-ignore: [ 'dist/*.js' ]
7 |
8 | jobs:
9 | deploy-action-code:
10 | name: Deploy Action Code
11 | runs-on: ubuntu-latest
12 | steps:
13 | - uses: actions/checkout@v5
14 | with:
15 | token: ${{ secrets.BOT_TOKEN }}
16 | - uses: ./.github/actions/generate-action-code
17 | - name: Configure repository
18 | env:
19 | BOT_USERNAME: ${{ secrets.BOT_USERNAME }}
20 | run: |
21 | git config user.name "${BOT_USERNAME}"
22 | git config user.email "${BOT_USERNAME}@users.noreply.github.com"
23 | - name: Commit changes
24 | run: |
25 | if ! git diff --exit-code --quiet; then
26 | git add .
27 | git commit -m '[AUTO] Update generated code'
28 | git push
29 | fi
30 |
--------------------------------------------------------------------------------
/.github/workflows/enable-auto-merge.yml:
--------------------------------------------------------------------------------
1 | name: Auto-merge for Dependabot PRs
2 |
3 | on: pull_request
4 |
5 | permissions:
6 | contents: write
7 | pull-requests: write
8 |
9 | jobs:
10 | enable-auto-merge:
11 | runs-on: ubuntu-latest
12 | if: ${{ github.actor == 'dependabot[bot]' }}
13 | steps:
14 | - name: Enable auto-merge
15 | run: gh pr merge --auto --rebase "${PR_URL}"
16 | env:
17 | PR_URL: ${{ github.event.pull_request.html_url }}
18 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 |
--------------------------------------------------------------------------------
/.github/workflows/tag-update.yml:
--------------------------------------------------------------------------------
1 | name: Update Release Tags
2 |
3 | on:
4 | release:
5 | types: [ published ]
6 |
7 | jobs:
8 | update-tags:
9 | name: Update Running Releases
10 | runs-on: ubuntu-latest
11 | steps:
12 | - uses: actions/checkout@v5
13 | - uses: sersoft-gmbh/running-release-tags-action@v3
14 | if: ${{ github.event.release.prerelease == false }}
15 | with:
16 | update-full-release: true
17 | github-token: ${{ secrets.GITHUB_TOKEN }}
18 |
--------------------------------------------------------------------------------
/.github/workflows/tests.yml:
--------------------------------------------------------------------------------
1 | name: Tests
2 |
3 | on:
4 | push:
5 | branches: [ main ]
6 | paths:
7 | - 'dist/*.js'
8 | - '.github/workflows/tests.yml'
9 | pull_request:
10 | branches: [ main ]
11 |
12 | jobs:
13 | test-release:
14 | name: Test Release Installation
15 | strategy:
16 | matrix:
17 | swift-version: [ '5.10.1', '6.0' ]
18 | os-version: [ 'ubuntu-24.04' ]
19 | include:
20 | - swift-version: '5.9'
21 | os-version: ubuntu-22.04
22 | runs-on: ${{ matrix.os-version }}
23 | steps:
24 | - uses: actions/checkout@v5
25 | - name: Generate action code
26 | if: ${{ github.event_name == 'pull_request' }}
27 | uses: ./.github/actions/generate-action-code
28 | - uses: sersoft-gmbh/swifty-linux-action@main
29 | if: ${{ github.event_name == 'push' }}
30 | id: install-swift-main
31 | with:
32 | release-version: ${{ matrix.swift-version }}
33 | platform: ${{ matrix.os-version }}
34 | github-token: ${{ github.token }}
35 | - uses: './'
36 | if: ${{ github.event_name == 'pull_request' }}
37 | id: install-swift-local
38 | with:
39 | release-version: ${{ matrix.swift-version }}
40 | platform: ${{ matrix.os-version }}
41 | github-token: ${{ github.token }}
42 | - id: install-swift
43 | env:
44 | EVENT_NAME: ${{ github.event_name }}
45 | BRANCH_INSTALL_PATH: ${{ steps.install-swift-main.outputs.install-path }}
46 | LOCAL_INSTALL_PATH: ${{ steps.install-swift-local.outputs.install-path }}
47 | run: |
48 | if [ "${EVENT_NAME}" == 'push' ]; then
49 | echo "install-path=${BRANCH_INSTALL_PATH}" >> "${GITHUB_OUTPUT}"
50 | else
51 | echo "install-path=${LOCAL_INSTALL_PATH}" >> "${GITHUB_OUTPUT}"
52 | fi
53 | - name: Check installed path
54 | env:
55 | INSTALL_PATH: ${{ steps.install-swift.outputs.install-path }}
56 | run: test -d "${INSTALL_PATH}"
57 | - name: Check installed version
58 | env:
59 | EXPECTED_VERSION: ${{ matrix.swift-version }}
60 | run: swift --version | grep -q "${EXPECTED_VERSION}"
61 |
62 | test-branch:
63 | name: Test Branch Installation
64 | strategy:
65 | matrix:
66 | swift-version: [ '5.10.1', '6.0' ]
67 | os-version: [ 'ubuntu-24.04' ]
68 | include:
69 | - swift-version: '5.9'
70 | os-version: ubuntu-22.04
71 | runs-on: ${{ matrix.os-version }}
72 | steps:
73 | - uses: actions/checkout@v5
74 | - name: Generate action code
75 | if: ${{ github.event_name == 'pull_request' }}
76 | uses: ./.github/actions/generate-action-code
77 | - uses: sersoft-gmbh/swifty-linux-action@main
78 | if: ${{ github.event_name == 'push' }}
79 | id: install-swift-main
80 | with:
81 | branch-name: swift-${{ matrix.swift-version }}-release
82 | version-tag: swift-${{ matrix.swift-version }}-RELEASE
83 | platform: ${{ matrix.os-version }}
84 | - uses: './'
85 | if: ${{ github.event_name == 'pull_request' }}
86 | id: install-swift-local
87 | with:
88 | branch-name: swift-${{ matrix.swift-version }}-release
89 | version-tag: swift-${{ matrix.swift-version }}-RELEASE
90 | platform: ${{ matrix.os-version }}
91 | - id: install-swift
92 | env:
93 | EVENT_NAME: ${{ github.event_name }}
94 | BRANCH_INSTALL_PATH: ${{ steps.install-swift-main.outputs.install-path }}
95 | LOCAL_INSTALL_PATH: ${{ steps.install-swift-local.outputs.install-path }}
96 | run: |
97 | if [ "${EVENT_NAME}" == 'push' ]; then
98 | echo "install-path=${BRANCH_INSTALL_PATH}" >> "${GITHUB_OUTPUT}"
99 | else
100 | echo "install-path=${LOCAL_INSTALL_PATH}" >> "${GITHUB_OUTPUT}"
101 | fi
102 | - name: Check installed path
103 | env:
104 | INSTALL_PATH: ${{ steps.install-swift.outputs.install-path }}
105 | run: test -d "${INSTALL_PATH}"
106 | - name: Check installed version
107 | env:
108 | EXPECTED_VERSION: ${{ matrix.swift-version }}
109 | run: swift --version | grep -q "${EXPECTED_VERSION}"
110 |
111 | test-release-noplatform:
112 | name: Test Release Installation w/o Platform
113 | strategy:
114 | matrix:
115 | os-version: [ 'ubuntu-24.04', 'ubuntu-22.04' ]
116 | env:
117 | INPUT_SWIFT_VERSION: '6.0'
118 | runs-on: ${{ matrix.os-version }}
119 | steps:
120 | - uses: actions/checkout@v5
121 | - name: Generate action code
122 | if: ${{ github.event_name == 'pull_request' }}
123 | uses: ./.github/actions/generate-action-code
124 | - uses: sersoft-gmbh/swifty-linux-action@main
125 | if: ${{ github.event_name == 'push' }}
126 | id: install-swift-main
127 | with:
128 | release-version: ${{ env.INPUT_SWIFT_VERSION }}
129 | github-token: ${{ secrets.GITHUB_TOKEN }}
130 | - uses: './'
131 | if: github.event_name == 'pull_request'
132 | id: install-swift-local
133 | with:
134 | release-version: ${{ env.INPUT_SWIFT_VERSION }}
135 | github-token: ${{ secrets.GITHUB_TOKEN }}
136 | - id: install-swift
137 | env:
138 | EVENT_NAME: ${{ github.event_name }}
139 | BRANCH_INSTALL_PATH: ${{ steps.install-swift-main.outputs.install-path }}
140 | LOCAL_INSTALL_PATH: ${{ steps.install-swift-local.outputs.install-path }}
141 | run: |
142 | if [ "${EVENT_NAME}" == 'push' ]; then
143 | echo "install-path=${BRANCH_INSTALL_PATH}" >> "${GITHUB_OUTPUT}"
144 | else
145 | echo "install-path=${LOCAL_INSTALL_PATH}" >> "${GITHUB_OUTPUT}"
146 | fi
147 | - name: Check installed path
148 | env:
149 | INSTALL_PATH: ${{ steps.install-swift.outputs.install-path }}
150 | run: test -d "${INSTALL_PATH}"
151 | - name: Check installed version
152 | run: swift --version | grep -q "${INPUT_SWIFT_VERSION}"
153 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 |
3 | .idea/
4 |
5 | node_modules/
6 |
7 | # Lib is just temporary - so we ignore it
8 | lib/
9 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Swifty Linux Action
2 |
3 | **IMPORTANT**
4 |
5 | ⚠️ This action is deprecated! ⚠️
6 |
7 | You can either use [containers](https://hub.docker.com/_/swift), or use [Swiftly](https://www.swift.org/swiftly/documentation/swiftlydocs/).
8 | There is also a [GitHub action for Swiftly](https://github.com/vapor/swiftly-action).
9 |
10 |
11 |
12 | This action sets up a Swift environment on Linux.
13 |
14 | Note that Linux is currently the only system supported by this action. Running it on other platforms will fail.
15 |
16 | ## Inputs
17 |
18 | ### `release-version`
19 |
20 | The (released) Swift version (e.g. `6.1`) to install.
21 | If `github-token` is also set, it will automatically resolve to the latest matching version.
22 | *Note:* If given, `branch-name` and `version-tag` are ignored.
23 |
24 | ### `branch-name`
25 |
26 | The branch of the Swift version to install (e.g. `swift-6.0.1-release`).
27 | Required if `release-version` is not set!
28 |
29 | ### `version-tag`
30 |
31 | The version tag of the Swift version to install (e.g. `swift-6.0.1-RELEASE`).
32 | Required if `release-version` is not set!
33 |
34 | ### `platform`
35 |
36 | The platform for which to install the Swift version (e.g. `ubuntu24.04`). Note that the github-actions notations with a dash (e.g. `ubuntu-20.04`) is also valid.
37 | If not given, the action tries to determine the system it currently runs on. Note that this might fail if Swift is not available on this platform, or it's not yet supported by this action!
38 |
39 | ### `skip-dependencies`
40 |
41 | Whether the installation of dependencies (currently via `apt`) should be skipped.
42 | Default: `false`
43 |
44 | ### `skip-gpg-check`
45 |
46 | Whether the GPG check should be skipped.
47 | Default: `false`
48 |
49 | ### `github-token`
50 |
51 | The token to use for searching for the latest matching release. Can be set to `${{secrets.GITHUB_TOKEN}}`.
52 | Default: `${{ github.token }}`
53 |
54 | ## Outputs
55 |
56 | ### `install-path`
57 |
58 | The path where Swift was installed.
59 | Note that this can usually be ignored, since swifty-linux-action adds the `${{install-path}}/usr/bin` to the `PATH` environment variable.
60 |
61 | ### `full-version`
62 |
63 | The full version of Swift that was installed (e.g. `swift-6.0.1-RELEASE`).
64 | This can be used to narrow down for example caches across builds.
65 |
66 |
67 | ## Example Usage
68 |
69 | In general, the `release-version` input parameter should be used to install a final release of Swift.
70 | To for example install Swift 6.0.1, use the following snippet:
71 | ```yaml
72 | uses: sersoft-gmbh/swifty-linux-action@v3
73 | with:
74 | release-version: 6.0.1
75 | ```
76 |
77 | If you automatically want to install the latest matching version, also provide the `github-token` input.
78 | This will search for the latest matching release using the following rules:
79 | - `'6'` -> Finds the latest `swift-6.x.y` release.
80 | - `'5.9'` -> Finds the latest `swift-5.9.x` release.
81 |
82 | To for example install the latest Swift 6.0.x release, use the following snippet:
83 | ```yaml
84 | uses: sersoft-gmbh/swifty-linux-action@v3
85 | with:
86 | release-version: '6.0'
87 | github-token: ${{secrets.GITHUB_TOKEN}}
88 | ```
89 |
90 | However, swifty-linux-action also supports installing other snapshots using the `branch-name` and `version-tag` input parameters.
91 | So, to for example install the Swift 5.7 development snapshot built on 13th of June 2022, use the following snippet:
92 |
93 | ```yaml
94 | uses: sersoft-gmbh/swifty-linux-action@v3
95 | with:
96 | branch-name: swift-5.7-branch
97 | version-tag: swift-5.7-DEVELOPMENT-SNAPSHOT-2022-06-13-a
98 | ```
99 |
--------------------------------------------------------------------------------
/action.yml:
--------------------------------------------------------------------------------
1 | name: Install Swift on Linux
2 | description: Installs a Swift toolchain on Linux
3 | author: ser.soft GmbH
4 | inputs:
5 | release-version:
6 | description: The (released) Swift version (e.g. 5.8.1) to install. If given, `branch-name` and `version-tag` are ignored. If `github-token` is also set, the action will automatically resolve it to the latest matching version (e.g. 5.8.1 for 5.8).
7 | required: false
8 | branch-name:
9 | description: The branch of the Swift version to install (e.g. swift-5.8.1-release). Required if `release-version` is not set!
10 | required: false
11 | version-tag:
12 | description: The version tag of the Swift version to install (e.g. swift-5.8.1-RELEASE). Required if `release-version` is not set!
13 | required: false
14 | platform:
15 | description: The platform for which to install the Swift version (e.g. ubuntu22.04). Note that the github-actions notations with a dash (e.g. ubuntu-22.04) is also valid.
16 | required: false
17 | skip-dependencies:
18 | description: Whether or not the installation of dependencies (currently via apt) should be skipped.
19 | required: false
20 | default: 'false'
21 | skip-gpg-check:
22 | description: Whether or not the GPG check should be skipped.
23 | required: false
24 | default: 'false'
25 | github-token:
26 | description: Only required if `release-version` should automatically resolve to the newest matching version. Can be set to `secrets.GITHUB_TOKEN`.
27 | required: false
28 | default: ${{ github.token }}
29 | outputs:
30 | install-path:
31 | description: The path where Swift was installed.
32 | full-version:
33 | description: The full version that was installed (e.g. swift-5.8.1-RELEASE).
34 | runs:
35 | using: node20
36 | main: dist/index.js
37 | branding:
38 | color: orange
39 | icon: cpu
40 |
--------------------------------------------------------------------------------
/dist/license.txt:
--------------------------------------------------------------------------------
1 | @actions/core
2 | MIT
3 | The MIT License (MIT)
4 |
5 | Copyright 2019 GitHub
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8 |
9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10 |
11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12 |
13 | @actions/exec
14 | MIT
15 | The MIT License (MIT)
16 |
17 | Copyright 2019 GitHub
18 |
19 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
20 |
21 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
22 |
23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 |
25 | @actions/github
26 | MIT
27 | The MIT License (MIT)
28 |
29 | Copyright 2019 GitHub
30 |
31 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
32 |
33 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
34 |
35 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
36 |
37 | @actions/http-client
38 | MIT
39 | Actions Http Client for Node.js
40 |
41 | Copyright (c) GitHub, Inc.
42 |
43 | All rights reserved.
44 |
45 | MIT License
46 |
47 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
48 | associated documentation files (the "Software"), to deal in the Software without restriction,
49 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
50 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
51 | subject to the following conditions:
52 |
53 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
54 |
55 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
56 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
57 | NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
58 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
59 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
60 |
61 |
62 | @actions/io
63 | MIT
64 | The MIT License (MIT)
65 |
66 | Copyright 2019 GitHub
67 |
68 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
69 |
70 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
71 |
72 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
73 |
74 | @actions/tool-cache
75 | MIT
76 | The MIT License (MIT)
77 |
78 | Copyright 2019 GitHub
79 |
80 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
81 |
82 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
83 |
84 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
85 |
86 | @fastify/busboy
87 | MIT
88 | Copyright Brian White. All rights reserved.
89 |
90 | Permission is hereby granted, free of charge, to any person obtaining a copy
91 | of this software and associated documentation files (the "Software"), to
92 | deal in the Software without restriction, including without limitation the
93 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
94 | sell copies of the Software, and to permit persons to whom the Software is
95 | furnished to do so, subject to the following conditions:
96 |
97 | The above copyright notice and this permission notice shall be included in
98 | all copies or substantial portions of the Software.
99 |
100 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
101 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
102 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
103 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
104 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
105 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
106 | IN THE SOFTWARE.
107 |
108 | @octokit/auth-token
109 | MIT
110 | The MIT License
111 |
112 | Copyright (c) 2019 Octokit contributors
113 |
114 | Permission is hereby granted, free of charge, to any person obtaining a copy
115 | of this software and associated documentation files (the "Software"), to deal
116 | in the Software without restriction, including without limitation the rights
117 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
118 | copies of the Software, and to permit persons to whom the Software is
119 | furnished to do so, subject to the following conditions:
120 |
121 | The above copyright notice and this permission notice shall be included in
122 | all copies or substantial portions of the Software.
123 |
124 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
125 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
126 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
127 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
128 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
129 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
130 | THE SOFTWARE.
131 |
132 |
133 | @octokit/core
134 | MIT
135 | The MIT License
136 |
137 | Copyright (c) 2019 Octokit contributors
138 |
139 | Permission is hereby granted, free of charge, to any person obtaining a copy
140 | of this software and associated documentation files (the "Software"), to deal
141 | in the Software without restriction, including without limitation the rights
142 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
143 | copies of the Software, and to permit persons to whom the Software is
144 | furnished to do so, subject to the following conditions:
145 |
146 | The above copyright notice and this permission notice shall be included in
147 | all copies or substantial portions of the Software.
148 |
149 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
150 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
151 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
152 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
153 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
154 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
155 | THE SOFTWARE.
156 |
157 |
158 | @octokit/endpoint
159 | MIT
160 | The MIT License
161 |
162 | Copyright (c) 2018 Octokit contributors
163 |
164 | Permission is hereby granted, free of charge, to any person obtaining a copy
165 | of this software and associated documentation files (the "Software"), to deal
166 | in the Software without restriction, including without limitation the rights
167 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
168 | copies of the Software, and to permit persons to whom the Software is
169 | furnished to do so, subject to the following conditions:
170 |
171 | The above copyright notice and this permission notice shall be included in
172 | all copies or substantial portions of the Software.
173 |
174 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
175 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
176 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
177 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
178 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
179 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
180 | THE SOFTWARE.
181 |
182 |
183 | @octokit/graphql
184 | MIT
185 | The MIT License
186 |
187 | Copyright (c) 2018 Octokit contributors
188 |
189 | Permission is hereby granted, free of charge, to any person obtaining a copy
190 | of this software and associated documentation files (the "Software"), to deal
191 | in the Software without restriction, including without limitation the rights
192 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
193 | copies of the Software, and to permit persons to whom the Software is
194 | furnished to do so, subject to the following conditions:
195 |
196 | The above copyright notice and this permission notice shall be included in
197 | all copies or substantial portions of the Software.
198 |
199 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
200 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
201 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
202 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
203 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
204 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
205 | THE SOFTWARE.
206 |
207 |
208 | @octokit/plugin-paginate-rest
209 | MIT
210 | MIT License Copyright (c) 2019 Octokit contributors
211 |
212 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
213 |
214 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
215 |
216 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
217 |
218 |
219 | @octokit/plugin-rest-endpoint-methods
220 | MIT
221 | MIT License Copyright (c) 2019 Octokit contributors
222 |
223 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
224 |
225 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
226 |
227 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
228 |
229 |
230 | @octokit/request
231 | MIT
232 | The MIT License
233 |
234 | Copyright (c) 2018 Octokit contributors
235 |
236 | Permission is hereby granted, free of charge, to any person obtaining a copy
237 | of this software and associated documentation files (the "Software"), to deal
238 | in the Software without restriction, including without limitation the rights
239 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
240 | copies of the Software, and to permit persons to whom the Software is
241 | furnished to do so, subject to the following conditions:
242 |
243 | The above copyright notice and this permission notice shall be included in
244 | all copies or substantial portions of the Software.
245 |
246 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
247 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
248 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
249 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
250 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
251 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
252 | THE SOFTWARE.
253 |
254 |
255 | @octokit/request-error
256 | MIT
257 | The MIT License
258 |
259 | Copyright (c) 2019 Octokit contributors
260 |
261 | Permission is hereby granted, free of charge, to any person obtaining a copy
262 | of this software and associated documentation files (the "Software"), to deal
263 | in the Software without restriction, including without limitation the rights
264 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
265 | copies of the Software, and to permit persons to whom the Software is
266 | furnished to do so, subject to the following conditions:
267 |
268 | The above copyright notice and this permission notice shall be included in
269 | all copies or substantial portions of the Software.
270 |
271 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
272 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
273 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
274 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
275 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
276 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
277 | THE SOFTWARE.
278 |
279 |
280 | before-after-hook
281 | Apache-2.0
282 | Apache License
283 | Version 2.0, January 2004
284 | http://www.apache.org/licenses/
285 |
286 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
287 |
288 | 1. Definitions.
289 |
290 | "License" shall mean the terms and conditions for use, reproduction,
291 | and distribution as defined by Sections 1 through 9 of this document.
292 |
293 | "Licensor" shall mean the copyright owner or entity authorized by
294 | the copyright owner that is granting the License.
295 |
296 | "Legal Entity" shall mean the union of the acting entity and all
297 | other entities that control, are controlled by, or are under common
298 | control with that entity. For the purposes of this definition,
299 | "control" means (i) the power, direct or indirect, to cause the
300 | direction or management of such entity, whether by contract or
301 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
302 | outstanding shares, or (iii) beneficial ownership of such entity.
303 |
304 | "You" (or "Your") shall mean an individual or Legal Entity
305 | exercising permissions granted by this License.
306 |
307 | "Source" form shall mean the preferred form for making modifications,
308 | including but not limited to software source code, documentation
309 | source, and configuration files.
310 |
311 | "Object" form shall mean any form resulting from mechanical
312 | transformation or translation of a Source form, including but
313 | not limited to compiled object code, generated documentation,
314 | and conversions to other media types.
315 |
316 | "Work" shall mean the work of authorship, whether in Source or
317 | Object form, made available under the License, as indicated by a
318 | copyright notice that is included in or attached to the work
319 | (an example is provided in the Appendix below).
320 |
321 | "Derivative Works" shall mean any work, whether in Source or Object
322 | form, that is based on (or derived from) the Work and for which the
323 | editorial revisions, annotations, elaborations, or other modifications
324 | represent, as a whole, an original work of authorship. For the purposes
325 | of this License, Derivative Works shall not include works that remain
326 | separable from, or merely link (or bind by name) to the interfaces of,
327 | the Work and Derivative Works thereof.
328 |
329 | "Contribution" shall mean any work of authorship, including
330 | the original version of the Work and any modifications or additions
331 | to that Work or Derivative Works thereof, that is intentionally
332 | submitted to Licensor for inclusion in the Work by the copyright owner
333 | or by an individual or Legal Entity authorized to submit on behalf of
334 | the copyright owner. For the purposes of this definition, "submitted"
335 | means any form of electronic, verbal, or written communication sent
336 | to the Licensor or its representatives, including but not limited to
337 | communication on electronic mailing lists, source code control systems,
338 | and issue tracking systems that are managed by, or on behalf of, the
339 | Licensor for the purpose of discussing and improving the Work, but
340 | excluding communication that is conspicuously marked or otherwise
341 | designated in writing by the copyright owner as "Not a Contribution."
342 |
343 | "Contributor" shall mean Licensor and any individual or Legal Entity
344 | on behalf of whom a Contribution has been received by Licensor and
345 | subsequently incorporated within the Work.
346 |
347 | 2. Grant of Copyright License. Subject to the terms and conditions of
348 | this License, each Contributor hereby grants to You a perpetual,
349 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
350 | copyright license to reproduce, prepare Derivative Works of,
351 | publicly display, publicly perform, sublicense, and distribute the
352 | Work and such Derivative Works in Source or Object form.
353 |
354 | 3. Grant of Patent License. Subject to the terms and conditions of
355 | this License, each Contributor hereby grants to You a perpetual,
356 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
357 | (except as stated in this section) patent license to make, have made,
358 | use, offer to sell, sell, import, and otherwise transfer the Work,
359 | where such license applies only to those patent claims licensable
360 | by such Contributor that are necessarily infringed by their
361 | Contribution(s) alone or by combination of their Contribution(s)
362 | with the Work to which such Contribution(s) was submitted. If You
363 | institute patent litigation against any entity (including a
364 | cross-claim or counterclaim in a lawsuit) alleging that the Work
365 | or a Contribution incorporated within the Work constitutes direct
366 | or contributory patent infringement, then any patent licenses
367 | granted to You under this License for that Work shall terminate
368 | as of the date such litigation is filed.
369 |
370 | 4. Redistribution. You may reproduce and distribute copies of the
371 | Work or Derivative Works thereof in any medium, with or without
372 | modifications, and in Source or Object form, provided that You
373 | meet the following conditions:
374 |
375 | (a) You must give any other recipients of the Work or
376 | Derivative Works a copy of this License; and
377 |
378 | (b) You must cause any modified files to carry prominent notices
379 | stating that You changed the files; and
380 |
381 | (c) You must retain, in the Source form of any Derivative Works
382 | that You distribute, all copyright, patent, trademark, and
383 | attribution notices from the Source form of the Work,
384 | excluding those notices that do not pertain to any part of
385 | the Derivative Works; and
386 |
387 | (d) If the Work includes a "NOTICE" text file as part of its
388 | distribution, then any Derivative Works that You distribute must
389 | include a readable copy of the attribution notices contained
390 | within such NOTICE file, excluding those notices that do not
391 | pertain to any part of the Derivative Works, in at least one
392 | of the following places: within a NOTICE text file distributed
393 | as part of the Derivative Works; within the Source form or
394 | documentation, if provided along with the Derivative Works; or,
395 | within a display generated by the Derivative Works, if and
396 | wherever such third-party notices normally appear. The contents
397 | of the NOTICE file are for informational purposes only and
398 | do not modify the License. You may add Your own attribution
399 | notices within Derivative Works that You distribute, alongside
400 | or as an addendum to the NOTICE text from the Work, provided
401 | that such additional attribution notices cannot be construed
402 | as modifying the License.
403 |
404 | You may add Your own copyright statement to Your modifications and
405 | may provide additional or different license terms and conditions
406 | for use, reproduction, or distribution of Your modifications, or
407 | for any such Derivative Works as a whole, provided Your use,
408 | reproduction, and distribution of the Work otherwise complies with
409 | the conditions stated in this License.
410 |
411 | 5. Submission of Contributions. Unless You explicitly state otherwise,
412 | any Contribution intentionally submitted for inclusion in the Work
413 | by You to the Licensor shall be under the terms and conditions of
414 | this License, without any additional terms or conditions.
415 | Notwithstanding the above, nothing herein shall supersede or modify
416 | the terms of any separate license agreement you may have executed
417 | with Licensor regarding such Contributions.
418 |
419 | 6. Trademarks. This License does not grant permission to use the trade
420 | names, trademarks, service marks, or product names of the Licensor,
421 | except as required for reasonable and customary use in describing the
422 | origin of the Work and reproducing the content of the NOTICE file.
423 |
424 | 7. Disclaimer of Warranty. Unless required by applicable law or
425 | agreed to in writing, Licensor provides the Work (and each
426 | Contributor provides its Contributions) on an "AS IS" BASIS,
427 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
428 | implied, including, without limitation, any warranties or conditions
429 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
430 | PARTICULAR PURPOSE. You are solely responsible for determining the
431 | appropriateness of using or redistributing the Work and assume any
432 | risks associated with Your exercise of permissions under this License.
433 |
434 | 8. Limitation of Liability. In no event and under no legal theory,
435 | whether in tort (including negligence), contract, or otherwise,
436 | unless required by applicable law (such as deliberate and grossly
437 | negligent acts) or agreed to in writing, shall any Contributor be
438 | liable to You for damages, including any direct, indirect, special,
439 | incidental, or consequential damages of any character arising as a
440 | result of this License or out of the use or inability to use the
441 | Work (including but not limited to damages for loss of goodwill,
442 | work stoppage, computer failure or malfunction, or any and all
443 | other commercial damages or losses), even if such Contributor
444 | has been advised of the possibility of such damages.
445 |
446 | 9. Accepting Warranty or Additional Liability. While redistributing
447 | the Work or Derivative Works thereof, You may choose to offer,
448 | and charge a fee for, acceptance of support, warranty, indemnity,
449 | or other liability obligations and/or rights consistent with this
450 | License. However, in accepting such obligations, You may act only
451 | on Your own behalf and on Your sole responsibility, not on behalf
452 | of any other Contributor, and only if You agree to indemnify,
453 | defend, and hold each Contributor harmless for any liability
454 | incurred by, or claims asserted against, such Contributor by reason
455 | of your accepting any such warranty or additional liability.
456 |
457 | END OF TERMS AND CONDITIONS
458 |
459 | APPENDIX: How to apply the Apache License to your work.
460 |
461 | To apply the Apache License to your work, attach the following
462 | boilerplate notice, with the fields enclosed by brackets "{}"
463 | replaced with your own identifying information. (Don't include
464 | the brackets!) The text should be enclosed in the appropriate
465 | comment syntax for the file format. We also recommend that a
466 | file or class name and description of purpose be included on the
467 | same "printed page" as the copyright notice for easier
468 | identification within third-party archives.
469 |
470 | Copyright 2018 Gregor Martynus and other contributors.
471 |
472 | Licensed under the Apache License, Version 2.0 (the "License");
473 | you may not use this file except in compliance with the License.
474 | You may obtain a copy of the License at
475 |
476 | http://www.apache.org/licenses/LICENSE-2.0
477 |
478 | Unless required by applicable law or agreed to in writing, software
479 | distributed under the License is distributed on an "AS IS" BASIS,
480 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
481 | See the License for the specific language governing permissions and
482 | limitations under the License.
483 |
484 |
485 | deprecation
486 | ISC
487 | The ISC License
488 |
489 | Copyright (c) Gregor Martynus and contributors
490 |
491 | Permission to use, copy, modify, and/or distribute this software for any
492 | purpose with or without fee is hereby granted, provided that the above
493 | copyright notice and this permission notice appear in all copies.
494 |
495 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
496 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
497 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
498 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
499 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
500 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
501 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
502 |
503 |
504 | once
505 | ISC
506 | The ISC License
507 |
508 | Copyright (c) Isaac Z. Schlueter and Contributors
509 |
510 | Permission to use, copy, modify, and/or distribute this software for any
511 | purpose with or without fee is hereby granted, provided that the above
512 | copyright notice and this permission notice appear in all copies.
513 |
514 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
515 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
516 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
517 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
518 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
519 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
520 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
521 |
522 |
523 | semver
524 | ISC
525 | The ISC License
526 |
527 | Copyright (c) Isaac Z. Schlueter and Contributors
528 |
529 | Permission to use, copy, modify, and/or distribute this software for any
530 | purpose with or without fee is hereby granted, provided that the above
531 | copyright notice and this permission notice appear in all copies.
532 |
533 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
534 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
535 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
536 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
537 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
538 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
539 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
540 |
541 |
542 | tunnel
543 | MIT
544 | The MIT License (MIT)
545 |
546 | Copyright (c) 2012 Koichi Kobayashi
547 |
548 | Permission is hereby granted, free of charge, to any person obtaining a copy
549 | of this software and associated documentation files (the "Software"), to deal
550 | in the Software without restriction, including without limitation the rights
551 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
552 | copies of the Software, and to permit persons to whom the Software is
553 | furnished to do so, subject to the following conditions:
554 |
555 | The above copyright notice and this permission notice shall be included in
556 | all copies or substantial portions of the Software.
557 |
558 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
559 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
560 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
561 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
562 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
563 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
564 | THE SOFTWARE.
565 |
566 |
567 | undici
568 | MIT
569 | MIT License
570 |
571 | Copyright (c) Matteo Collina and Undici contributors
572 |
573 | Permission is hereby granted, free of charge, to any person obtaining a copy
574 | of this software and associated documentation files (the "Software"), to deal
575 | in the Software without restriction, including without limitation the rights
576 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
577 | copies of the Software, and to permit persons to whom the Software is
578 | furnished to do so, subject to the following conditions:
579 |
580 | The above copyright notice and this permission notice shall be included in all
581 | copies or substantial portions of the Software.
582 |
583 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
584 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
585 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
586 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
587 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
588 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
589 | SOFTWARE.
590 |
591 |
592 | universal-user-agent
593 | ISC
594 | # [ISC License](https://spdx.org/licenses/ISC)
595 |
596 | Copyright (c) 2018, Gregor Martynus (https://github.com/gr2m)
597 |
598 | Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
599 |
600 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
601 |
602 |
603 | wrappy
604 | ISC
605 | The ISC License
606 |
607 | Copyright (c) Isaac Z. Schlueter and Contributors
608 |
609 | Permission to use, copy, modify, and/or distribute this software for any
610 | purpose with or without fee is hereby granted, provided that the above
611 | copyright notice and this permission notice appear in all copies.
612 |
613 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
614 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
615 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
616 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
617 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
618 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
619 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
620 |
--------------------------------------------------------------------------------
/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "swifty-linux-action",
3 | "version": "3.0.0",
4 | "lockfileVersion": 3,
5 | "requires": true,
6 | "packages": {
7 | "": {
8 | "name": "swifty-linux-action",
9 | "version": "3.0.0",
10 | "license": "Apache-2.0",
11 | "dependencies": {
12 | "@actions/core": "^1.11.1",
13 | "@actions/exec": "^1.1.1",
14 | "@actions/github": "^6.0.1",
15 | "@actions/io": "^1.1.3",
16 | "@actions/tool-cache": "^2.0.2"
17 | },
18 | "devDependencies": {
19 | "@tsconfig/node20": "20.1.6",
20 | "@types/node": "^20.19.17",
21 | "@vercel/ncc": "^0.38.4",
22 | "typescript": "^5.9.2"
23 | },
24 | "engines": {
25 | "node": ">=20"
26 | }
27 | },
28 | "node_modules/@actions/core": {
29 | "version": "1.11.1",
30 | "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz",
31 | "integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==",
32 | "dependencies": {
33 | "@actions/exec": "^1.1.1",
34 | "@actions/http-client": "^2.0.1"
35 | }
36 | },
37 | "node_modules/@actions/exec": {
38 | "version": "1.1.1",
39 | "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz",
40 | "integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==",
41 | "dependencies": {
42 | "@actions/io": "^1.0.1"
43 | }
44 | },
45 | "node_modules/@actions/github": {
46 | "version": "6.0.1",
47 | "resolved": "https://registry.npmjs.org/@actions/github/-/github-6.0.1.tgz",
48 | "integrity": "sha512-xbZVcaqD4XnQAe35qSQqskb3SqIAfRyLBrHMd/8TuL7hJSz2QtbDwnNM8zWx4zO5l2fnGtseNE3MbEvD7BxVMw==",
49 | "license": "MIT",
50 | "dependencies": {
51 | "@actions/http-client": "^2.2.0",
52 | "@octokit/core": "^5.0.1",
53 | "@octokit/plugin-paginate-rest": "^9.2.2",
54 | "@octokit/plugin-rest-endpoint-methods": "^10.4.0",
55 | "@octokit/request": "^8.4.1",
56 | "@octokit/request-error": "^5.1.1",
57 | "undici": "^5.28.5"
58 | }
59 | },
60 | "node_modules/@actions/http-client": {
61 | "version": "2.2.0",
62 | "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.0.tgz",
63 | "integrity": "sha512-q+epW0trjVUUHboliPb4UF9g2msf+w61b32tAkFEwL/IwP0DQWgbCMM0Hbe3e3WXSKz5VcUXbzJQgy8Hkra/Lg==",
64 | "dependencies": {
65 | "tunnel": "^0.0.6",
66 | "undici": "^5.25.4"
67 | }
68 | },
69 | "node_modules/@actions/io": {
70 | "version": "1.1.3",
71 | "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz",
72 | "integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q=="
73 | },
74 | "node_modules/@actions/tool-cache": {
75 | "version": "2.0.2",
76 | "resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-2.0.2.tgz",
77 | "integrity": "sha512-fBhNNOWxuoLxztQebpOaWu6WeVmuwa77Z+DxIZ1B+OYvGkGQon6kTVg6Z32Cb13WCuw0szqonK+hh03mJV7Z6w==",
78 | "dependencies": {
79 | "@actions/core": "^1.11.1",
80 | "@actions/exec": "^1.0.0",
81 | "@actions/http-client": "^2.0.1",
82 | "@actions/io": "^1.1.1",
83 | "semver": "^6.1.0"
84 | }
85 | },
86 | "node_modules/@fastify/busboy": {
87 | "version": "2.0.0",
88 | "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.0.0.tgz",
89 | "integrity": "sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==",
90 | "engines": {
91 | "node": ">=14"
92 | }
93 | },
94 | "node_modules/@octokit/auth-token": {
95 | "version": "4.0.0",
96 | "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz",
97 | "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==",
98 | "engines": {
99 | "node": ">= 18"
100 | }
101 | },
102 | "node_modules/@octokit/core": {
103 | "version": "5.0.1",
104 | "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.0.1.tgz",
105 | "integrity": "sha512-lyeeeZyESFo+ffI801SaBKmCfsvarO+dgV8/0gD8u1d87clbEdWsP5yC+dSj3zLhb2eIf5SJrn6vDz9AheETHw==",
106 | "dependencies": {
107 | "@octokit/auth-token": "^4.0.0",
108 | "@octokit/graphql": "^7.0.0",
109 | "@octokit/request": "^8.0.2",
110 | "@octokit/request-error": "^5.0.0",
111 | "@octokit/types": "^12.0.0",
112 | "before-after-hook": "^2.2.0",
113 | "universal-user-agent": "^6.0.0"
114 | },
115 | "engines": {
116 | "node": ">= 18"
117 | }
118 | },
119 | "node_modules/@octokit/endpoint": {
120 | "version": "9.0.6",
121 | "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.6.tgz",
122 | "integrity": "sha512-H1fNTMA57HbkFESSt3Y9+FBICv+0jFceJFPWDePYlR/iMGrwM5ph+Dd4XRQs+8X+PUFURLQgX9ChPfhJ/1uNQw==",
123 | "license": "MIT",
124 | "dependencies": {
125 | "@octokit/types": "^13.1.0",
126 | "universal-user-agent": "^6.0.0"
127 | },
128 | "engines": {
129 | "node": ">= 18"
130 | }
131 | },
132 | "node_modules/@octokit/endpoint/node_modules/@octokit/openapi-types": {
133 | "version": "23.0.1",
134 | "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-23.0.1.tgz",
135 | "integrity": "sha512-izFjMJ1sir0jn0ldEKhZ7xegCTj/ObmEDlEfpFrx4k/JyZSMRHbO3/rBwgE7f3m2DHt+RrNGIVw4wSmwnm3t/g==",
136 | "license": "MIT"
137 | },
138 | "node_modules/@octokit/endpoint/node_modules/@octokit/types": {
139 | "version": "13.8.0",
140 | "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.8.0.tgz",
141 | "integrity": "sha512-x7DjTIbEpEWXK99DMd01QfWy0hd5h4EN+Q7shkdKds3otGQP+oWE/y0A76i1OvH9fygo4ddvNf7ZvF0t78P98A==",
142 | "license": "MIT",
143 | "dependencies": {
144 | "@octokit/openapi-types": "^23.0.1"
145 | }
146 | },
147 | "node_modules/@octokit/graphql": {
148 | "version": "7.0.2",
149 | "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.0.2.tgz",
150 | "integrity": "sha512-OJ2iGMtj5Tg3s6RaXH22cJcxXRi7Y3EBqbHTBRq+PQAqfaS8f/236fUrWhfSn8P4jovyzqucxme7/vWSSZBX2Q==",
151 | "dependencies": {
152 | "@octokit/request": "^8.0.1",
153 | "@octokit/types": "^12.0.0",
154 | "universal-user-agent": "^6.0.0"
155 | },
156 | "engines": {
157 | "node": ">= 18"
158 | }
159 | },
160 | "node_modules/@octokit/openapi-types": {
161 | "version": "20.0.0",
162 | "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-20.0.0.tgz",
163 | "integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==",
164 | "license": "MIT"
165 | },
166 | "node_modules/@octokit/plugin-paginate-rest": {
167 | "version": "9.2.2",
168 | "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-9.2.2.tgz",
169 | "integrity": "sha512-u3KYkGF7GcZnSD/3UP0S7K5XUFT2FkOQdcfXZGZQPGv3lm4F2Xbf71lvjldr8c1H3nNbF+33cLEkWYbokGWqiQ==",
170 | "license": "MIT",
171 | "dependencies": {
172 | "@octokit/types": "^12.6.0"
173 | },
174 | "engines": {
175 | "node": ">= 18"
176 | },
177 | "peerDependencies": {
178 | "@octokit/core": "5"
179 | }
180 | },
181 | "node_modules/@octokit/plugin-rest-endpoint-methods": {
182 | "version": "10.4.1",
183 | "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-10.4.1.tgz",
184 | "integrity": "sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg==",
185 | "license": "MIT",
186 | "dependencies": {
187 | "@octokit/types": "^12.6.0"
188 | },
189 | "engines": {
190 | "node": ">= 18"
191 | },
192 | "peerDependencies": {
193 | "@octokit/core": "5"
194 | }
195 | },
196 | "node_modules/@octokit/request": {
197 | "version": "8.4.1",
198 | "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.4.1.tgz",
199 | "integrity": "sha512-qnB2+SY3hkCmBxZsR/MPCybNmbJe4KAlfWErXq+rBKkQJlbjdJeS85VI9r8UqeLYLvnAenU8Q1okM/0MBsAGXw==",
200 | "license": "MIT",
201 | "dependencies": {
202 | "@octokit/endpoint": "^9.0.6",
203 | "@octokit/request-error": "^5.1.1",
204 | "@octokit/types": "^13.1.0",
205 | "universal-user-agent": "^6.0.0"
206 | },
207 | "engines": {
208 | "node": ">= 18"
209 | }
210 | },
211 | "node_modules/@octokit/request-error": {
212 | "version": "5.1.1",
213 | "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.1.1.tgz",
214 | "integrity": "sha512-v9iyEQJH6ZntoENr9/yXxjuezh4My67CBSu9r6Ve/05Iu5gNgnisNWOsoJHTP6k0Rr0+HQIpnH+kyammu90q/g==",
215 | "license": "MIT",
216 | "dependencies": {
217 | "@octokit/types": "^13.1.0",
218 | "deprecation": "^2.0.0",
219 | "once": "^1.4.0"
220 | },
221 | "engines": {
222 | "node": ">= 18"
223 | }
224 | },
225 | "node_modules/@octokit/request-error/node_modules/@octokit/openapi-types": {
226 | "version": "23.0.1",
227 | "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-23.0.1.tgz",
228 | "integrity": "sha512-izFjMJ1sir0jn0ldEKhZ7xegCTj/ObmEDlEfpFrx4k/JyZSMRHbO3/rBwgE7f3m2DHt+RrNGIVw4wSmwnm3t/g==",
229 | "license": "MIT"
230 | },
231 | "node_modules/@octokit/request-error/node_modules/@octokit/types": {
232 | "version": "13.8.0",
233 | "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.8.0.tgz",
234 | "integrity": "sha512-x7DjTIbEpEWXK99DMd01QfWy0hd5h4EN+Q7shkdKds3otGQP+oWE/y0A76i1OvH9fygo4ddvNf7ZvF0t78P98A==",
235 | "license": "MIT",
236 | "dependencies": {
237 | "@octokit/openapi-types": "^23.0.1"
238 | }
239 | },
240 | "node_modules/@octokit/request/node_modules/@octokit/openapi-types": {
241 | "version": "23.0.1",
242 | "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-23.0.1.tgz",
243 | "integrity": "sha512-izFjMJ1sir0jn0ldEKhZ7xegCTj/ObmEDlEfpFrx4k/JyZSMRHbO3/rBwgE7f3m2DHt+RrNGIVw4wSmwnm3t/g==",
244 | "license": "MIT"
245 | },
246 | "node_modules/@octokit/request/node_modules/@octokit/types": {
247 | "version": "13.8.0",
248 | "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.8.0.tgz",
249 | "integrity": "sha512-x7DjTIbEpEWXK99DMd01QfWy0hd5h4EN+Q7shkdKds3otGQP+oWE/y0A76i1OvH9fygo4ddvNf7ZvF0t78P98A==",
250 | "license": "MIT",
251 | "dependencies": {
252 | "@octokit/openapi-types": "^23.0.1"
253 | }
254 | },
255 | "node_modules/@octokit/types": {
256 | "version": "12.6.0",
257 | "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz",
258 | "integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==",
259 | "license": "MIT",
260 | "dependencies": {
261 | "@octokit/openapi-types": "^20.0.0"
262 | }
263 | },
264 | "node_modules/@tsconfig/node20": {
265 | "version": "20.1.6",
266 | "resolved": "https://registry.npmjs.org/@tsconfig/node20/-/node20-20.1.6.tgz",
267 | "integrity": "sha512-sz+Hqx9zwZDpZIV871WSbUzSqNIsXzghZydypnfgzPKLltVJfkINfUeTct31n/tTSa9ZE1ZOfKdRre1uHHquYQ==",
268 | "dev": true,
269 | "license": "MIT"
270 | },
271 | "node_modules/@types/node": {
272 | "version": "20.19.17",
273 | "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.17.tgz",
274 | "integrity": "sha512-gfehUI8N1z92kygssiuWvLiwcbOB3IRktR6hTDgJlXMYh5OvkPSRmgfoBUmfZt+vhwJtX7v1Yw4KvvAf7c5QKQ==",
275 | "dev": true,
276 | "license": "MIT",
277 | "dependencies": {
278 | "undici-types": "~6.21.0"
279 | }
280 | },
281 | "node_modules/@vercel/ncc": {
282 | "version": "0.38.4",
283 | "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.4.tgz",
284 | "integrity": "sha512-8LwjnlP39s08C08J5NstzriPvW1SP8Zfpp1BvC2sI35kPeZnHfxVkCwu4/+Wodgnd60UtT1n8K8zw+Mp7J9JmQ==",
285 | "dev": true,
286 | "license": "MIT",
287 | "bin": {
288 | "ncc": "dist/ncc/cli.js"
289 | }
290 | },
291 | "node_modules/before-after-hook": {
292 | "version": "2.2.3",
293 | "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz",
294 | "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ=="
295 | },
296 | "node_modules/deprecation": {
297 | "version": "2.3.1",
298 | "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz",
299 | "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ=="
300 | },
301 | "node_modules/once": {
302 | "version": "1.4.0",
303 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
304 | "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
305 | "dependencies": {
306 | "wrappy": "1"
307 | }
308 | },
309 | "node_modules/semver": {
310 | "version": "6.3.1",
311 | "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
312 | "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
313 | "bin": {
314 | "semver": "bin/semver.js"
315 | }
316 | },
317 | "node_modules/tunnel": {
318 | "version": "0.0.6",
319 | "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
320 | "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==",
321 | "engines": {
322 | "node": ">=0.6.11 <=0.7.0 || >=0.7.3"
323 | }
324 | },
325 | "node_modules/typescript": {
326 | "version": "5.9.2",
327 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz",
328 | "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==",
329 | "dev": true,
330 | "license": "Apache-2.0",
331 | "bin": {
332 | "tsc": "bin/tsc",
333 | "tsserver": "bin/tsserver"
334 | },
335 | "engines": {
336 | "node": ">=14.17"
337 | }
338 | },
339 | "node_modules/undici": {
340 | "version": "5.29.0",
341 | "resolved": "https://registry.npmjs.org/undici/-/undici-5.29.0.tgz",
342 | "integrity": "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==",
343 | "license": "MIT",
344 | "dependencies": {
345 | "@fastify/busboy": "^2.0.0"
346 | },
347 | "engines": {
348 | "node": ">=14.0"
349 | }
350 | },
351 | "node_modules/undici-types": {
352 | "version": "6.21.0",
353 | "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
354 | "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
355 | "dev": true,
356 | "license": "MIT"
357 | },
358 | "node_modules/universal-user-agent": {
359 | "version": "6.0.0",
360 | "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",
361 | "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w=="
362 | },
363 | "node_modules/wrappy": {
364 | "version": "1.0.2",
365 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
366 | "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
367 | }
368 | }
369 | }
370 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "swifty-linux-action",
3 | "version": "3.0.0",
4 | "description": "Sets up a Swift environment on Linux",
5 | "engines": {
6 | "node": ">=20"
7 | },
8 | "exports": {
9 | ".": "./dist/index.js"
10 | },
11 | "scripts": {
12 | "test": "echo \"Error: no test specified\" && exit 1",
13 | "build": "tsc",
14 | "pack": "rm -rf dist && ncc build lib/main.js -o dist --license license.txt --target es2022"
15 | },
16 | "repository": {
17 | "type": "git",
18 | "url": "git+https://github.com/sersoft-gmbh/swifty-linux-action.git"
19 | },
20 | "keywords": [
21 | "Swift",
22 | "Linux"
23 | ],
24 | "author": "ser.soft GmbH",
25 | "license": "Apache-2.0",
26 | "bugs": {
27 | "url": "https://github.com/sersoft-gmbh/swifty-linux-action/issues"
28 | },
29 | "homepage": "https://github.com/sersoft-gmbh/swifty-linux-action#readme",
30 | "dependencies": {
31 | "@actions/core": "^1.11.1",
32 | "@actions/exec": "^1.1.1",
33 | "@actions/github": "^6.0.1",
34 | "@actions/io": "^1.1.3",
35 | "@actions/tool-cache": "^2.0.2"
36 | },
37 | "devDependencies": {
38 | "@tsconfig/node20": "20.1.6",
39 | "@types/node": "^20.19.17",
40 | "@vercel/ncc": "^0.38.4",
41 | "typescript": "^5.9.2"
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main.ts:
--------------------------------------------------------------------------------
1 | import * as core from '@actions/core';
2 | import { getExecOutput } from '@actions/exec';
3 | import * as tools from '@actions/tool-cache';
4 | import * as io from '@actions/io';
5 | import * as github from '@actions/github';
6 | import * as fs from 'fs';
7 | import * as util from 'util';
8 | import * as path from 'path';
9 |
10 | async function runCmd(cmd: string, ...args: string[]): Promise {
11 | const output = await getExecOutput(cmd, args.length <= 0 ? undefined : args);
12 | return output.stdout;
13 | }
14 |
15 | async function findMatchingRelease(releaseVersion: string, token: string): Promise {
16 | type RepositoryData = {
17 | repository?: {
18 | refs?: {
19 | nodes?: { name: string; }[];
20 | };
21 | };
22 | };
23 | const data = await github.getOctokit(token).graphql(`
24 | query getTags($tagQuery: String!) {
25 | repository(owner: "swiftlang", name: "swift") {
26 | refs(refPrefix: "refs/tags/", first: 100, query: $tagQuery, orderBy: { field: ALPHABETICAL, direction: DESC }) {
27 | nodes {
28 | name
29 | }
30 | }
31 | }
32 | }
33 | `, { tagQuery: `swift-${releaseVersion}` });
34 | const tagNames = data.repository?.refs?.nodes?.map(n => n.name)
35 | .filter(n => n.toLowerCase().endsWith('-release')) ?? [];
36 | if (tagNames.length <= 0) {
37 | core.info(`No release found for version '${releaseVersion}'. Using version as-is...`);
38 | return releaseVersion;
39 | }
40 | return tagNames[0].split('-')[1];
41 | }
42 |
43 | async function install(installBase: string, branchName: string, versionTag: string, platform: string, skipGPGCheck: boolean) {
44 | const tempPath = await core.group('Setup paths', async () => {
45 | await io.mkdirP(installBase);
46 | return await util.promisify(fs.mkdtemp)('swifty-linux-action');
47 | });
48 |
49 | const swiftPkg = path.join(tempPath, 'swift.tar.gz');
50 | const swiftSig = path.join(tempPath, 'swift.tar.gz.sig');
51 | const allKeysFile = path.join(tempPath, 'all-keys.asc');
52 | await core.group('Downloading files', async () => {
53 | const swiftURL = `https://download.swift.org/${branchName}/${platform.split('.').join('')}/${versionTag}/${versionTag}-${platform}.tar.gz`;
54 | core.debug(`Swift Download URL: ${swiftURL}...`)
55 | let promises: Promise[] = [tools.downloadTool(swiftURL, swiftPkg)];
56 | if (!skipGPGCheck) {
57 | promises.push(
58 | tools.downloadTool('https://swift.org/keys/all-keys.asc', allKeysFile),
59 | tools.downloadTool(`${swiftURL}.sig`, swiftSig),
60 | );
61 | }
62 | await Promise.all(promises);
63 | });
64 |
65 | if (!skipGPGCheck) {
66 | await core.group('Verifying files', async () => {
67 | try {
68 | await runCmd('gpg', '--import', allKeysFile);
69 | } catch (error) {
70 | core.debug('Failed to import GPG keys from file: ' + error);
71 | core.debug('Trying to import from keyserver...');
72 | await runCmd('gpg', '--keyserver', 'hkp://keyserver.ubuntu.com', '--recv-keys',
73 | '7463 A81A 4B2E EA1B 551F FBCF D441 C977 412B 37AD',
74 | '1BE1 E29A 084C B305 F397 D62A 9F59 7F4D 21A5 6D5F',
75 | 'A3BA FD35 56A5 9079 C068 94BD 63BC 1CFE 91D3 06C6',
76 | '5E4D F843 FB06 5D7F 7E24 FBA2 EF54 30F0 71E1 B235',
77 | '8513 444E 2DA3 6B7C 1659 AF4D 7638 F1FB 2B2B 08C4',
78 | 'A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561',
79 | '8A74 9566 2C3C D4AE 18D9 5637 FAF6 989E 1BC1 6FEA',
80 | 'E813 C892 820A 6FA1 3755 B268 F167 DF1A CF9C E069');
81 | }
82 | let verifyArgs = ['--verify'];
83 | if (!core.isDebug()) verifyArgs.push('--quiet');
84 | verifyArgs.push(swiftSig, swiftPkg);
85 | await runCmd('gpg', ...verifyArgs);
86 | });
87 | }
88 |
89 | await core.group('Unpacking files', async () => {
90 | // We need to pass 'strip-components', so we cannot use 'tools.extractTar'
91 | await runCmd('tar', 'x', '--strip-components=1', '-C', installBase, '-f', swiftPkg);
92 | // We need the -R option and want to simply add r (not knowing what the other permissions are), so we use the command line here.
93 | await runCmd('chmod', '-R', 'o+r', path.join(installBase, '/usr/lib/swift'));
94 | });
95 |
96 | await core.group('Cleaning up', async () => await io.rmRF(tempPath));
97 | }
98 |
99 | async function main() {
100 | switch (process.platform) {
101 | case 'linux': break;
102 | default: throw new Error('This action can only install Swift on linux!');
103 | }
104 |
105 | core.startGroup('Validate input');
106 | const swiftReleaseInput = core.getInput('release-version');
107 |
108 | let swiftRelease: string;
109 | let swiftBranch: string, swiftVersion: string;
110 | if (!swiftReleaseInput) {
111 | core.info('`release-version` was not set. Requiring `branch-name` and `version-tag` parameters!');
112 | swiftBranch = core.getInput('branch-name', { required: true });
113 | swiftVersion = core.getInput('version-tag', { required: true });
114 | swiftRelease = swiftReleaseInput;
115 | } else {
116 | const token = core.getInput('github-token');
117 | swiftRelease = token ? await findMatchingRelease(swiftReleaseInput, token) : swiftReleaseInput;
118 | swiftBranch = `swift-${swiftRelease}-release`;
119 | swiftVersion = `swift-${swiftRelease}-RELEASE`;
120 | }
121 |
122 | let swiftPlatform = core.getInput('platform')?.split('-').join('');
123 | if (!swiftPlatform) {
124 | core.info('Parameter `platform` was not set. Trying to determine platform...');
125 | const releaseInfo= await runCmd('lsb_release', '-sir');
126 | swiftPlatform = releaseInfo.split('\n').map(s => s.toLowerCase()).join('');
127 | core.info(`Using ${swiftPlatform} as platform.`);
128 | }
129 | const skipDependencies= core.getBooleanInput('skip-dependencies');
130 | const skipGPGCheck= core.getBooleanInput('skip-gpg-check');
131 | core.endGroup();
132 |
133 | if (!skipDependencies) {
134 | let dependencies: string[];
135 | // TODO: Add support for `yum`...
136 | switch (swiftPlatform) {
137 | case 'ubuntu18.04':
138 | dependencies = [
139 | 'binutils',
140 | 'git',
141 | 'libc6-dev',
142 | 'libcurl4',
143 | 'libedit2',
144 | 'libgcc-5-dev',
145 | 'libpython2.7',
146 | 'libsqlite3-0',
147 | 'libstdc++-5-dev',
148 | 'libxml2',
149 | 'pkg-config',
150 | 'tzdata',
151 | 'zlib1g-dev',
152 | ];
153 | break;
154 | case 'ubuntu20.04':
155 | dependencies = [
156 | 'binutils',
157 | 'git',
158 | 'gnupg2',
159 | 'libc6-dev',
160 | 'libcurl4',
161 | 'libedit2',
162 | 'libgcc-9-dev',
163 | 'libpython2.7',
164 | 'libsqlite3-0',
165 | 'libstdc++-9-dev',
166 | 'libxml2',
167 | 'libz3-dev',
168 | 'pkg-config',
169 | 'tzdata',
170 | 'uuid-dev',
171 | ];
172 | break;
173 | case 'ubuntu22.04':
174 | case 'ubuntu23.10':
175 | dependencies = [
176 | 'binutils',
177 | 'git',
178 | 'gnupg2',
179 | 'libc6-dev',
180 | 'libcurl4-openssl-dev',
181 | 'libedit2',
182 | 'libgcc-11-dev',
183 | 'libpython3-dev',
184 | 'libsqlite3-0',
185 | 'libstdc++-11-dev',
186 | 'libxml2-dev',
187 | 'libz3-dev',
188 | 'pkg-config',
189 | 'python3-lldb-13',
190 | 'tzdata',
191 | 'unzip',
192 | ];
193 | break;
194 | case 'ubuntu24.04':
195 | dependencies = [
196 | 'binutils',
197 | 'git',
198 | 'gnupg2',
199 | 'libc6-dev',
200 | 'libcurl4-openssl-dev',
201 | 'libedit2',
202 | 'libgcc-13-dev',
203 | 'libncurses-dev',
204 | 'libpython3-dev',
205 | 'libsqlite3-0',
206 | 'libstdc++-13-dev',
207 | 'libxml2-dev',
208 | 'libz3-dev',
209 | 'pkg-config',
210 | 'tzdata',
211 | 'unzip',
212 | ];
213 | break;
214 | default:
215 | dependencies = [];
216 | core.info(`Unknown platform '${swiftPlatform}' for dependency installation. Not installing anything...`);
217 | break;
218 | }
219 | if (dependencies.length > 0) {
220 | await core.group('Install dependencies', async () => {
221 | await runCmd('sudo', 'apt-get', '-q', 'update');
222 | await runCmd('sudo', 'apt-get', '-q', 'install', '-y', ...dependencies);
223 | });
224 | }
225 | } else {
226 | core.info('Skipping installation of dependencies...');
227 | }
228 |
229 | const versionIdentifier = `${swiftBranch}-${swiftVersion}-${swiftPlatform}`;
230 | const mangledName = `swift.${versionIdentifier}`;
231 | const cachedVersion = tools.find(mangledName, '1.0.0');
232 | const swiftInstallBase = path.join('/opt/swift', versionIdentifier);
233 | if (cachedVersion) {
234 | core.info('Using cached version!');
235 | await io.cp(cachedVersion, swiftInstallBase, { recursive: true });
236 | } else {
237 | await install(swiftInstallBase, swiftBranch, swiftVersion, swiftPlatform, skipGPGCheck);
238 | await tools.cacheDir(swiftInstallBase, mangledName, '1.0.0');
239 | }
240 |
241 | if (swiftRelease) {
242 | await core.group('Validating installation', async () => {
243 | const version = await runCmd(path.join(swiftInstallBase, '/usr/bin/swift'), '--version');
244 | if (!version.includes(swiftRelease))
245 | throw new Error(`Swift installation of version '${swiftRelease}' seems to have failed. 'swift --version' output: ${version}`);
246 | });
247 | }
248 |
249 | core.addPath(path.join(swiftInstallBase, '/usr/bin'));
250 | core.setOutput('install-path', swiftInstallBase);
251 | core.setOutput('full-version', swiftVersion);
252 | }
253 |
254 | try {
255 | main().catch(error => core.setFailed(error.message));
256 | } catch (error: any) {
257 | core.setFailed(error.message);
258 | }
259 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@tsconfig/node20/tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "lib",
5 | "rootDir": "src"
6 | },
7 | "include": ["src/**/*"]
8 | }
9 |
--------------------------------------------------------------------------------