├── .gitattributes ├── .github ├── dependabot.yml └── workflows │ └── workflow.yml ├── Dockerfile ├── LICENSE ├── README.md ├── action.yml ├── entrypoint.sh └── setup-flyctl ├── .gitignore ├── action.yml ├── biome.json ├── dist ├── LICENSE.txt └── index.js ├── package.json ├── pnpm-lock.yaml ├── src ├── constants.ts └── main.ts └── tsconfig.json /.gitattributes: -------------------------------------------------------------------------------- 1 | # Default behaviour, for if core.autocrlf isn't set 2 | * text=auto 3 | 4 | # the linguist-vendored/linguist-generated attribute suppresses changes being 5 | # displayed by default in pull requests. 6 | /setup-flyctl/dist/*.js -diff linguist-generated 7 | /setup-flyctl/dist/*.txt -diff linguist-generated 8 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: github-actions 4 | directory: / 5 | schedule: 6 | interval: daily 7 | - package-ecosystem: npm 8 | directories: 9 | - setup-flyctl 10 | schedule: 11 | interval: daily 12 | -------------------------------------------------------------------------------- /.github/workflows/workflow.yml: -------------------------------------------------------------------------------- 1 | name: Test Builds and Setup 2 | 3 | on: 4 | - push 5 | - pull_request 6 | 7 | permissions: read-all 8 | 9 | jobs: 10 | hygiene: 11 | name: Hygiene 12 | 13 | strategy: 14 | fail-fast: false 15 | matrix: 16 | action: 17 | - setup-flyctl 18 | 19 | defaults: 20 | run: 21 | working-directory: ${{ matrix.action }} 22 | 23 | runs-on: ubuntu-latest 24 | 25 | steps: 26 | - name: Checkout tree 27 | uses: actions/checkout@v4 28 | 29 | - name: Set-up Node.js 30 | uses: actions/setup-node@v4 31 | with: 32 | node-version: lts/* 33 | 34 | - run: corepack enable 35 | 36 | - run: pnpm install --frozen-lockfile 37 | 38 | - if: always() 39 | run: pnpm lint 40 | 41 | - if: always() 42 | run: pnpm typecheck 43 | 44 | - name: Ensure dist directory is up-to-date 45 | if: always() 46 | run: pnpm build && git diff --exit-code --ignore-cr-at-eol 47 | 48 | test-multi-platform-builds: 49 | name: Test multi-platform builds 50 | 51 | needs: 52 | - hygiene 53 | 54 | strategy: 55 | fail-fast: false 56 | matrix: 57 | os: 58 | - ubuntu-latest 59 | - macos-latest 60 | - windows-latest 61 | 62 | runs-on: ${{ matrix.os }} 63 | 64 | steps: 65 | - name: Checkout tree 66 | uses: actions/checkout@v4 67 | 68 | - name: Set-up flyctl 69 | uses: ./setup-flyctl 70 | 71 | - run: flyctl version 72 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | 3 | RUN apk add --no-cache curl 4 | 5 | RUN curl -L https://fly.io/install.sh | FLYCTL_INSTALL=/usr/local sh 6 | 7 | COPY entrypoint.sh /entrypoint.sh 8 | 9 | ENTRYPOINT ["/entrypoint.sh"] 10 | -------------------------------------------------------------------------------- /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 | # Automate Fly.io app deployment 2 | 3 | This action wraps the [Fly.io CLI](https://github.com/superfly/flyctl). Use it to deploy or manage your Fly.io application via [Github Actions events](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows). 4 | ## Usage for Deployment 5 | 6 | > 7 | > 8 | > Tip 9 | >
10 | > 11 | > For production deployments, [pin flyctl to a specific version][pinning] to avoid unexpected behavior in edge releases. 12 | 13 | [pinning]: #pin-to-a-specific-version-of-flyctl 14 | 15 | ```yaml 16 | name: Deploy to Fly 17 | on: [push] 18 | jobs: 19 | deploy: 20 | name: Deploy proxy 21 | runs-on: ubuntu-latest 22 | steps: 23 | # This step checks out a copy of your repository. 24 | - uses: actions/checkout@v2 25 | - uses: superfly/flyctl-actions/setup-flyctl@master 26 | - run: flyctl deploy --remote-only 27 | env: 28 | FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} 29 | ``` 30 | 31 | ### Pin to a specific version of `flyctl`: 32 | 33 | ```yaml 34 | - uses: superfly/flyctl-actions/setup-flyctl@master 35 | with: 36 | version: 0.0.462 37 | ``` 38 | ### Running one-off scripts 39 | 40 | ```yaml 41 | name: Run on Fly 42 | on: [push] 43 | jobs: 44 | deploy: 45 | name: Run script 46 | runs-on: ubuntu-latest 47 | steps: 48 | - uses: actions/checkout@v2 49 | - uses: superfly/flyctl-actions/setup-flyctl@master 50 | - run: "flyctl ssh console --command 'sh ./myscript.sh'" 51 | env: 52 | FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} 53 | ``` 54 | 55 | See the [flyctl](https://github.com/superfly/flyctl) GitHub project for more information on using `flyctl`. 56 | 57 | ## Secrets 58 | 59 | `FLY_API_TOKEN` - **Required**. The token to use for authentication. You can find a token by running `flyctl auth token` or going to your [user settings on fly.io](https://fly.io/user/personal_access_tokens). 60 | 61 | ## Using the `setup-flyctl` action 62 | 63 | This documentation only covers usage of the `setup-flyctl` action. The main action in this repository runs more slowly inside Docker, so is not recommended. It's been kept in place since many CI pipelines are still using it. 64 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: "GitHub Action for flyctl" 2 | description: "Wraps the flyctl CLI tool to enable deploying and managing Fly apps" 3 | author: Fly 4 | branding: 5 | icon: "upload-cloud" 6 | color: "purple" 7 | runs: 8 | using: "docker" 9 | image: "Dockerfile" 10 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -l 2 | 3 | if [ -n "$FLY_PROJECT_PATH" ]; then 4 | PREV_PATH=$(pwd) 5 | # Allow user to change directories in which to run Fly commands 6 | cd "$FLY_PROJECT_PATH" || exit 7 | fi 8 | 9 | 10 | # Default to deploying with a remote builder unless local is specified explicitly 11 | STRATEGY="--remote-only" 12 | 13 | for i in "$@" ; do 14 | if [[ $i == "--local-only" ]] ; then 15 | STRATEGY="" 16 | break 17 | fi 18 | done 19 | 20 | if [[ $1 != "deploy" ]] ; then 21 | # Strategy only relevant to deployments so strip if not a deploy 22 | STRATEGY="" 23 | fi 24 | 25 | sh -c "flyctl $* $STRATEGY" 26 | 27 | ACTUAL_EXIT="$?" 28 | 29 | if [ -n "$PREV_PATH" ]; then 30 | # If we changed directories before, we should go back to where we were. 31 | cd "$PREV_PATH" || exit 32 | fi 33 | 34 | exit $ACTUAL_EXIT 35 | -------------------------------------------------------------------------------- /setup-flyctl/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | -------------------------------------------------------------------------------- /setup-flyctl/action.yml: -------------------------------------------------------------------------------- 1 | name: Set up flyctl 2 | description: Installs the flyctl CLI tool to enable deploying and managing Fly apps 3 | author: Fly 4 | branding: 5 | icon: upload-cloud 6 | color: purple 7 | runs: 8 | using: node20 9 | main: dist/index.js 10 | inputs: 11 | version: 12 | description: |- 13 | Version of the flyctl CLI to install. If unspecified or set to "latest", 14 | the latest version for the target platform will be installed. Example: "0.0.306". 15 | default: latest 16 | required: false 17 | -------------------------------------------------------------------------------- /setup-flyctl/biome.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/@biomejs/biome/configuration_schema.json", 3 | "files": { 4 | "ignore": ["package.json", "dist"] 5 | }, 6 | "formatter": { 7 | "enabled": true, 8 | "indentStyle": "space" 9 | }, 10 | "linter": { 11 | "enabled": true, 12 | "rules": { 13 | "recommended": true 14 | } 15 | }, 16 | "organizeImports": { 17 | "enabled": true 18 | }, 19 | "vcs": { 20 | "clientKind": "git", 21 | "enabled": true, 22 | "useIgnoreFile": true 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /setup-flyctl/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/http-client 26 | MIT 27 | Actions Http Client for Node.js 28 | 29 | Copyright (c) GitHub, Inc. 30 | 31 | All rights reserved. 32 | 33 | MIT License 34 | 35 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 36 | associated documentation files (the "Software"), to deal in the Software without restriction, 37 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 38 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 39 | subject to the following conditions: 40 | 41 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 42 | 43 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 44 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 45 | NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 46 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 47 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 48 | 49 | 50 | @actions/io 51 | MIT 52 | The MIT License (MIT) 53 | 54 | Copyright 2019 GitHub 55 | 56 | 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: 57 | 58 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 59 | 60 | 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. 61 | 62 | @actions/tool-cache 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 | @fastify/busboy 75 | MIT 76 | Copyright Brian White. All rights reserved. 77 | 78 | Permission is hereby granted, free of charge, to any person obtaining a copy 79 | of this software and associated documentation files (the "Software"), to 80 | deal in the Software without restriction, including without limitation the 81 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 82 | sell copies of the Software, and to permit persons to whom the Software is 83 | furnished to do so, subject to the following conditions: 84 | 85 | The above copyright notice and this permission notice shall be included in 86 | all copies or substantial portions of the Software. 87 | 88 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 89 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 90 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 91 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 92 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 93 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 94 | IN THE SOFTWARE. 95 | 96 | semver 97 | ISC 98 | The ISC License 99 | 100 | Copyright (c) Isaac Z. Schlueter and Contributors 101 | 102 | Permission to use, copy, modify, and/or distribute this software for any 103 | purpose with or without fee is hereby granted, provided that the above 104 | copyright notice and this permission notice appear in all copies. 105 | 106 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 107 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 108 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 109 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 110 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 111 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 112 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 113 | 114 | 115 | tunnel 116 | MIT 117 | The MIT License (MIT) 118 | 119 | Copyright (c) 2012 Koichi Kobayashi 120 | 121 | Permission is hereby granted, free of charge, to any person obtaining a copy 122 | of this software and associated documentation files (the "Software"), to deal 123 | in the Software without restriction, including without limitation the rights 124 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 125 | copies of the Software, and to permit persons to whom the Software is 126 | furnished to do so, subject to the following conditions: 127 | 128 | The above copyright notice and this permission notice shall be included in 129 | all copies or substantial portions of the Software. 130 | 131 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 132 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 133 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 134 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 135 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 136 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 137 | THE SOFTWARE. 138 | 139 | 140 | undici 141 | MIT 142 | MIT License 143 | 144 | Copyright (c) Matteo Collina and Undici contributors 145 | 146 | Permission is hereby granted, free of charge, to any person obtaining a copy 147 | of this software and associated documentation files (the "Software"), to deal 148 | in the Software without restriction, including without limitation the rights 149 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 150 | copies of the Software, and to permit persons to whom the Software is 151 | furnished to do so, subject to the following conditions: 152 | 153 | The above copyright notice and this permission notice shall be included in all 154 | copies or substantial portions of the Software. 155 | 156 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 157 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 158 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 159 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 160 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 161 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 162 | SOFTWARE. 163 | 164 | 165 | uuid 166 | MIT 167 | The MIT License (MIT) 168 | 169 | Copyright (c) 2010-2020 Robert Kieffer and other contributors 170 | 171 | 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: 172 | 173 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 174 | 175 | 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. 176 | -------------------------------------------------------------------------------- /setup-flyctl/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "build": "ncc build src/main.ts --license LICENSE.txt --out dist", 5 | "fix": "biome check --fix", 6 | "lint": "biome check", 7 | "typecheck": "tsc" 8 | }, 9 | "dependencies": { 10 | "@actions/core": "1.10.1", 11 | "@actions/http-client": "2.2.1", 12 | "@actions/tool-cache": "2.0.1" 13 | }, 14 | "devDependencies": { 15 | "@biomejs/biome": "1.8.3", 16 | "@tsconfig/node20": "20.1.4", 17 | "@tsconfig/strictest": "2.0.5", 18 | "@types/node": "22.1.0", 19 | "@vercel/ncc": "0.38.1", 20 | "typescript": "5.5.4" 21 | }, 22 | "packageManager": "pnpm@9.6.0" 23 | } 24 | -------------------------------------------------------------------------------- /setup-flyctl/pnpm-lock.yaml: -------------------------------------------------------------------------------- 1 | lockfileVersion: '9.0' 2 | 3 | settings: 4 | autoInstallPeers: true 5 | excludeLinksFromLockfile: false 6 | 7 | importers: 8 | 9 | .: 10 | dependencies: 11 | '@actions/core': 12 | specifier: 1.10.1 13 | version: 1.10.1 14 | '@actions/http-client': 15 | specifier: 2.2.1 16 | version: 2.2.1 17 | '@actions/tool-cache': 18 | specifier: 2.0.1 19 | version: 2.0.1 20 | devDependencies: 21 | '@biomejs/biome': 22 | specifier: 1.8.3 23 | version: 1.8.3 24 | '@tsconfig/node20': 25 | specifier: 20.1.4 26 | version: 20.1.4 27 | '@tsconfig/strictest': 28 | specifier: 2.0.5 29 | version: 2.0.5 30 | '@types/node': 31 | specifier: 22.1.0 32 | version: 22.1.0 33 | '@vercel/ncc': 34 | specifier: 0.38.1 35 | version: 0.38.1 36 | typescript: 37 | specifier: 5.5.4 38 | version: 5.5.4 39 | 40 | packages: 41 | 42 | '@actions/core@1.10.1': 43 | resolution: {integrity: sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==} 44 | 45 | '@actions/exec@1.1.1': 46 | resolution: {integrity: sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==} 47 | 48 | '@actions/http-client@2.2.1': 49 | resolution: {integrity: sha512-KhC/cZsq7f8I4LfZSJKgCvEwfkE8o1538VoBeoGzokVLLnbFDEAdFD3UhoMklxo2un9NJVBdANOresx7vTHlHw==} 50 | 51 | '@actions/io@1.1.3': 52 | resolution: {integrity: sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==} 53 | 54 | '@actions/tool-cache@2.0.1': 55 | resolution: {integrity: sha512-iPU+mNwrbA8jodY8eyo/0S/QqCKDajiR8OxWTnSk/SnYg0sj8Hp4QcUEVC1YFpHWXtrfbQrE13Jz4k4HXJQKcA==} 56 | 57 | '@biomejs/biome@1.8.3': 58 | resolution: {integrity: sha512-/uUV3MV+vyAczO+vKrPdOW0Iaet7UnJMU4bNMinggGJTAnBPjCoLEYcyYtYHNnUNYlv4xZMH6hVIQCAozq8d5w==} 59 | engines: {node: '>=14.21.3'} 60 | hasBin: true 61 | 62 | '@biomejs/cli-darwin-arm64@1.8.3': 63 | resolution: {integrity: sha512-9DYOjclFpKrH/m1Oz75SSExR8VKvNSSsLnVIqdnKexj6NwmiMlKk94Wa1kZEdv6MCOHGHgyyoV57Cw8WzL5n3A==} 64 | engines: {node: '>=14.21.3'} 65 | cpu: [arm64] 66 | os: [darwin] 67 | 68 | '@biomejs/cli-darwin-x64@1.8.3': 69 | resolution: {integrity: sha512-UeW44L/AtbmOF7KXLCoM+9PSgPo0IDcyEUfIoOXYeANaNXXf9mLUwV1GeF2OWjyic5zj6CnAJ9uzk2LT3v/wAw==} 70 | engines: {node: '>=14.21.3'} 71 | cpu: [x64] 72 | os: [darwin] 73 | 74 | '@biomejs/cli-linux-arm64-musl@1.8.3': 75 | resolution: {integrity: sha512-9yjUfOFN7wrYsXt/T/gEWfvVxKlnh3yBpnScw98IF+oOeCYb5/b/+K7YNqKROV2i1DlMjg9g/EcN9wvj+NkMuQ==} 76 | engines: {node: '>=14.21.3'} 77 | cpu: [arm64] 78 | os: [linux] 79 | 80 | '@biomejs/cli-linux-arm64@1.8.3': 81 | resolution: {integrity: sha512-fed2ji8s+I/m8upWpTJGanqiJ0rnlHOK3DdxsyVLZQ8ClY6qLuPc9uehCREBifRJLl/iJyQpHIRufLDeotsPtw==} 82 | engines: {node: '>=14.21.3'} 83 | cpu: [arm64] 84 | os: [linux] 85 | 86 | '@biomejs/cli-linux-x64-musl@1.8.3': 87 | resolution: {integrity: sha512-UHrGJX7PrKMKzPGoEsooKC9jXJMa28TUSMjcIlbDnIO4EAavCoVmNQaIuUSH0Ls2mpGMwUIf+aZJv657zfWWjA==} 88 | engines: {node: '>=14.21.3'} 89 | cpu: [x64] 90 | os: [linux] 91 | 92 | '@biomejs/cli-linux-x64@1.8.3': 93 | resolution: {integrity: sha512-I8G2QmuE1teISyT8ie1HXsjFRz9L1m5n83U1O6m30Kw+kPMPSKjag6QGUn+sXT8V+XWIZxFFBoTDEDZW2KPDDw==} 94 | engines: {node: '>=14.21.3'} 95 | cpu: [x64] 96 | os: [linux] 97 | 98 | '@biomejs/cli-win32-arm64@1.8.3': 99 | resolution: {integrity: sha512-J+Hu9WvrBevfy06eU1Na0lpc7uR9tibm9maHynLIoAjLZpQU3IW+OKHUtyL8p6/3pT2Ju5t5emReeIS2SAxhkQ==} 100 | engines: {node: '>=14.21.3'} 101 | cpu: [arm64] 102 | os: [win32] 103 | 104 | '@biomejs/cli-win32-x64@1.8.3': 105 | resolution: {integrity: sha512-/PJ59vA1pnQeKahemaQf4Nyj7IKUvGQSc3Ze1uIGi+Wvr1xF7rGobSrAAG01T/gUDG21vkDsZYM03NAmPiVkqg==} 106 | engines: {node: '>=14.21.3'} 107 | cpu: [x64] 108 | os: [win32] 109 | 110 | '@fastify/busboy@2.1.1': 111 | resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} 112 | engines: {node: '>=14'} 113 | 114 | '@tsconfig/node20@20.1.4': 115 | resolution: {integrity: sha512-sqgsT69YFeLWf5NtJ4Xq/xAF8p4ZQHlmGW74Nu2tD4+g5fAsposc4ZfaaPixVu4y01BEiDCWLRDCvDM5JOsRxg==} 116 | 117 | '@tsconfig/strictest@2.0.5': 118 | resolution: {integrity: sha512-ec4tjL2Rr0pkZ5hww65c+EEPYwxOi4Ryv+0MtjeaSQRJyq322Q27eOQiFbuNgw2hpL4hB1/W/HBGk3VKS43osg==} 119 | 120 | '@types/node@22.1.0': 121 | resolution: {integrity: sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw==} 122 | 123 | '@vercel/ncc@0.38.1': 124 | resolution: {integrity: sha512-IBBb+iI2NLu4VQn3Vwldyi2QwaXt5+hTyh58ggAMoCGE6DJmPvwL3KPBWcJl1m9LYPChBLE980Jw+CS4Wokqxw==} 125 | hasBin: true 126 | 127 | semver@6.3.1: 128 | resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} 129 | hasBin: true 130 | 131 | tunnel@0.0.6: 132 | resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==} 133 | engines: {node: '>=0.6.11 <=0.7.0 || >=0.7.3'} 134 | 135 | typescript@5.5.4: 136 | resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} 137 | engines: {node: '>=14.17'} 138 | hasBin: true 139 | 140 | undici-types@6.13.0: 141 | resolution: {integrity: sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg==} 142 | 143 | undici@5.28.4: 144 | resolution: {integrity: sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==} 145 | engines: {node: '>=14.0'} 146 | 147 | uuid@3.4.0: 148 | resolution: {integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==} 149 | deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. 150 | hasBin: true 151 | 152 | uuid@8.3.2: 153 | resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} 154 | hasBin: true 155 | 156 | snapshots: 157 | 158 | '@actions/core@1.10.1': 159 | dependencies: 160 | '@actions/http-client': 2.2.1 161 | uuid: 8.3.2 162 | 163 | '@actions/exec@1.1.1': 164 | dependencies: 165 | '@actions/io': 1.1.3 166 | 167 | '@actions/http-client@2.2.1': 168 | dependencies: 169 | tunnel: 0.0.6 170 | undici: 5.28.4 171 | 172 | '@actions/io@1.1.3': {} 173 | 174 | '@actions/tool-cache@2.0.1': 175 | dependencies: 176 | '@actions/core': 1.10.1 177 | '@actions/exec': 1.1.1 178 | '@actions/http-client': 2.2.1 179 | '@actions/io': 1.1.3 180 | semver: 6.3.1 181 | uuid: 3.4.0 182 | 183 | '@biomejs/biome@1.8.3': 184 | optionalDependencies: 185 | '@biomejs/cli-darwin-arm64': 1.8.3 186 | '@biomejs/cli-darwin-x64': 1.8.3 187 | '@biomejs/cli-linux-arm64': 1.8.3 188 | '@biomejs/cli-linux-arm64-musl': 1.8.3 189 | '@biomejs/cli-linux-x64': 1.8.3 190 | '@biomejs/cli-linux-x64-musl': 1.8.3 191 | '@biomejs/cli-win32-arm64': 1.8.3 192 | '@biomejs/cli-win32-x64': 1.8.3 193 | 194 | '@biomejs/cli-darwin-arm64@1.8.3': 195 | optional: true 196 | 197 | '@biomejs/cli-darwin-x64@1.8.3': 198 | optional: true 199 | 200 | '@biomejs/cli-linux-arm64-musl@1.8.3': 201 | optional: true 202 | 203 | '@biomejs/cli-linux-arm64@1.8.3': 204 | optional: true 205 | 206 | '@biomejs/cli-linux-x64-musl@1.8.3': 207 | optional: true 208 | 209 | '@biomejs/cli-linux-x64@1.8.3': 210 | optional: true 211 | 212 | '@biomejs/cli-win32-arm64@1.8.3': 213 | optional: true 214 | 215 | '@biomejs/cli-win32-x64@1.8.3': 216 | optional: true 217 | 218 | '@fastify/busboy@2.1.1': {} 219 | 220 | '@tsconfig/node20@20.1.4': {} 221 | 222 | '@tsconfig/strictest@2.0.5': {} 223 | 224 | '@types/node@22.1.0': 225 | dependencies: 226 | undici-types: 6.13.0 227 | 228 | '@vercel/ncc@0.38.1': {} 229 | 230 | semver@6.3.1: {} 231 | 232 | tunnel@0.0.6: {} 233 | 234 | typescript@5.5.4: {} 235 | 236 | undici-types@6.13.0: {} 237 | 238 | undici@5.28.4: 239 | dependencies: 240 | '@fastify/busboy': 2.1.1 241 | 242 | uuid@3.4.0: {} 243 | 244 | uuid@8.3.2: {} 245 | -------------------------------------------------------------------------------- /setup-flyctl/src/constants.ts: -------------------------------------------------------------------------------- 1 | import * as core from "@actions/core"; 2 | 3 | export const VERSION = core.getInput("version"); 4 | 5 | export const ARCHITECTURE = (() => { 6 | const arch = process.arch; 7 | switch (arch) { 8 | case "arm64": { 9 | return "arm64"; 10 | } 11 | case "x64": { 12 | return "x86_64"; 13 | } 14 | default: { 15 | throw new Error(arch); 16 | } 17 | } 18 | })(); 19 | 20 | export const PLATFORM = (() => { 21 | const platform = process.platform; 22 | switch (platform) { 23 | case "darwin": { 24 | return "macOS"; 25 | } 26 | case "linux": { 27 | return "Linux"; 28 | } 29 | case "win32": { 30 | return "Windows"; 31 | } 32 | default: { 33 | throw new Error(platform); 34 | } 35 | } 36 | })(); 37 | -------------------------------------------------------------------------------- /setup-flyctl/src/main.ts: -------------------------------------------------------------------------------- 1 | import * as core from "@actions/core"; 2 | import * as http from "@actions/http-client"; 3 | import * as toolCache from "@actions/tool-cache"; 4 | import { ARCHITECTURE, PLATFORM, VERSION } from "./constants.js"; 5 | 6 | const client = new http.HttpClient("setup-flyctl", [], { 7 | allowRetries: true, 8 | maxRetries: 3, 9 | }); 10 | 11 | async function run() { 12 | // Resolve the version to a specific download via the Fly API 13 | const { url, resolvedVersion } = await resolveVersion(VERSION); 14 | 15 | // Install the resolved version if necessary 16 | const toolPath = toolCache.find("flyctl", resolvedVersion, ARCHITECTURE); 17 | if (toolPath) { 18 | core.addPath(toolPath); 19 | } else { 20 | await installFlyctl(url, resolvedVersion); 21 | } 22 | } 23 | 24 | async function resolveVersion(version: string) { 25 | const res = await client.get( 26 | `https://api.fly.io/app/flyctl_releases/${PLATFORM}/${ARCHITECTURE}/${version}`, 27 | ); 28 | const body = await res.readBody(); 29 | if (!res.message.statusCode || res.message.statusCode >= 400) 30 | throw new Error(body); 31 | const matches = body.match( 32 | /superfly\/flyctl\/releases\/download\/v(\d+\.\d+\.\d+)/, 33 | ); 34 | const resolvedVersion = matches?.[1] ? matches[1] : version; 35 | return { url: body, resolvedVersion }; 36 | } 37 | 38 | async function installFlyctl(url: string, resolvedVersion: string) { 39 | const downloadedPath = await toolCache.downloadTool(url); 40 | core.info(`Acquired ${resolvedVersion} from ${url}`); 41 | const extractedPath = 42 | PLATFORM === "Windows" 43 | ? await toolCache.extractZip(downloadedPath) 44 | : await toolCache.extractTar(downloadedPath); 45 | const cachedPath = await toolCache.cacheDir( 46 | extractedPath, 47 | "flyctl", 48 | resolvedVersion, 49 | ARCHITECTURE, 50 | ); 51 | core.info(`Successfully cached flyctl to ${cachedPath}`); 52 | core.addPath(cachedPath); 53 | core.info("Added flyctl to the path"); 54 | } 55 | 56 | run().catch((error) => { 57 | if (error instanceof Error) { 58 | core.setFailed(error.message); 59 | } else { 60 | core.setFailed(`${error}`); 61 | } 62 | }); 63 | -------------------------------------------------------------------------------- /setup-flyctl/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "@tsconfig/strictest/tsconfig.json", 4 | "@tsconfig/node20/tsconfig.json" 5 | ], 6 | "compilerOptions": { 7 | "module": "NodeNext", 8 | "moduleDetection": "force", 9 | "moduleResolution": "NodeNext", 10 | "noEmit": true 11 | }, 12 | "exclude": ["dist"] 13 | } 14 | --------------------------------------------------------------------------------