mirror of
https://github.com/expo/expo-github-action.git
synced 2026-11-15 17:32:45 -10:00
Compare commits
24
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1176352a0b | ||
|
|
b54de34e8d | ||
|
|
bc61229346 | ||
|
|
ec8dc84b62 | ||
|
|
f6f3acfa27 | ||
|
|
0db524a726 | ||
|
|
2c58ed4848 | ||
|
|
42a964bd6f | ||
|
|
cea45074d9 | ||
|
|
47703a0179 | ||
|
|
526dc5f131 | ||
|
|
190a2cdf2b | ||
|
|
15896ae746 | ||
|
|
c7b66a9c32 | ||
|
|
b8a9be8336 | ||
|
|
b547b4d94a | ||
|
|
54efbfdf1d | ||
|
|
ccfad6f148 | ||
|
|
6a82be3e3e | ||
|
|
020be2c617 | ||
|
|
331a5abc41 | ||
|
|
42d64cf920 | ||
|
|
65ee05557f | ||
|
|
b3e53555d9 |
No files matched your search
+1
-1
@@ -3,4 +3,4 @@
|
||||
* text=auto
|
||||
|
||||
# These files are text and should be normalized (Convert crlf => lf)
|
||||
build/** text eol=lf
|
||||
build/** text eol=lf linguist-generated=true
|
||||
@@ -8,7 +8,7 @@ inputs:
|
||||
|
||||
node-version:
|
||||
description: Version of Node to use
|
||||
default: 18.x
|
||||
default: 20.x
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
|
||||
@@ -38,6 +38,8 @@ jobs:
|
||||
steps:
|
||||
- name: 🏗 Setup repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.EXPOBOT_GITHUB_TOKEN }}
|
||||
|
||||
- name: 🏗 Setup runner
|
||||
uses: ./.github/actions/setup
|
||||
|
||||
@@ -84,11 +84,16 @@ jobs:
|
||||
- name: 🏗 Setup project
|
||||
run: bun create expo ./temp --template blank
|
||||
|
||||
- name: 🏗 Setup `expo-dev-client`
|
||||
working-directory: ./temp
|
||||
run: bun expo install expo-dev-client
|
||||
|
||||
- name: 👷 Configure project
|
||||
working-directory: ./temp
|
||||
run: |
|
||||
eas init --id ${{ secrets.EXPO_PROJECT_ID }} --force --non-interactive
|
||||
echo $(jq '.expo.runtimeVersion.policy = "sdkVersion"' app.json) > app.json
|
||||
echo $(jq '.expo.scheme = ["expogithubaction", "ega"]' app.json) > app.json
|
||||
|
||||
- name: 🚀 Create preview (without comment)
|
||||
if: ${{ env.hasAuth == 'true' }}
|
||||
@@ -164,6 +169,51 @@ jobs:
|
||||
throw new Error('Message output is empty');
|
||||
}
|
||||
|
||||
- name: 🚀 Create preview (with "dev-build" QR target)
|
||||
if: ${{ env.hasAuth == 'true' }}
|
||||
uses: ./preview
|
||||
id: dev-build-qr
|
||||
env:
|
||||
EXPO_TEST_GITHUB_PULL: 206
|
||||
with:
|
||||
working-directory: ./temp
|
||||
command: eas update --branch test --message "This is a test"
|
||||
comment: false
|
||||
|
||||
- name: 🧪 Comment has "dev-build" QR
|
||||
if: ${{ env.hasAuth == 'true' }}
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const qrUrl = `${{ steps.dev-build-qr.outputs.qr }}`
|
||||
if (!qrUrl || !qrUrl.includes('appScheme')) {
|
||||
console.log({ qrUrl });
|
||||
throw new Error('QR URL is missing "appScheme" to point to a dev build');
|
||||
}
|
||||
|
||||
- name: 🚀 Create preview (with "expo-go" QR target from input)
|
||||
if: ${{ env.hasAuth == 'true' }}
|
||||
uses: ./preview
|
||||
id: expo-go-qr
|
||||
env:
|
||||
EXPO_TEST_GITHUB_PULL: 206
|
||||
with:
|
||||
working-directory: ./temp
|
||||
qr-target: expo-go
|
||||
command: eas update --branch test --message "This is a test"
|
||||
comment: false
|
||||
|
||||
- name: 🧪 Comment has "expo-go" QR code
|
||||
if: ${{ env.hasAuth == 'true' }}
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const qrUrl = `${{ steps.expo-go-qr.outputs.qr }}`
|
||||
if (!qrUrl || qrUrl.includes('appScheme')) {
|
||||
console.log({ qrUrl });
|
||||
throw new Error('QR URL points to a dev build, not Expo Go');
|
||||
}
|
||||
|
||||
preview-comment:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
@@ -1,3 +1,56 @@
|
||||
## [8.2.1](https://github.com/expo/expo-github-action/compare/8.2.0...8.2.1) (2024-01-15)
|
||||
|
||||
|
||||
### Bug fixes
|
||||
|
||||
* **preview:** filter slugs with special characters to match dev clients `exp+<slug>` scheme ([#252](https://github.com/expo/expo-github-action/issues/252)) ([b8a9be8](https://github.com/expo/expo-github-action/commit/b8a9be8336bf5609f8e299a8486f9a2bf7073f8a))
|
||||
|
||||
## [8.2.0](https://github.com/expo/expo-github-action/compare/8.1.0...8.2.0) (2023-12-02)
|
||||
|
||||
|
||||
### New features
|
||||
|
||||
* **preview:** add `qr-target` and use proper QR codes for `expo-go` and `dev-build` ([#247](https://github.com/expo/expo-github-action/issues/247)) ([54efbfd](https://github.com/expo/expo-github-action/commit/54efbfdf1d130888a5f13b73fb7adc85edeb8855))
|
||||
|
||||
|
||||
### Documentation changes
|
||||
|
||||
* **preview:** clarify the branch and workflow trigger relations ([#246](https://github.com/expo/expo-github-action/issues/246)) ([ccfad6f](https://github.com/expo/expo-github-action/commit/ccfad6f148eaa709959a64b1be216481f4ca54ff))
|
||||
|
||||
## [8.1.0](https://github.com/expo/expo-github-action/compare/8.0.0...8.1.0) (2023-11-24)
|
||||
|
||||
|
||||
### New features
|
||||
|
||||
* add fingerprint integration ([#231](https://github.com/expo/expo-github-action/issues/231)) ([e6622e0](https://github.com/expo/expo-github-action/commit/e6622e076de31220ec97e3d7494de70cf1ab85b2))
|
||||
* add readme for preview-build and fingerprint action ([#232](https://github.com/expo/expo-github-action/issues/232)) ([acc171b](https://github.com/expo/expo-github-action/commit/acc171bb5e34cd76bf152307e562bb49e7743b94)), closes [/github.com/expo/expo-github-action/pull/231#pullrequestreview-1628540314](https://github.com/expo//github.com/expo/expo-github-action/pull/231/issues/pullrequestreview-1628540314)
|
||||
* **preview:** add update manifest permalinks to the output ([#245](https://github.com/expo/expo-github-action/issues/245)) ([331a5ab](https://github.com/expo/expo-github-action/commit/331a5abc4196b7590363c2b3ec842a0a17f98fa2))
|
||||
|
||||
|
||||
### Bug fixes
|
||||
|
||||
* **preview:** allow multiple `app.json` schemes ([#244](https://github.com/expo/expo-github-action/issues/244)) ([42d64cf](https://github.com/expo/expo-github-action/commit/42d64cf92010d7210784c0f30bcaa611d8bae55d))
|
||||
|
||||
|
||||
### Code changes
|
||||
|
||||
* update error handling to node 20 standards ([#243](https://github.com/expo/expo-github-action/issues/243)) ([65ee055](https://github.com/expo/expo-github-action/commit/65ee05557f89a7804e36b2d3fe4f3d33aea7011a))
|
||||
* update workflows and repository to use Bun ([#241](https://github.com/expo/expo-github-action/issues/241)) ([7f1c170](https://github.com/expo/expo-github-action/commit/7f1c170873ddbadfb0ba311dd94b43d14c795ee3))
|
||||
* upgrade all actions to run on node 20 ([#242](https://github.com/expo/expo-github-action/issues/242)) ([b3e5355](https://github.com/expo/expo-github-action/commit/b3e53555d9effcab01011226c5e811c263a449cb))
|
||||
|
||||
|
||||
### Other chores
|
||||
|
||||
* **ci:** update release flow with new service account ([#238](https://github.com/expo/expo-github-action/issues/238)) ([e289d93](https://github.com/expo/expo-github-action/commit/e289d93e119801f899eb2b94d80d92718172dba3))
|
||||
* update release workflow actions ([#239](https://github.com/expo/expo-github-action/issues/239)) ([57dcabe](https://github.com/expo/expo-github-action/commit/57dcabe749340c8c995ee0334cd7c547c35770d0))
|
||||
|
||||
|
||||
### Documentation changes
|
||||
|
||||
* add link to breaking change pull request ([9e1a8c8](https://github.com/expo/expo-github-action/commit/9e1a8c8343d0f9405717e103c71e2e3ce9286bbc))
|
||||
* fix changelog link in readme ([185932d](https://github.com/expo/expo-github-action/commit/185932d43cd424c08c2d530a3cedad352d66e78e))
|
||||
* update example to use `eas-version` ([#222](https://github.com/expo/expo-github-action/issues/222)) ([7bc946c](https://github.com/expo/expo-github-action/commit/7bc946c5f6b768b1a1858c1722b3aac4e0064c23))
|
||||
|
||||
## [8.0.0](https://github.com/expo/expo-github-action/compare/7.2.1...8.0.0) (2023-02-20)
|
||||
|
||||
|
||||
|
||||
@@ -174,7 +174,9 @@ jobs:
|
||||
- name: 🚀 Create preview
|
||||
uses: expo/expo-github-action/preview@v8
|
||||
with:
|
||||
command: eas update --auto
|
||||
# `github.event.pull_request.head.ref` is only available on `pull_request` triggers.
|
||||
# Use your own, or keep the automatically infered branch name from `--auto`, when using different triggers.
|
||||
command: eas update --auto --branch ${{ github.event.pull_request.head.ref }}
|
||||
```
|
||||
|
||||
## Things to know
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ branding:
|
||||
icon: terminal
|
||||
color: gray-dark
|
||||
runs:
|
||||
using: node16
|
||||
using: node20
|
||||
main: build/setup/index.js
|
||||
inputs:
|
||||
expo-version:
|
||||
|
||||
Generated
+678
-629
File diff suppressed because it is too large.
Load diff
+44772
File diff suppressed because it is too large.
Load diff
+835
@@ -0,0 +1,835 @@
|
||||
@actions/core
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
@actions/exec
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
@actions/github
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
@actions/http-client
|
||||
MIT
|
||||
Actions Http Client for Node.js
|
||||
|
||||
Copyright (c) GitHub, Inc.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
MIT License
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@actions/io
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
@actions/tool-cache
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
@fastify/busboy
|
||||
MIT
|
||||
Copyright Brian White. All rights reserved.
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
@octokit/auth-token
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2019 Octokit contributors
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@octokit/core
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2019 Octokit contributors
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@octokit/endpoint
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2018 Octokit contributors
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@octokit/graphql
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2018 Octokit contributors
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@octokit/plugin-paginate-rest
|
||||
MIT
|
||||
MIT License Copyright (c) 2019 Octokit contributors
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@octokit/plugin-rest-endpoint-methods
|
||||
MIT
|
||||
MIT License Copyright (c) 2019 Octokit contributors
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@octokit/request
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2018 Octokit contributors
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@octokit/request-error
|
||||
MIT
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2019 Octokit contributors
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
before-after-hook
|
||||
Apache-2.0
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2018 Gregor Martynus and other contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
||||
deprecation
|
||||
ISC
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Gregor Martynus and contributors
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
encoding
|
||||
MIT
|
||||
Copyright (c) 2012-2014 Andris Reinman
|
||||
|
||||
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:
|
||||
|
||||
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.
|
||||
|
||||
|
||||
iconv-lite
|
||||
MIT
|
||||
Copyright (c) 2011 Alexander Shtuchkin
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
|
||||
is-plain-object
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
lru-cache
|
||||
ISC
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
node-fetch
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 David Frank
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
|
||||
once
|
||||
ISC
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
safer-buffer
|
||||
MIT
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 Nikita Skovoroda <[email protected]>
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
semver
|
||||
ISC
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
tr46
|
||||
MIT
|
||||
|
||||
tunnel
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2012 Koichi Kobayashi
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
undici
|
||||
MIT
|
||||
MIT License
|
||||
|
||||
Copyright (c) Matteo Collina and Undici contributors
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
universal-user-agent
|
||||
ISC
|
||||
# [ISC License](https://spdx.org/licenses/ISC)
|
||||
|
||||
Copyright (c) 2018, Gregor Martynus (https://github.com/gr2m)
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
uuid
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2010-2020 Robert Kieffer and other contributors
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
webidl-conversions
|
||||
BSD-2-Clause
|
||||
# The BSD 2-Clause License
|
||||
|
||||
Copyright (c) 2014, Domenic Denicola
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
whatwg-url
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015–2016 Sebastian Mayr
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
wrappy
|
||||
ISC
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
yallist
|
||||
ISC
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
Generated
+839
-760
File diff suppressed because it is too large.
Load diff
Generated
+809
-761
File diff suppressed because it is too large.
Load diff
Generated
+1490
-1318
File diff suppressed because it is too large.
Load diff
Generated
+622
-574
File diff suppressed because it is too large.
Load diff
Generated
+920
-582
File diff suppressed because it is too large.
Load diff
Generated
+727
-692
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -6,7 +6,7 @@ branding:
|
||||
icon: message-circle
|
||||
color: gray-dark
|
||||
runs:
|
||||
using: node16
|
||||
using: node20
|
||||
main: ../build/command/index.js
|
||||
inputs:
|
||||
github-token:
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
<div align="center">
|
||||
<h1>continuous-deploy-fingerprint</h1>
|
||||
<p>Continuously deploys an Expo project using EAS Build and EAS Update in combination with fingerprint runtime versions</p>
|
||||
</div>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/expo/expo-github-action/releases" title="Latest release">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/package-json/v/expo/expo-github-action?style=flat-square&color=0366D6&labelColor=49505A">
|
||||
<img alt="Latest release" src="https://img.shields.io/github/package-json/v/expo/expo-github-action?style=flat-square&color=0366D6&labelColor=D1D5DA" />
|
||||
</picture>
|
||||
</a>
|
||||
<a href="https://github.com/expo/expo-github-action/actions" title="Workflow status">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/actions/workflow/status/expo/expo-github-action/test.yml?branch=main&style=flat-square&labelColor=49505A">
|
||||
<img alt="Workflow status" src="https://img.shields.io/github/actions/workflow/status/expo/expo-github-action/test.yml?branch=main&style=flat-square&labelColor=D1D5DA" />
|
||||
</picture>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="#usage"><b>Usage</b></a>
|
||||
—
|
||||
<a href="#available-outputs"><b>Outputs</b></a>
|
||||
—
|
||||
<a href="#example-workflows"><b>Examples</b></a>
|
||||
—
|
||||
<a href="#caveats"><b>Caveats</b></a>
|
||||
—
|
||||
<a href="https://github.com/expo/expo-github-action/blob/main/CHANGELOG.md"><b>Changelog</b></a>
|
||||
</p>
|
||||
|
||||
<br />
|
||||
|
||||
> **Warning**
|
||||
> This sub action is still in development and might change without notice. It is not yet ready for use.
|
||||
|
||||
## Overview
|
||||
|
||||
`continuous-deploy-fingerprint` is a GitHub Action continuously deploys an Expo project using the expo-updates fingerprint runtime version policy. When run, it performs the following tasks in order, once for each platform:
|
||||
1. Check current fingerprint of the project.
|
||||
2. Check for EAS builds with specified profile matching that fingerprint.
|
||||
3. If an EAS build doesn't exist, start one.
|
||||
4. Publish an update on EAS update.
|
||||
5. If run on a PR, post a comment indicating what was done.
|
||||
|
||||
### Configuration options
|
||||
|
||||
This action is customizable through variables defined in the [`action.yml`](action.yml).
|
||||
Here is a summary of all the input options you can use.
|
||||
|
||||
| variable | default | description |
|
||||
| ---------------------------------- | ---------------- | ----------------------------------------------------------------------- |
|
||||
| **profile** | (required) | The EAS Build profile to use |
|
||||
| **branch** | (required) | The EAS Update branch on which to publish |
|
||||
| **working-directory** | - | The relative directory of your Expo app |
|
||||
| **github-token** | `github.token` | GitHub token to use when commenting on PR ([read more](#github-tokens)) |
|
||||
|
||||
And the action will generate these [outputs](#available-outputs) for other actions to do something based on what this action did.
|
||||
|
||||
### Available outputs
|
||||
|
||||
In case you want to reuse this action for other purpose, this action will set the following action outputs.
|
||||
|
||||
| output name | description |
|
||||
| ------------------------ | ------------------------------ |
|
||||
| **ios-fingerprint** | The iOS fingerprint of the current commit. |
|
||||
| **android-fingerprint** | The Android fingerprint of the current commit. |
|
||||
| **android-build-id** | ID for Android EAS Build if one was started. |
|
||||
| **ios-build-id** | ID for iOS EAS Build if one was started. |
|
||||
| **update-output** | The output (JSON) from the `eas update` command. |
|
||||
|
||||
## Caveats
|
||||
|
||||
### GitHub tokens
|
||||
|
||||
When using the GitHub API, you always need to be authenticated.
|
||||
This action tries to auto-authenticate using the [Automatic token authentication][link-gha-token] from GitHub.
|
||||
You can overwrite the token by adding the `GITHUB_TOKEN` environment variable or add the **github-token** input.
|
||||
|
||||
<div align="center">
|
||||
<br />
|
||||
with :heart: <strong>Expo</strong>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
## Example workflows
|
||||
|
||||
Before diving into the workflow examples, you should know the basics of GitHub Actions.
|
||||
You can read more about this in the [GitHub Actions documentation][link-actions].
|
||||
|
||||
### Continuously deploy after tests on main branch and pull requests
|
||||
|
||||
This workflow continuously deploys:
|
||||
- main branch -> production EAS Build profile and EAS Update branch
|
||||
- PR branches -> development EAS Build profile and EAS Update branch
|
||||
|
||||
This means that every commit landed to main will go out to users on production. If a new build is created, it will need to be manually submitted to the app stores.
|
||||
|
||||
Pull requests also do a build if necessary and display a QR code to scan to preview the latest commit on the PR.
|
||||
|
||||
```yml
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
types: [opened, synchronize]
|
||||
|
||||
env:
|
||||
EXPO_STAGING: 1
|
||||
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 🏗 Setup repo
|
||||
uses: actions/checkout@v4
|
||||
- name: 🏗 Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18.x
|
||||
cache: yarn
|
||||
- name: 📦 Install dependencies
|
||||
run: yarn install
|
||||
- name: 🧪 Run tests
|
||||
run: yarn test
|
||||
|
||||
continuously-deploy:
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
concurrency: continuous-deploy-fingerprint-${{ github.event_name != 'pull_request' && 'main' || github.run_id }}
|
||||
permissions:
|
||||
contents: read # Allow checkout
|
||||
pull-requests: write # Allow comments on PRs
|
||||
steps:
|
||||
- name: 🏗 Setup repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 🏗 Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18.x
|
||||
|
||||
- name: 📦 Install dependencies
|
||||
run: yarn install
|
||||
|
||||
- name: 🏗 Setup EAS
|
||||
uses: expo/expo-github-action@main
|
||||
with:
|
||||
eas-version: latest
|
||||
token: ${{ secrets.EXPO_TOKEN }}
|
||||
|
||||
- name: Continuously Deploy
|
||||
uses: expo/expo-github-action/continuous-deploy-fingerprint@main
|
||||
with:
|
||||
profile: ${{ github.event_name != 'pull_request' && 'production' || 'development' }}
|
||||
branch: ${{ github.event_name != 'pull_request' && 'production' || 'development' }}
|
||||
```
|
||||
@@ -0,0 +1,37 @@
|
||||
---
|
||||
name: Expo GitHub Action - Continuous Deploy Fingerprint
|
||||
author: Expo
|
||||
description: Continuously deploy an Expo project using EAS Build and EAS Update with fingerprint.
|
||||
branding:
|
||||
icon: smartphone
|
||||
color: gray-dark
|
||||
runs:
|
||||
using: node20
|
||||
main: ../build/continuous-deploy-fingerprint/index.js
|
||||
inputs:
|
||||
profile:
|
||||
description: The EAS Build profile to use, must have EAS Update channel specified in eas.json
|
||||
required: true
|
||||
branch:
|
||||
description: The EAS Update branch on which to publish.
|
||||
required: true
|
||||
github-token:
|
||||
description: GitHub token to use when commenting on PR
|
||||
required: false
|
||||
default: ${{ github.token }}
|
||||
working-directory:
|
||||
description: The relative directory of your Expo app
|
||||
required: false
|
||||
default: ${{ github.workspace }}
|
||||
|
||||
outputs:
|
||||
android-fingerprint:
|
||||
description: The Android fingerprint of the current commit.
|
||||
ios-fingerprint:
|
||||
description: The iOS fingerprint of the current commit.
|
||||
android-build-id:
|
||||
description: ID for Android EAS Build if one was started
|
||||
ios-build-id:
|
||||
description: ID for iOS EAS Build if one was started.
|
||||
update-output:
|
||||
description: The output (JSON) from the `eas update` command
|
||||
+12
-6
@@ -61,7 +61,7 @@ jobs:
|
||||
permissions:
|
||||
# REQUIRED: Allow comments of PRs
|
||||
pull-requests: write # Allow comments on PRs
|
||||
# REQUIRED: Allow updating fingerprint in acton caches
|
||||
# REQUIRED: Allow updating fingerprint in action caches
|
||||
actions: write
|
||||
|
||||
steps:
|
||||
@@ -89,9 +89,13 @@ And the action will generate these [outputs](#available-outputs) for other actio
|
||||
|
||||
In case you want to reuse this action for other purpose, this action will set the following action outputs.
|
||||
|
||||
| output name | description |
|
||||
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **fingerprint-diff** | The diff between the current and the previous fingerprint. It is a JSON array of fingerprint diff. If the fingerprint does not change in between, the result diff will be an empty array `[]` |
|
||||
| output name | description |
|
||||
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **previous-fingerprint** | The fingerprint of the base commit if it has been computed previously. May be null if it has not been computed previously. |
|
||||
| **current-fingerprint** | The fingerprint of the current commit. |
|
||||
| **previous-git-commit** | The Git hash for the base commit. |
|
||||
| **current-git-commit** | The Git hash for the current commit. |
|
||||
| **fingerprint-diff** | The diff between the current and the previous fingerprint. It is a JSON array of fingerprint diff. If the fingerprint does not change in between, the result diff will be an empty array `[]` |
|
||||
|
||||
## Example workflows
|
||||
|
||||
@@ -115,8 +119,10 @@ jobs:
|
||||
permissions:
|
||||
# REQUIRED: Allow comments of PRs
|
||||
pull-requests: write # Allow comments on PRs
|
||||
# REQUIRED: Allow updating fingerprint in acton caches
|
||||
# REQUIRED: Allow updating fingerprint in action caches
|
||||
actions: write
|
||||
# OPTIONAL: Allow reading of repo contents for private projects
|
||||
# contents: read
|
||||
|
||||
steps:
|
||||
- name: 🏗 Setup repo
|
||||
@@ -133,7 +139,7 @@ jobs:
|
||||
|
||||
- name: Check fingerprint
|
||||
id: fingerprint
|
||||
uses: expo/expo-github-action/preview-build@main
|
||||
uses: expo/expo-github-action/fingerprint@main
|
||||
|
||||
- uses: actions/github-script@v6
|
||||
if: ${{ github.event_name == 'pull_request' && steps.fingerprint.outputs.fingerprint-diff == '[]' }}
|
||||
|
||||
+18
-1
@@ -6,7 +6,7 @@ branding:
|
||||
icon: smartphone
|
||||
color: gray-dark
|
||||
runs:
|
||||
using: node16
|
||||
using: node20
|
||||
main: ../build/fingerprint/index.js
|
||||
post: ../build/fingerprint-post/index.js
|
||||
post-if: success()
|
||||
@@ -33,7 +33,24 @@ inputs:
|
||||
description: A cache key to use for saving the fingerprint database
|
||||
required: false
|
||||
default: fingerprint-db
|
||||
previous-git-commit:
|
||||
description: The Git hash for the base commit
|
||||
required: false
|
||||
current-git-commit:
|
||||
description: The Git hash for the current commit
|
||||
required: false
|
||||
saving-db-branch:
|
||||
description: The branch for saving the fingerprint database. Defaults to the repository's default branch
|
||||
required: false
|
||||
|
||||
outputs:
|
||||
previous-fingerprint:
|
||||
description: The fingerprint of the previous commit. May be null if it has never previously been computed
|
||||
current-fingerprint:
|
||||
description: The fingerprint of the current commit
|
||||
previous-git-commit:
|
||||
description: The Git hash for the base commit
|
||||
current-git-commit:
|
||||
description: The Git hash for the current commit
|
||||
fingerprint-diff:
|
||||
description: The diff between the current and the previous fingerprint
|
||||
+2
-1
@@ -1,8 +1,9 @@
|
||||
/** @type {import('@jest/types').Config.InitialOptions} */
|
||||
/** @type {import('jest').Config} */
|
||||
module.exports = {
|
||||
verbose: true,
|
||||
clearMocks: true,
|
||||
moduleFileExtensions: ['js', 'ts'],
|
||||
prettierPath: require.resolve('jest-snapshot-prettier'),
|
||||
testEnvironment: 'node',
|
||||
testMatch: ['**/*.test.ts'],
|
||||
transform: {
|
||||
|
||||
+7
-4
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "expo-github-action",
|
||||
"version": "8.0.0",
|
||||
"version": "8.2.1",
|
||||
"description": "Expo CLI in your GitHub Actions workflow",
|
||||
"main": "build/index.js",
|
||||
"repository": {
|
||||
@@ -31,13 +31,13 @@
|
||||
"uuid": "^8.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@expo/config": "^7.0.3",
|
||||
"@expo/config": "^8.1.2",
|
||||
"@expo/fingerprint": "^0.1.0",
|
||||
"@expo/spawn-async": "^1.7.2",
|
||||
"@semantic-release/changelog": "^6.0.2",
|
||||
"@semantic-release/exec": "^6.0.3",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"@tsconfig/node16": "^1.0.3",
|
||||
"@tsconfig/node20": "^20.1.2",
|
||||
"@types/jest": "^29.2.5",
|
||||
"@types/node": "^16.18.11",
|
||||
"@types/uuid": "^9.0.3",
|
||||
@@ -47,13 +47,16 @@
|
||||
"eslint-config-universe": "^12.0.0",
|
||||
"getenv": "^1.0.0",
|
||||
"jest": "^29.3.1",
|
||||
"jest-snapshot-prettier": "npm:prettier@^2.8.8",
|
||||
"prettier": "^3.1.0",
|
||||
"semantic-release": "^19.0.5",
|
||||
"sqlite3": "^5.1.6",
|
||||
"ts-jest": "^29.0.3",
|
||||
"typescript": "^5.3.2"
|
||||
},
|
||||
"trustedDependencies": ["sqlite3"],
|
||||
"trustedDependencies": [
|
||||
"sqlite3"
|
||||
],
|
||||
"eslintConfig": {
|
||||
"extends": "universe/node",
|
||||
"ignorePatterns": [
|
||||
|
||||
@@ -63,6 +63,9 @@ jobs:
|
||||
pull-requests: write # Allow comments on PRs
|
||||
# REQUIRED: Allow updating fingerprint in acton caches
|
||||
actions: write
|
||||
# Following permissions are required for private repos
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Setup EAS
|
||||
@@ -136,9 +139,12 @@ jobs:
|
||||
pull-requests: write # Allow comments on PRs
|
||||
# REQUIRED: Allow updating fingerprint in acton caches
|
||||
actions: write
|
||||
# Following permissions are required for private repos
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 🏗 Setup EAS
|
||||
uses: expo/expo-github-action@v8
|
||||
|
||||
@@ -6,7 +6,7 @@ branding:
|
||||
icon: smartphone
|
||||
color: gray-dark
|
||||
runs:
|
||||
using: node16
|
||||
using: node20
|
||||
main: ../build/preview-build/index.js
|
||||
inputs:
|
||||
command:
|
||||
@@ -42,6 +42,15 @@ inputs:
|
||||
default: fingerprint-db
|
||||
eas-build-message:
|
||||
description: A short message describing the build
|
||||
previous-git-commit:
|
||||
description: The Git hash for the base commit
|
||||
required: false
|
||||
current-git-commit:
|
||||
description: The Git hash for the current commit
|
||||
required: false
|
||||
saving-db-branch:
|
||||
description: The branch for saving the fingerprint database. Defaults to the repository's default branch
|
||||
required: false
|
||||
|
||||
outputs:
|
||||
projectId:
|
||||
|
||||
@@ -6,7 +6,7 @@ branding:
|
||||
icon: message-circle
|
||||
color: gray-dark
|
||||
runs:
|
||||
using: node16
|
||||
using: node20
|
||||
main: ../build/preview-comment/index.js
|
||||
inputs:
|
||||
project:
|
||||
|
||||
+58
-35
@@ -42,27 +42,29 @@ It can help speed up the review process by letting the reviewer load the app dir
|
||||
This action is customizable through variables defined in the [`action.yml`](action.yml).
|
||||
Here is a summary of all the input options you can use.
|
||||
|
||||
| variable | default | description |
|
||||
| --------------------- | --------------------------- | ---------------------------------------------------------------------------------------------- |
|
||||
| **command** | - | EAS CLI command to run when creating updates |
|
||||
| **working-directory** | - | The relative directory of your Expo app |
|
||||
| **comment** | `true` | If the action should summarize the EAS Update information as comment on a pull request |
|
||||
| **comment-id** | _[see code][code-defaults]_ | unique id template to prevent duplicate comments ([read more](#preventing-duplicate-comments)) |
|
||||
| **github-token** | `github.token` | GitHub token to use when commenting on PR ([read more](#github-tokens)) |
|
||||
| variable | default | description |
|
||||
| --------------------- | --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **command** | - | EAS CLI command to run when creating updates |
|
||||
| **working-directory** | - | The relative directory of your Expo app |
|
||||
| **comment** | `true` | If the action should summarize the EAS Update information as comment on a pull request |
|
||||
| **comment-id** | _[see code][code-defaults]_ | Unique id template to prevent duplicate comments ([read more](#preventing-duplicate-comments)) |
|
||||
| **qr-target** | _inferred from project_ | Either `dev-build` or `expo-go`, affects how the EAS Update is opened through the QR code. <br /> Defaults to `dev-build` when `expo-dev-client` is detected within the project. |
|
||||
| **github-token** | `github.token` | GitHub token to use when commenting on PR ([read more](#github-tokens)) |
|
||||
|
||||
## Available outputs
|
||||
|
||||
There are a few variables available that you can use to set up your own notifications.
|
||||
These variables are strings; some may be empty because of your project configuration.
|
||||
|
||||
| output name | description |
|
||||
| ----------------- | ------------------------------------------------------------------------------------------------- |
|
||||
| **projectId** | The resolved EAS project ID |
|
||||
| **projectName** | The name of your project ([read more](https://docs.expo.dev/versions/latest/config/app/#name)) |
|
||||
| **projectSlug** | The slug of your project ([read more](https://docs.expo.dev/versions/latest/config/app/#slug)) |
|
||||
| **projectScheme** | The (custom) app scheme ([read more](https://docs.expo.dev/versions/latest/config/app/#scheme)) |
|
||||
| **commentId** | The unique comment ID to prevent duplicate comments ([read more](#preventing-duplicate-comments)) |
|
||||
| **comment** | The comment with information about the updates |
|
||||
| output name | description |
|
||||
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| **projectId** | The resolved EAS project ID |
|
||||
| **projectName** | The name of your project ([read more](https://docs.expo.dev/versions/latest/config/app/#name)) |
|
||||
| **projectSlug** | The slug of your project ([read more](https://docs.expo.dev/versions/latest/config/app/#slug)) |
|
||||
| **projectScheme** | The longest (custom) app scheme ([read more](https://docs.expo.dev/versions/latest/config/app/#scheme)) |
|
||||
| **projectSchemes** | All (custom) app schemes in order of longest to shortest, as JSON string ([read more](https://docs.expo.dev/versions/latest/config/app/#scheme)) |
|
||||
| **commentId** | The unique comment ID to prevent duplicate comments ([read more](#preventing-duplicate-comments)) |
|
||||
| **comment** | The comment with information about the updates |
|
||||
|
||||
### Update information
|
||||
|
||||
@@ -84,30 +86,32 @@ Some of the EAS Update variables can be shared for all platforms if the [runtime
|
||||
These variables contain Android-specific update information.
|
||||
When skipping the Android update, these variables are empty strings.
|
||||
|
||||
| output name | description |
|
||||
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **androidId** | Android-specific update id |
|
||||
| **androidGroupId** | Update group ID that contains one or more platform-specific updates |
|
||||
| **androidBranchName** | Branch name that was used when creating this update ([read more](https://docs.expo.dev/eas-update/getting-started/#publish-an-update)) |
|
||||
| **androidMessage** | Custom message to describe the Android-specific update |
|
||||
| **androidRuntimeVersion** | Runtime version used for the Android-specific update ([read more](https://docs.expo.dev/eas-update/runtime-versions/)) |
|
||||
| **androidQR** | Absolute URL to the QR code to load this Android-specific update |
|
||||
| **androidLink** | Absolute URL to the Android-specific update on [expo.dev](https://expo.dev) |
|
||||
| output name | description |
|
||||
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **androidId** | Android-specific update id |
|
||||
| **androidGroupId** | Update group ID that contains one or more platform-specific updates |
|
||||
| **androidBranchName** | Branch name that was used when creating this update ([read more](https://docs.expo.dev/eas-update/getting-started/#publish-an-update)) |
|
||||
| **andriodManifestPermalink** | Absolute URL to the Android-specific update manifest |
|
||||
| **androidMessage** | Custom message to describe the Android-specific update |
|
||||
| **androidRuntimeVersion** | Runtime version used for the Android-specific update ([read more](https://docs.expo.dev/eas-update/runtime-versions/)) |
|
||||
| **androidQR** | Absolute URL to the QR code to load this Android-specific update |
|
||||
| **androidLink** | Absolute URL to the Android-specific update on [expo.dev](https://expo.dev) |
|
||||
|
||||
#### iOS-specific update information
|
||||
|
||||
These variables contain iOS-specific update information.
|
||||
When skipping the iOS update, these variables are empty strings.
|
||||
|
||||
| output name | description |
|
||||
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **iosId** | iOS-specific update id |
|
||||
| **iosGroupId** | Update group ID that contains one or more platform-specific updates |
|
||||
| **iosBranchName** | Branch name that was used when creating this update ([read more](https://docs.expo.dev/eas-update/getting-started/#publish-an-update)) |
|
||||
| **iosMessage** | Custom message to describe the iOS-specific update |
|
||||
| **iosRuntimeVersion** | Runtime version used for the iOS-specific update ([read more](https://docs.expo.dev/eas-update/runtime-versions/)) |
|
||||
| **iosQR** | Absolute URL to the QR code to load this iOS-specific update |
|
||||
| **iosLink** | Absolute URL to the iOS-specific update on [expo.dev](https://expo.dev) |
|
||||
| output name | description |
|
||||
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **iosId** | iOS-specific update id |
|
||||
| **iosGroupId** | Update group ID that contains one or more platform-specific updates |
|
||||
| **iosBranchName** | Branch name that was used when creating this update ([read more](https://docs.expo.dev/eas-update/getting-started/#publish-an-update)) |
|
||||
| **iosManifestPermalink** | Absolute URL to the ios-specific update manifest |
|
||||
| **iosMessage** | Custom message to describe the iOS-specific update |
|
||||
| **iosRuntimeVersion** | Runtime version used for the iOS-specific update ([read more](https://docs.expo.dev/eas-update/runtime-versions/)) |
|
||||
| **iosQR** | Absolute URL to the QR code to load this iOS-specific update |
|
||||
| **iosLink** | Absolute URL to the iOS-specific update on [expo.dev](https://expo.dev) |
|
||||
|
||||
## Example workflows
|
||||
|
||||
@@ -120,7 +124,13 @@ You can read more about this in the [GitHub Actions documentation][link-actions]
|
||||
### Create previews on pull requests
|
||||
|
||||
This workflow creates a new EAS Update every time a pull request is created or updated.
|
||||
Since we're using the `--auto` flag, the EAS branch will be named after the GitHub branch, and the message for the update will match the commit's message.
|
||||
We are using the `--auto`, together with the `--branch`, flag in this example.
|
||||
|
||||
- `--auto` will automatically create an update using the current git commit message and git branch.
|
||||
- `--branch` will overwrite this value inferred from git with our own value.
|
||||
|
||||
> **Warning**
|
||||
> GitHub Actions might use a temporary merge branch for PRs. To avoid using this merge branch for our update, we overwrite the branch name from `--auto` with our own `--branch` value.
|
||||
|
||||
```yml
|
||||
on:
|
||||
@@ -153,7 +163,9 @@ jobs:
|
||||
- name: 🚀 Create preview
|
||||
uses: expo/expo-github-action/preview@v8
|
||||
with:
|
||||
command: eas update --auto
|
||||
# `github.event.pull_request.head.ref` is only available on `pull_request` triggers.
|
||||
# Use your own, or keep the automatically infered branch name from `--auto`, when using different triggers.
|
||||
command: eas update --auto --branch ${{ github.event.pull_request.head.ref }}
|
||||
```
|
||||
|
||||
### Sending preview information elsewhere
|
||||
@@ -194,6 +206,8 @@ jobs:
|
||||
uses: expo/expo-github-action/preview@v8
|
||||
id: preview
|
||||
with:
|
||||
# In this example, we use the `push` trigger which will always use the branch name that was pushed to.
|
||||
# By using `--auto` we both use the git commit message and branch name for the update.
|
||||
command: eas update --auto
|
||||
comment: false
|
||||
|
||||
@@ -213,6 +227,13 @@ jobs:
|
||||
When automating these preview comments, you have to be careful not to spam a pull request on every successful run.
|
||||
Every comment contains a generated **message-id** to identify previously made comments and update them instead of creating a new comment.
|
||||
|
||||
### Update branch and workflow triggers
|
||||
|
||||
GitHub Actions uses slightly different checkout logic for different workflow triggers.
|
||||
When using the `push` trigger, GitHub Actions checks out the branch that was pushed to.
|
||||
But for [`pull_request` triggers][link-gha-trigger-pull], GitHub Actions might use a temporary branch name.
|
||||
This affects in what "branch" your EAS Update is created when using the `--auto` flag.
|
||||
|
||||
### GitHub tokens
|
||||
|
||||
When using the GitHub API, you always need to be authenticated.
|
||||
@@ -228,3 +249,5 @@ You can overwrite the token by adding the `GITHUB_TOKEN` environment variable or
|
||||
[code-defaults]: ../src/actions/preview.ts#L10
|
||||
[link-actions]: https://help.github.com/en/categories/automating-your-workflow-with-github-actions
|
||||
[link-gha-token]: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
|
||||
[link-gha-trigger-pull]: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
|
||||
[link-gha-trigger-push]: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push
|
||||
+9
-1
@@ -6,7 +6,7 @@ branding:
|
||||
icon: smartphone
|
||||
color: gray-dark
|
||||
runs:
|
||||
using: node16
|
||||
using: node20
|
||||
main: ../build/preview/index.js
|
||||
inputs:
|
||||
command:
|
||||
@@ -18,6 +18,9 @@ inputs:
|
||||
default: true
|
||||
comment-id:
|
||||
description: unique id template to prevent duplicate comments
|
||||
qr-target:
|
||||
description: How the EAS Update is opened through the QR code, either `dev-build` or `expo-go`. Defaults to `dev-build` if `expo-dev-client` is used in project.
|
||||
required: false
|
||||
working-directory:
|
||||
description: The relative directory of your Expo app
|
||||
required: false
|
||||
@@ -26,6 +29,11 @@ inputs:
|
||||
description: GitHub token to use when commenting on PR
|
||||
required: false
|
||||
default: ${{ github.token }}
|
||||
# Below are deprecated and won't be supported anymore
|
||||
app-scheme:
|
||||
deprecated: true
|
||||
description: The (custom) app scheme to use when creating the preview QR code
|
||||
required: false
|
||||
outputs:
|
||||
projectId:
|
||||
description: The resolved EAS project ID
|
||||
|
||||
@@ -0,0 +1,337 @@
|
||||
import { getInput, info, isDebug, setFailed, setOutput } from '@actions/core';
|
||||
import { getExecOutput } from '@actions/exec';
|
||||
import { which } from '@actions/io';
|
||||
import { ExpoConfig } from '@expo/config';
|
||||
|
||||
import { createDetails, getQrTarget, getSchemesInOrderFromConfig } from '../comment';
|
||||
import { EasUpdate, getUpdateGroupQr, getUpdateGroupWebsite } from '../eas';
|
||||
import { AppPlatform, BuildInfo, appPlatformEmojis, getBuildLogsUrl } from '../expo';
|
||||
import { createIssueComment, hasPullContext, pullContext } from '../github';
|
||||
import { loadProjectConfig } from '../project';
|
||||
import { executeAction } from '../worker';
|
||||
|
||||
export function collectContinuousDeployFingerprintInput() {
|
||||
return {
|
||||
profile: getInput('profile'),
|
||||
branch: getInput('branch'),
|
||||
githubToken: getInput('github-token'),
|
||||
workingDirectory: getInput('working-directory'),
|
||||
};
|
||||
}
|
||||
|
||||
executeAction(continuousDeployFingerprintAction);
|
||||
|
||||
export async function continuousDeployFingerprintAction(input = collectContinuousDeployFingerprintInput()) {
|
||||
const isInPullRequest = hasPullContext();
|
||||
|
||||
const config = await loadProjectConfig(input.workingDirectory);
|
||||
const projectId = config.extra?.eas?.projectId;
|
||||
if (!projectId) {
|
||||
return setFailed(`Missing 'extra.eas.projectId' in app.json or app.config.js.`);
|
||||
}
|
||||
|
||||
const androidFingerprintHash = await getFingerprintHashForPlatformAsync({
|
||||
cwd: input.workingDirectory,
|
||||
platform: 'android',
|
||||
});
|
||||
const iosFingerprintHash = await getFingerprintHashForPlatformAsync({ cwd: input.workingDirectory, platform: 'ios' });
|
||||
|
||||
info(`Android fingerprint: ${androidFingerprintHash}`);
|
||||
info(`iOS fingerprint: ${iosFingerprintHash}`);
|
||||
|
||||
info('Looking for builds with matching runtime version (fingerprint)...');
|
||||
|
||||
let androidBuildInfo = await getBuildInfoWithFingerprintAsync({
|
||||
cwd: input.workingDirectory,
|
||||
platform: 'android',
|
||||
profile: input.profile,
|
||||
fingerprintHash: androidFingerprintHash,
|
||||
excludeExpiredBuilds: isInPullRequest,
|
||||
});
|
||||
if (androidBuildInfo) {
|
||||
info(`Existing Android build found with matching fingerprint: ${androidBuildInfo.id}`);
|
||||
} else {
|
||||
info(`No existing Android build found for fingerprint, starting a new build...`);
|
||||
androidBuildInfo = await createEASBuildAsync({
|
||||
cwd: input.workingDirectory,
|
||||
platform: 'android',
|
||||
profile: input.profile,
|
||||
});
|
||||
}
|
||||
|
||||
let iosBuildInfo = await getBuildInfoWithFingerprintAsync({
|
||||
cwd: input.workingDirectory,
|
||||
platform: 'ios',
|
||||
profile: input.profile,
|
||||
fingerprintHash: iosFingerprintHash,
|
||||
excludeExpiredBuilds: isInPullRequest,
|
||||
});
|
||||
if (iosBuildInfo) {
|
||||
info(`Existing iOS build found with matching fingerprint: ${iosBuildInfo.id}`);
|
||||
} else {
|
||||
info(`No existing iOS build found for fingerprint, starting a new build...`);
|
||||
iosBuildInfo = await createEASBuildAsync({ cwd: input.workingDirectory, platform: 'ios', profile: input.profile });
|
||||
}
|
||||
|
||||
const builds = [androidBuildInfo, iosBuildInfo];
|
||||
|
||||
info(`Publishing EAS Update...`);
|
||||
|
||||
const updates = await publishEASUpdatesAsync({
|
||||
cwd: input.workingDirectory,
|
||||
branch: input.branch,
|
||||
});
|
||||
|
||||
if (!isInPullRequest) {
|
||||
info(`Skipped comment: action was not run from a pull request`);
|
||||
} else {
|
||||
const messageId = `continuous-deploy-fingerprint-projectId:${projectId}`;
|
||||
const messageBody = createSummaryForUpdatesAndBuilds({ config, projectId, updates, builds, options: input });
|
||||
|
||||
await createIssueComment({
|
||||
...pullContext(),
|
||||
token: input.githubToken,
|
||||
id: messageId,
|
||||
body: messageBody,
|
||||
});
|
||||
}
|
||||
|
||||
setOutput('android-fingerprint', androidFingerprintHash);
|
||||
setOutput('ios-fingerprint', iosFingerprintHash);
|
||||
setOutput('android-build-id', androidBuildInfo.id);
|
||||
setOutput('ios-build-id', iosBuildInfo.id);
|
||||
setOutput('update-output', updates);
|
||||
}
|
||||
|
||||
async function getFingerprintHashForPlatformAsync({
|
||||
cwd,
|
||||
platform,
|
||||
}: {
|
||||
cwd: string;
|
||||
platform: 'ios' | 'android';
|
||||
}): Promise<string> {
|
||||
try {
|
||||
const extraArgs = isDebug() ? ['--debug'] : [];
|
||||
const { stdout } = await getExecOutput(
|
||||
'npx',
|
||||
['expo-updates', 'fingerprint:generate', '--platform', platform, ...extraArgs],
|
||||
{
|
||||
cwd,
|
||||
silent: !isDebug(),
|
||||
}
|
||||
);
|
||||
const { hash } = JSON.parse(stdout);
|
||||
if (!hash || typeof hash !== 'string') {
|
||||
throw new Error(`Invalid fingerprint output: ${stdout}`);
|
||||
}
|
||||
return hash;
|
||||
} catch (error: unknown) {
|
||||
throw new Error(`Could not get fingerprint for project: ${String(error)}`);
|
||||
}
|
||||
}
|
||||
|
||||
async function getBuildInfoWithFingerprintAsync({
|
||||
cwd,
|
||||
platform,
|
||||
profile,
|
||||
fingerprintHash,
|
||||
excludeExpiredBuilds,
|
||||
}: {
|
||||
cwd: string;
|
||||
platform: 'ios' | 'android';
|
||||
profile: string;
|
||||
fingerprintHash: string;
|
||||
excludeExpiredBuilds: boolean;
|
||||
}): Promise<BuildInfo | null> {
|
||||
let stdout: string;
|
||||
try {
|
||||
const execOutput = await getExecOutput(
|
||||
await which('eas', true),
|
||||
[
|
||||
'build:list',
|
||||
'--platform',
|
||||
platform,
|
||||
'--status',
|
||||
'finished',
|
||||
'--buildProfile',
|
||||
profile,
|
||||
'--runtimeVersion',
|
||||
fingerprintHash,
|
||||
'--limit',
|
||||
'1',
|
||||
'--json',
|
||||
'--non-interactive',
|
||||
],
|
||||
{
|
||||
cwd,
|
||||
silent: !isDebug(),
|
||||
}
|
||||
);
|
||||
stdout = execOutput.stdout;
|
||||
} catch (error: unknown) {
|
||||
throw new Error(`Could not list project builds: ${String(error)}`);
|
||||
}
|
||||
|
||||
const builds = JSON.parse(stdout);
|
||||
if (!builds || !Array.isArray(builds)) {
|
||||
throw new Error(`Could not get EAS builds for project`);
|
||||
}
|
||||
|
||||
if (!builds[0]) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const build = builds[0] as BuildInfo;
|
||||
|
||||
if (excludeExpiredBuilds) {
|
||||
// if the build is expired or will expire within the next day,
|
||||
// return null to trigger a new build
|
||||
const tomorrow = new Date();
|
||||
tomorrow.setDate(tomorrow.getDate() + 1);
|
||||
if (tomorrow > new Date(build.expirationDate)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return build;
|
||||
}
|
||||
|
||||
async function createEASBuildAsync({
|
||||
cwd,
|
||||
profile,
|
||||
platform,
|
||||
}: {
|
||||
cwd: string;
|
||||
profile: string;
|
||||
platform: 'ios' | 'android';
|
||||
}): Promise<BuildInfo> {
|
||||
let stdout: string;
|
||||
try {
|
||||
const extraArgs = isDebug() ? ['--build-logger-level', 'debug'] : [];
|
||||
const execOutput = await getExecOutput(
|
||||
await which('eas', true),
|
||||
['build', '--profile', profile, '--platform', platform, '--non-interactive', '--json', '--no-wait', ...extraArgs],
|
||||
{
|
||||
cwd,
|
||||
silent: !isDebug(),
|
||||
}
|
||||
);
|
||||
stdout = execOutput.stdout;
|
||||
} catch (error: unknown) {
|
||||
throw new Error(`Could not run command eas build: ${String(error)}`);
|
||||
}
|
||||
|
||||
return JSON.parse(stdout)[0];
|
||||
}
|
||||
|
||||
async function publishEASUpdatesAsync({ cwd, branch }: { cwd: string; branch: string }): Promise<EasUpdate[]> {
|
||||
let stdout: string;
|
||||
try {
|
||||
const execOutput = await getExecOutput(
|
||||
await which('eas', true),
|
||||
['update', '--auto', '--branch', branch, '--non-interactive', '--json'],
|
||||
{
|
||||
cwd,
|
||||
silent: !isDebug(),
|
||||
}
|
||||
);
|
||||
stdout = execOutput.stdout;
|
||||
} catch (error: unknown) {
|
||||
throw new Error(`Could not create a new EAS Update: ${String(error)}`);
|
||||
}
|
||||
|
||||
return JSON.parse(stdout);
|
||||
}
|
||||
|
||||
function createSummaryForUpdatesAndBuilds({
|
||||
config,
|
||||
projectId,
|
||||
updates,
|
||||
builds,
|
||||
options,
|
||||
}: {
|
||||
config: ExpoConfig;
|
||||
projectId: string;
|
||||
updates: EasUpdate[];
|
||||
builds: BuildInfo[];
|
||||
options: { qrTarget?: 'expo-go' | 'dev-build' | 'dev-client'; workingDirectory: string };
|
||||
}) {
|
||||
const appSlug = config.slug;
|
||||
const qrTarget = getQrTarget(options);
|
||||
const appSchemes = getSchemesInOrderFromConfig(config) || [];
|
||||
|
||||
const androidBuild = builds.find(build => build.platform === AppPlatform.Android);
|
||||
const iosBuild = builds.find(build => build.platform === AppPlatform.Ios);
|
||||
|
||||
const androidUpdate = updates.find(update => update.platform === 'android');
|
||||
const iosUpdate = updates.find(update => update.platform === 'ios');
|
||||
|
||||
const getBuildLink = (build: BuildInfo | undefined) =>
|
||||
build ? `[Build Permalink](${getBuildLogsUrl(build)})` : 'n/a';
|
||||
const getUpdateLink = (update: EasUpdate | undefined) =>
|
||||
update ? `[Update Permalink](${getUpdateGroupWebsite({ projectId, updateGroupId: update.group })})` : 'n/a';
|
||||
const getUpdateQRURL = (update: EasUpdate | undefined) =>
|
||||
update ? getUpdateGroupQr({ projectId, updateGroupId: update.group, appSlug, qrTarget }) : null;
|
||||
const getBuildDetails = (build: BuildInfo | undefined) =>
|
||||
build
|
||||
? getBuildLink(build) +
|
||||
'<br />' +
|
||||
createDetails({
|
||||
summary: 'Details',
|
||||
details: [
|
||||
`Distribution: \`${build.distribution}\``,
|
||||
`Build profile: \`${build.buildProfile}\``,
|
||||
`Runtime version: \`${build.runtimeVersion}\``,
|
||||
`App version: \`${build.appVersion}\``,
|
||||
`Git commit: \`${build.gitCommitHash}\``,
|
||||
].join('<br />'),
|
||||
delim: '',
|
||||
})
|
||||
: 'n/a';
|
||||
const getUpdateDetails = (update: EasUpdate | undefined) =>
|
||||
update
|
||||
? getUpdateLink(update) +
|
||||
'<br />' +
|
||||
createDetails({
|
||||
summary: 'Details',
|
||||
details: [
|
||||
`Branch: \`${update.branch}\``,
|
||||
`Runtime version: \`${update.runtimeVersion}\``,
|
||||
`Git commit: \`${update.gitCommitHash}\``,
|
||||
].join('<br />'),
|
||||
delim: '',
|
||||
})
|
||||
: 'n/a';
|
||||
|
||||
const androidQRURL = getUpdateQRURL(androidUpdate);
|
||||
const iosQRURL = getUpdateQRURL(iosUpdate);
|
||||
|
||||
const androidQr = androidQRURL
|
||||
? `<a href="${androidQRURL}"><img src="${androidQRURL}" width="250px" height="250px" /></a>`
|
||||
: null;
|
||||
|
||||
const iosQr = iosQRURL ? `<a href="${iosQRURL}"><img src="${iosQRURL}" width="250px" height="250px" /></a>` : null;
|
||||
|
||||
const platformName = `Platform${updates.length === 1 ? '' : 's'}`;
|
||||
const platformValue = updates
|
||||
.map(update => update.platform)
|
||||
.sort((a, b) => a.localeCompare(b))
|
||||
.map(platform => `**${platform}**`)
|
||||
.join(', ');
|
||||
|
||||
const schemesMessage = appSchemes[0] ? `- Scheme → **${appSchemes.join('**, **')}**` : '';
|
||||
|
||||
return `🚀 Expo continuous deployment is ready!
|
||||
|
||||
- Project → **${appSlug}**
|
||||
- ${platformName} → ${platformValue}
|
||||
${schemesMessage}
|
||||
|
||||
| ${appPlatformEmojis[AppPlatform.Android]} Android | ${appPlatformEmojis[AppPlatform.Ios]} iOS
|
||||
--- | --- | ---
|
||||
Fingerprint | ${androidBuild?.runtimeVersion ?? 'n/a'} | ${iosBuild?.runtimeVersion ?? 'n/a'}
|
||||
Build Details | ${getBuildDetails(androidBuild)} | ${getBuildDetails(iosBuild)}
|
||||
Update Details | ${getUpdateDetails(androidUpdate)} | ${getUpdateDetails(iosUpdate)}
|
||||
Update QR | ${androidQr ?? 'n/a'} | ${iosQr ?? 'n/a'}
|
||||
`;
|
||||
}
|
||||
@@ -3,15 +3,18 @@ import assert from 'assert';
|
||||
|
||||
import { deleteCacheAsync } from '../cacher';
|
||||
import { collectFingerprintActionInput, saveDbToCacheAsync } from '../fingerprint';
|
||||
import { isPushDefaultBranchContext } from '../github';
|
||||
import { getRepoDefaultBranch, isPushBranchContext } from '../github';
|
||||
import { executeAction } from '../worker';
|
||||
|
||||
executeAction(runAction);
|
||||
|
||||
export async function runAction(input = collectFingerprintActionInput()) {
|
||||
if (!isPushDefaultBranchContext()) {
|
||||
const targetBranch = input.savingDbBranch ?? getRepoDefaultBranch();
|
||||
assert(targetBranch);
|
||||
if (!isPushBranchContext(targetBranch)) {
|
||||
return;
|
||||
}
|
||||
info(`Saving fingerprint database to ${targetBranch} branch.`);
|
||||
|
||||
try {
|
||||
const ref = process.env.GITHUB_REF;
|
||||
|
||||
@@ -11,10 +11,14 @@ executeAction(runAction);
|
||||
|
||||
export async function runAction(input = collectFingerprintActionInput()) {
|
||||
const dbManager = await createFingerprintDbManagerAsync(input.packager, input.fingerprintDbCacheKey);
|
||||
const { currentFingerprint, diff } = await createFingerprintOutputAsync(dbManager, input);
|
||||
const { currentFingerprint, previousFingerprint, diff } = await createFingerprintOutputAsync(dbManager, input);
|
||||
await dbManager.upsertFingerprintByGitCommitHashAsync(input.currentGitCommitHash, {
|
||||
fingerprint: currentFingerprint,
|
||||
});
|
||||
|
||||
setOutput('previous-fingerprint', previousFingerprint);
|
||||
setOutput('current-fingerprint', currentFingerprint);
|
||||
setOutput('previous-git-commit', input.previousGitCommitHash);
|
||||
setOutput('current-git-commit', input.currentGitCommitHash);
|
||||
setOutput('fingerprint-diff', diff);
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import assert from 'assert';
|
||||
import { validate as isValidUUID } from 'uuid';
|
||||
|
||||
import { deleteCacheAsync } from '../cacher';
|
||||
import { createDetails } from '../comment';
|
||||
import {
|
||||
createEasBuildFromRawCommandAsync,
|
||||
BuildInfo,
|
||||
@@ -26,8 +27,9 @@ import {
|
||||
fetchIssueComment,
|
||||
getGitCommandMessageAsync,
|
||||
getPullRequestFromGitCommitShaAsync,
|
||||
getRepoDefaultBranch,
|
||||
hasPullContext,
|
||||
isPushDefaultBranchContext,
|
||||
isPushBranchContext,
|
||||
pullContext,
|
||||
} from '../github';
|
||||
import { loadProjectConfig } from '../project';
|
||||
@@ -69,6 +71,7 @@ export async function previewAction(input = collectPreviewBuildActionInput()) {
|
||||
dbManager,
|
||||
githubToken: input.githubToken,
|
||||
fingerprintDbCacheKey: input.fingerprintDbCacheKey,
|
||||
savingDbBranch: input.savingDbBranch,
|
||||
gitCommitHash: input.currentGitCommitHash,
|
||||
manyBuilds: [{ fingerprint: currentFingerprint }],
|
||||
});
|
||||
@@ -101,6 +104,7 @@ export async function previewAction(input = collectPreviewBuildActionInput()) {
|
||||
dbManager,
|
||||
githubToken: input.githubToken,
|
||||
fingerprintDbCacheKey: input.fingerprintDbCacheKey,
|
||||
savingDbBranch: input.savingDbBranch,
|
||||
gitCommitHash: input.currentGitCommitHash,
|
||||
manyBuilds: builds.map(build => ({
|
||||
easBuildId: build.id,
|
||||
@@ -201,18 +205,6 @@ export function getVariables(config: ExpoConfig, builds: BuildInfo[]) {
|
||||
};
|
||||
}
|
||||
|
||||
function createDetails({
|
||||
summary,
|
||||
details,
|
||||
delim = '\n',
|
||||
}: {
|
||||
summary: string;
|
||||
details: string;
|
||||
delim?: string;
|
||||
}): string {
|
||||
return `<details><summary>${summary}</summary>${delim.repeat(2)}${details}${delim}</details>`;
|
||||
}
|
||||
|
||||
function createMessageBodyInBuilding(
|
||||
builds: BuildInfo[],
|
||||
fingerprintDiff: FingerprintSource[],
|
||||
@@ -311,14 +303,18 @@ async function maybeUpdateFingerprintDbAsync(params: {
|
||||
githubToken: string;
|
||||
fingerprintDbCacheKey: string;
|
||||
gitCommitHash: string;
|
||||
savingDbBranch: string | undefined;
|
||||
manyBuilds: {
|
||||
easBuildId?: string;
|
||||
fingerprint: Fingerprint;
|
||||
}[];
|
||||
}) {
|
||||
if (!isPushDefaultBranchContext()) {
|
||||
const targetBranch = params.savingDbBranch ?? getRepoDefaultBranch();
|
||||
assert(targetBranch);
|
||||
if (!isPushBranchContext(targetBranch)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const build of params.manyBuilds) {
|
||||
await params.dbManager.upsertFingerprintByGitCommitHashAsync(params.gitCommitHash, {
|
||||
easBuildId: build.easBuildId,
|
||||
@@ -339,11 +335,13 @@ async function maybeUpdateFingerprintDbAsync(params: {
|
||||
|
||||
async function handleNonPullRequest(config: ExpoConfig, input: ReturnType<typeof collectPreviewBuildActionInput>) {
|
||||
info('Non pull request context, skipping comment.');
|
||||
if (!isPushDefaultBranchContext()) {
|
||||
const targetBranch = input.savingDbBranch ?? getRepoDefaultBranch();
|
||||
assert(targetBranch);
|
||||
if (!isPushBranchContext(targetBranch)) {
|
||||
return;
|
||||
}
|
||||
|
||||
info('Updating fingerprint database for the default branch push event.');
|
||||
info(`Updating fingerprint database for the ${targetBranch} branch push event.`);
|
||||
const dbManager = await createFingerprintDbManagerAsync(input.packager, input.fingerprintDbCacheKey);
|
||||
const { currentFingerprint } = await createFingerprintOutputAsync(dbManager, input);
|
||||
const associatedPRs = await getPullRequestFromGitCommitShaAsync(
|
||||
@@ -370,6 +368,7 @@ async function handleNonPullRequest(config: ExpoConfig, input: ReturnType<typeof
|
||||
dbManager,
|
||||
githubToken: input.githubToken,
|
||||
fingerprintDbCacheKey: input.fingerprintDbCacheKey,
|
||||
savingDbBranch: input.savingDbBranch,
|
||||
gitCommitHash: input.currentGitCommitHash,
|
||||
manyBuilds,
|
||||
});
|
||||
|
||||
+24
-9
@@ -1,6 +1,7 @@
|
||||
import { getBooleanInput, getInput, setOutput, group, setFailed, info } from '@actions/core';
|
||||
import { ExpoConfig } from '@expo/config';
|
||||
|
||||
import { getQrTarget, getSchemesInOrderFromConfig } from '../comment';
|
||||
import { assertEasVersion, createUpdate, EasUpdate, getUpdateGroupQr, getUpdateGroupWebsite } from '../eas';
|
||||
import { createIssueComment, hasPullContext, pullContext } from '../github';
|
||||
import { loadProjectConfig } from '../project';
|
||||
@@ -10,12 +11,19 @@ import { executeAction } from '../worker';
|
||||
export const MESSAGE_ID = 'projectId:{projectId}';
|
||||
|
||||
export function previewInput() {
|
||||
const qrTarget = getInput('qr-target') || undefined;
|
||||
if (qrTarget && !['expo-go', 'dev-client'].includes(qrTarget)) {
|
||||
throw new Error(`Invalid QR code target: "${qrTarget}", expected "expo-go" or "dev-build"`);
|
||||
}
|
||||
|
||||
return {
|
||||
command: getInput('command'),
|
||||
shouldComment: !getInput('comment') || getBooleanInput('comment'),
|
||||
commentId: getInput('comment-id') || MESSAGE_ID,
|
||||
workingDirectory: getInput('working-directory'),
|
||||
githubToken: getInput('github-token'),
|
||||
// Note, `dev-build` is prefered, but `dev-client` is supported to aovid confusion
|
||||
qrTarget: qrTarget as undefined | 'expo-go' | 'dev-build' | 'dev-client',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -42,7 +50,7 @@ export async function previewAction(input = previewInput()) {
|
||||
return setFailed(`Missing 'extra.eas.projectId' in app.json or app.config.js.`);
|
||||
}
|
||||
|
||||
const variables = getVariables(config, updates);
|
||||
const variables = getVariables(config, updates, input);
|
||||
const messageId = template(input.commentId, variables);
|
||||
const messageBody = createSummary(updates, variables);
|
||||
|
||||
@@ -95,22 +103,27 @@ function sanitizeCommand(input: string): string {
|
||||
/**
|
||||
* Generate useful variables for the message body, and as step outputs.
|
||||
*/
|
||||
export function getVariables(config: ExpoConfig, updates: EasUpdate[]) {
|
||||
export function getVariables(config: ExpoConfig, updates: EasUpdate[], options: ReturnType<typeof previewInput>) {
|
||||
const projectId: string = config.extra?.eas?.projectId;
|
||||
const android = updates.find(update => update.platform === 'android');
|
||||
const ios = updates.find(update => update.platform === 'ios');
|
||||
|
||||
const appSchemes = getSchemesInOrderFromConfig(config) || [];
|
||||
const appSlug = config.slug;
|
||||
const qrTarget = getQrTarget(options);
|
||||
|
||||
return {
|
||||
// EAS / Expo specific
|
||||
projectId,
|
||||
projectName: config.name,
|
||||
projectSlug: config.slug,
|
||||
projectScheme: config.scheme || '',
|
||||
projectSlug: appSlug,
|
||||
projectScheme: appSchemes[0] || '', // This is the longest scheme from one or more custom app schemes
|
||||
projectSchemes: JSON.stringify(appSchemes), // These are all custom app schemes, in order from longest to shortest as JSON
|
||||
// Shared update properties
|
||||
// Note, only use these properties when the update groups are identical
|
||||
groupId: updates[0].group,
|
||||
runtimeVersion: updates[0].runtimeVersion,
|
||||
qr: getUpdateGroupQr({ projectId, updateGroupId: updates[0].group, appScheme: config.scheme }),
|
||||
qr: getUpdateGroupQr({ projectId, updateGroupId: updates[0].group, appSlug, qrTarget }),
|
||||
link: getUpdateGroupWebsite({ projectId, updateGroupId: updates[0].group }),
|
||||
// These are safe to access regardless of the update groups
|
||||
branchName: updates[0].branch,
|
||||
@@ -121,17 +134,19 @@ export function getVariables(config: ExpoConfig, updates: EasUpdate[]) {
|
||||
androidId: android?.id || '',
|
||||
androidGroupId: android?.group || '',
|
||||
androidBranchName: android?.branch || '',
|
||||
androidManifestPermalink: android?.manifestPermalink || '',
|
||||
androidMessage: android?.message || '',
|
||||
androidRuntimeVersion: android?.runtimeVersion || '',
|
||||
androidQR: android ? getUpdateGroupQr({ projectId, updateGroupId: android.group, appScheme: config.scheme }) : '',
|
||||
androidQR: android ? getUpdateGroupQr({ projectId, updateGroupId: android.group, appSlug, qrTarget }) : '',
|
||||
androidLink: android ? getUpdateGroupWebsite({ projectId, updateGroupId: android.group }) : '',
|
||||
// iOS update
|
||||
iosId: ios?.id || '',
|
||||
iosGroupId: ios?.group || '',
|
||||
iosBranchName: ios?.branch || '',
|
||||
iosManifestPermalink: ios?.manifestPermalink || '',
|
||||
iosMessage: ios?.message || '',
|
||||
iosRuntimeVersion: ios?.runtimeVersion || '',
|
||||
iosQR: ios ? getUpdateGroupQr({ projectId, updateGroupId: ios.group, appScheme: config.scheme }) : '',
|
||||
iosQR: ios ? getUpdateGroupQr({ projectId, updateGroupId: ios.group, appSlug, qrTarget }) : '',
|
||||
iosLink: ios ? getUpdateGroupWebsite({ projectId, updateGroupId: ios.group }) : '',
|
||||
};
|
||||
}
|
||||
@@ -157,13 +172,13 @@ function createSummaryHeader(updates: EasUpdate[], vars: ReturnType<typeof getVa
|
||||
.map(platform => `**${platform}**`)
|
||||
.join(', ');
|
||||
|
||||
const appScheme = vars.projectScheme ? `- Scheme → **${vars.projectScheme}**` : '';
|
||||
const appSchemes = vars.projectScheme ? `- Scheme → **${JSON.parse(vars.projectSchemes).join('**, **')}**` : '';
|
||||
|
||||
return `🚀 Expo preview is ready!
|
||||
|
||||
- Project → **${vars.projectSlug}**
|
||||
- ${platformName} → ${platformValue}
|
||||
${appScheme}`.trim();
|
||||
${appSchemes}`.trim();
|
||||
}
|
||||
|
||||
function createSingleQrSummary(updates: EasUpdate[], vars: ReturnType<typeof getVariables>) {
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
import { debug } from '@actions/core';
|
||||
import { ExpoConfig } from '@expo/config';
|
||||
|
||||
import { projectAppType } from './expo';
|
||||
|
||||
export function getQrTarget(input: { qrTarget?: 'expo-go' | 'dev-build' | 'dev-client'; workingDirectory: string }) {
|
||||
if (!input.qrTarget) {
|
||||
const appType = projectAppType(input.workingDirectory);
|
||||
debug(`Using inferred QR code target: "${appType}"`);
|
||||
return appType;
|
||||
}
|
||||
|
||||
switch (input.qrTarget) {
|
||||
// Note, `dev-build` is prefered, but `dev-client` is supported to aovid confusion
|
||||
case 'dev-client':
|
||||
case 'dev-build':
|
||||
debug(`Using QR code target: "dev-build"`);
|
||||
return 'dev-build';
|
||||
|
||||
case 'expo-go':
|
||||
debug(`Using QR code target: "expo-go"`);
|
||||
return 'expo-go';
|
||||
|
||||
default:
|
||||
throw new Error(`Invalid QR code target: "${input.qrTarget}", expected "expo-go" or "dev-build"`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the app schemes, in correct priority order, from project config.
|
||||
* - If the scheme is a string, return `[scheme]`.
|
||||
* - If the scheme is an array, return the schemes sorted by length, longest first.
|
||||
* - If the scheme is empty/incorrect, return an empty array.
|
||||
*/
|
||||
export function getSchemesInOrderFromConfig(config: ExpoConfig) {
|
||||
if (typeof config.scheme === 'string') {
|
||||
return [config.scheme];
|
||||
}
|
||||
|
||||
if (Array.isArray(config.scheme)) {
|
||||
return config.scheme.sort((a, b) => b.length - a.length);
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
export function createDetails({
|
||||
summary,
|
||||
details,
|
||||
delim = '\n',
|
||||
}: {
|
||||
summary: string;
|
||||
details: string;
|
||||
delim?: string;
|
||||
}): string {
|
||||
return `<details><summary>${summary}</summary>${delim.repeat(2)}${details}${delim}</details>`;
|
||||
}
|
||||
+11
-8
@@ -4,8 +4,6 @@ import type { Platform } from '@expo/config';
|
||||
import semver from 'semver';
|
||||
import { URL } from 'url';
|
||||
|
||||
import { errorMessage } from './utils';
|
||||
|
||||
export interface EasUpdate {
|
||||
/** The unique ID of the platform specific update */
|
||||
id: string;
|
||||
@@ -60,8 +58,8 @@ export async function createUpdate(cwd: string, command: string): Promise<EasUpd
|
||||
({ stdout } = await getExecOutput((await which('eas', true)) + ` ${command}`, undefined, {
|
||||
cwd,
|
||||
}));
|
||||
} catch (error) {
|
||||
throw new Error(`Could not create a new EAS Update, reason:\n${errorMessage(error)}`);
|
||||
} catch (error: unknown) {
|
||||
throw new Error(`Could not create a new EAS Update`, { cause: error });
|
||||
}
|
||||
|
||||
return JSON.parse(stdout);
|
||||
@@ -73,16 +71,21 @@ export async function createUpdate(cwd: string, command: string): Promise<EasUpd
|
||||
export function getUpdateGroupQr({
|
||||
projectId,
|
||||
updateGroupId,
|
||||
appScheme,
|
||||
appSlug,
|
||||
qrTarget,
|
||||
}: {
|
||||
projectId: string;
|
||||
updateGroupId: string;
|
||||
appScheme?: string;
|
||||
appSlug: string;
|
||||
qrTarget: 'expo-go' | 'dev-build';
|
||||
}): string {
|
||||
const url = new URL('https://qr.expo.dev/eas-update');
|
||||
|
||||
if (appScheme) {
|
||||
url.searchParams.append('appScheme', appScheme);
|
||||
if (qrTarget === 'dev-build') {
|
||||
// While the parameter is called `appScheme`, it's actually the app's slug
|
||||
// This should only be added when using dev clients as target
|
||||
// See: https://github.com/expo/expo/blob/8ae75dde393e5d2393d446227a1fe2482c75eec3/packages/expo-dev-client/plugin/src/getDefaultScheme.ts#L17
|
||||
url.searchParams.append('appScheme', appSlug.replace(/[^A-Za-z0-9+\-.]/g, ''));
|
||||
}
|
||||
|
||||
url.searchParams.append('projectId', projectId);
|
||||
|
||||
+42
-17
@@ -2,10 +2,9 @@ import { info, exportVariable } from '@actions/core';
|
||||
import { exec, getExecOutput } from '@actions/exec';
|
||||
import { which } from '@actions/io';
|
||||
import { ok as assert } from 'assert';
|
||||
import path from 'path';
|
||||
import { URL } from 'url';
|
||||
|
||||
import { errorMessage } from './utils';
|
||||
|
||||
export type CliName = 'expo' | 'eas';
|
||||
|
||||
export type Command = {
|
||||
@@ -35,12 +34,15 @@ export type BuildInfo = {
|
||||
name: string;
|
||||
};
|
||||
};
|
||||
releaseChannel: string;
|
||||
channel: string;
|
||||
releaseChannel?: string;
|
||||
distribution: string;
|
||||
buildProfile: string;
|
||||
runtimeVersion?: string;
|
||||
sdkVersion: string;
|
||||
appVersion: string;
|
||||
gitCommitHash: string;
|
||||
expirationDate: string;
|
||||
};
|
||||
|
||||
export const appPlatformDisplayNames: Record<AppPlatform, string> = {
|
||||
@@ -97,8 +99,8 @@ export async function projectOwner(cli: CliName = 'expo'): Promise<string> {
|
||||
|
||||
try {
|
||||
({ stdout } = await getExecOutput(await which(cli), ['whoami'], { silent: true }));
|
||||
} catch (error) {
|
||||
throw new Error(`Could not fetch the project owner, reason:\n${errorMessage(error)}`);
|
||||
} catch (error: unknown) {
|
||||
throw new Error(`Could not fetch the project owner`, { cause: error });
|
||||
}
|
||||
|
||||
if (!stdout) {
|
||||
@@ -118,8 +120,8 @@ export async function runCommand(cmd: Command) {
|
||||
({ stderr, stdout } = await getExecOutput(await which(cmd.cli), cmd.args.concat('--non-interactive'), {
|
||||
silent: false,
|
||||
}));
|
||||
} catch (error) {
|
||||
throw new Error(`Could not run command ${cmd.args.join(' ')}, reason:\n${errorMessage(error)}`);
|
||||
} catch (error: unknown) {
|
||||
throw new Error(`Could not run command ${cmd.args.join(' ')}`, { cause: error });
|
||||
}
|
||||
|
||||
return [stdout.trim(), stderr.trim()];
|
||||
@@ -133,8 +135,8 @@ export async function easBuild(cmd: Command): Promise<BuildInfo[]> {
|
||||
({ stdout } = await getExecOutput(await which('eas', true), args, {
|
||||
silent: false,
|
||||
}));
|
||||
} catch (error) {
|
||||
throw new Error(`Could not run command eas build, reason:\n${errorMessage(error)}`);
|
||||
} catch (error: unknown) {
|
||||
throw new Error(`Could not run command eas build`, { cause: error });
|
||||
}
|
||||
|
||||
return JSON.parse(stdout);
|
||||
@@ -165,8 +167,8 @@ export async function createEasBuildFromRawCommandAsync(
|
||||
({ stdout } = await getExecOutput((await which('eas', true)) + ` ${cmd}`, extraArgs, {
|
||||
cwd,
|
||||
}));
|
||||
} catch (error) {
|
||||
throw new Error(`Could not run command eas build, reason:\n${errorMessage(error)}`);
|
||||
} catch (error: unknown) {
|
||||
throw new Error(`Could not run command eas build`, { cause: error });
|
||||
}
|
||||
|
||||
return JSON.parse(stdout);
|
||||
@@ -178,8 +180,8 @@ export async function createEasBuildFromRawCommandAsync(
|
||||
export async function cancelEasBuildAsync(cwd: string, buildId: string): Promise<void> {
|
||||
try {
|
||||
await getExecOutput(await which('eas', true), ['build:cancel', buildId], { cwd });
|
||||
} catch (e) {
|
||||
info(`Failed to cancel build ${buildId}: ${errorMessage(e)}`);
|
||||
} catch (error: unknown) {
|
||||
info(`Failed to cancel build ${buildId}: ${String(error)}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,8 +195,8 @@ export async function queryEasBuildInfoAsync(cwd: string, buildId: string): Prom
|
||||
silent: true,
|
||||
});
|
||||
return JSON.parse(stdout);
|
||||
} catch (e) {
|
||||
info(`Failed to query eas build ${buildId}: ${errorMessage(e)}`);
|
||||
} catch (error: unknown) {
|
||||
info(`Failed to query eas build ${buildId}: ${String(error)}`);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -210,14 +212,37 @@ export async function projectInfo(dir: string): Promise<ProjectInfo> {
|
||||
cwd: dir,
|
||||
silent: true,
|
||||
}));
|
||||
} catch (error) {
|
||||
throw new Error(`Could not fetch the project info from ${dir}, reason:\n${errorMessage(error)}`);
|
||||
} catch (error: unknown) {
|
||||
throw new Error(`Could not fetch the project info from ${dir}`, { cause: error });
|
||||
}
|
||||
|
||||
const { name, slug, owner } = JSON.parse(stdout);
|
||||
return { name, slug, owner };
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the current project is using `dev-build` or `expo-go`.
|
||||
* This is based on the `@expo/cli` check to enable dev client mode.
|
||||
*
|
||||
* @see https://github.com/expo/expo/blob/190a80f393bc730eb3f300df52d82b701e4b8ff5/packages/%40expo/cli/src/utils/analytics/getDevClientProperties.ts#L12-L15
|
||||
*/
|
||||
export function projectAppType(dir: string): 'expo-go' | 'dev-build' {
|
||||
const packageFile = path.resolve(dir, 'package.json');
|
||||
let packageJson: any = {};
|
||||
|
||||
try {
|
||||
packageJson = require(packageFile);
|
||||
} catch (error: unknown) {
|
||||
throw new Error(`Could not load the project package file in: ${packageFile}`, { cause: error });
|
||||
}
|
||||
|
||||
if (packageJson?.dependencies?.['expo-dev-client'] || packageJson?.devDependencies?.['expo-dev-client']) {
|
||||
return 'dev-build';
|
||||
}
|
||||
|
||||
return 'expo-go';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a QR code for an update on project, with an optional release channel.
|
||||
*/
|
||||
|
||||
@@ -81,11 +81,14 @@ export function collectFingerprintActionInput() {
|
||||
!getInput('fingerprint-installation-cache') || getBooleanInput('fingerprint-installation-cache'),
|
||||
fingerprintDbCacheKey: getInput('fingerprint-db-cache-key'),
|
||||
previousGitCommitHash:
|
||||
githubContext.eventName === 'pull_request'
|
||||
getInput('previous-git-commit') ||
|
||||
(githubContext.eventName === 'pull_request'
|
||||
? githubContext.payload.pull_request?.base?.sha
|
||||
: githubContext.payload.before,
|
||||
: githubContext.payload.before),
|
||||
currentGitCommitHash:
|
||||
githubContext.eventName === 'pull_request' ? githubContext.payload.pull_request?.head?.sha : githubContext.sha,
|
||||
getInput('current-git-commit') ||
|
||||
(githubContext.eventName === 'pull_request' ? githubContext.payload.pull_request?.head?.sha : githubContext.sha),
|
||||
savingDbBranch: getInput('saving-db-branch') || undefined,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+12
-3
@@ -155,10 +155,19 @@ export async function getGitCommandMessageAsync(options: AuthContext, gitCommitH
|
||||
}
|
||||
|
||||
/**
|
||||
* True if the current event is a push to the default branch.
|
||||
* Get the default branch for the repository.
|
||||
*/
|
||||
export function isPushDefaultBranchContext() {
|
||||
return context.eventName === 'push' && context.ref === `refs/heads/${context.payload?.repository?.default_branch}`;
|
||||
export function getRepoDefaultBranch(): string | undefined {
|
||||
return context.payload?.repository?.default_branch;
|
||||
}
|
||||
|
||||
/**
|
||||
* True if the current event is a push to the target branch.
|
||||
*
|
||||
* @param targetBranch The branch to compare against.
|
||||
*/
|
||||
export function isPushBranchContext(targetBranch: string) {
|
||||
return context.eventName === 'push' && context.ref === `refs/heads/${targetBranch}`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+2
-3
@@ -1,7 +1,6 @@
|
||||
import { exec, getExecOutput } from '@actions/exec';
|
||||
import { mkdirP } from '@actions/io';
|
||||
|
||||
import { errorMessage } from './utils';
|
||||
import { cacheTool, tempPath } from './worker';
|
||||
|
||||
/**
|
||||
@@ -14,8 +13,8 @@ export async function resolvePackage(name: string, range: string): Promise<strin
|
||||
|
||||
try {
|
||||
({ stdout } = await getExecOutput('npm', ['info', `${name}@${range}`, 'version', '--json'], { silent: true }));
|
||||
} catch (error) {
|
||||
throw new Error(`Could not resolve ${name}@${range}, reason:\n${errorMessage(error)}`);
|
||||
} catch (error: unknown) {
|
||||
throw new Error(`Could not resolve ${name}@${range}`, { cause: error });
|
||||
}
|
||||
|
||||
// thanks npm, for returning a "" json string value for invalid versions
|
||||
|
||||
+2
-4
@@ -1,8 +1,6 @@
|
||||
import { getExecOutput } from '@actions/exec';
|
||||
import { ExpoConfig } from '@expo/config';
|
||||
|
||||
import { errorMessage } from './utils';
|
||||
|
||||
/**
|
||||
* Load the Expo app project config in the given directory.
|
||||
* This runs `expo config` command instead of using `@expo/config` directly,
|
||||
@@ -16,8 +14,8 @@ export async function loadProjectConfig(cwd: string): Promise<ExpoConfig> {
|
||||
cwd,
|
||||
silent: true,
|
||||
}));
|
||||
} catch (error) {
|
||||
throw new Error(`Could not fetch the project info from ${cwd}, reason:\n${errorMessage(error)}`);
|
||||
} catch (error: unknown) {
|
||||
throw new Error(`Could not fetch the project info from ${cwd}`, { cause: error });
|
||||
}
|
||||
|
||||
return JSON.parse(stdout);
|
||||
|
||||
@@ -9,15 +9,3 @@ export function template(template: string, replacements: Record<string, string>)
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
export function errorMessage(error: Error | unknown): string {
|
||||
if (error instanceof Error) {
|
||||
return error.message;
|
||||
}
|
||||
|
||||
if (typeof error === 'string') {
|
||||
return error;
|
||||
}
|
||||
|
||||
return 'Unknown error';
|
||||
}
|
||||
+1
-3
@@ -4,8 +4,6 @@ import { ok as assert } from 'assert';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
|
||||
import { errorMessage } from './utils';
|
||||
|
||||
export { find as findTool, cacheDir as cacheTool } from '@actions/tool-cache';
|
||||
|
||||
/**
|
||||
@@ -56,7 +54,7 @@ export async function patchWatchers(): Promise<void> {
|
||||
} catch (error) {
|
||||
warning(`Looks like we can't patch watchers/inotify limits, you might encouter the 'ENOSPC' error.`);
|
||||
warning('For more info: https://github.com/expo/expo-github-action/issues/20, encountered error:');
|
||||
warning(errorMessage(error));
|
||||
warning(String(error));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
import { ExpoConfig } from '@expo/config';
|
||||
|
||||
import { createSummary, getVariables } from '../../src/actions/preview';
|
||||
import { createSummary, getVariables, previewInput } from '../../src/actions/preview';
|
||||
import { EasUpdate } from '../../src/eas';
|
||||
|
||||
jest.mock('../../src/expo');
|
||||
|
||||
const fakeOptions = {
|
||||
qrTarget: 'dev-client',
|
||||
} as unknown as ReturnType<typeof previewInput>;
|
||||
|
||||
const fakeExpoConfig = {
|
||||
slug: 'fake-project',
|
||||
extra: {
|
||||
@@ -40,7 +46,8 @@ const fakeUpdatesMultiple = fakeUpdatesSingle.map(update => ({ ...update, group:
|
||||
describe(createSummary, () => {
|
||||
describe('single update group', () => {
|
||||
it('returns expected message for both platforms', () => {
|
||||
expect(createSummary(fakeUpdatesSingle, getVariables(fakeExpoConfig, fakeUpdatesSingle))).toMatchInlineSnapshot(`
|
||||
expect(createSummary(fakeUpdatesSingle, getVariables(fakeExpoConfig, fakeUpdatesSingle, fakeOptions)))
|
||||
.toMatchInlineSnapshot(`
|
||||
"🚀 Expo preview is ready!
|
||||
|
||||
- Project → **fake-project**
|
||||
@@ -48,25 +55,25 @@ describe(createSummary, () => {
|
||||
- Runtime Version → **exposdk:47.0.0**
|
||||
- **[More info](https://expo.dev/projects/fake-project-id/updates/fake-group-id)**
|
||||
|
||||
<a href="https://qr.expo.dev/eas-update?projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
|
||||
<a href="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
|
||||
|
||||
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)"
|
||||
`);
|
||||
});
|
||||
|
||||
it('returns expected message for both platforms with custom app scheme', () => {
|
||||
const customSchemeConfig = { ...fakeExpoConfig, scheme: 'expogithubaction' };
|
||||
expect(createSummary(fakeUpdatesSingle, getVariables(customSchemeConfig, fakeUpdatesSingle)))
|
||||
const customSchemeConfig = { ...fakeExpoConfig, scheme: ['ega', 'expogithubaction'] };
|
||||
expect(createSummary(fakeUpdatesSingle, getVariables(customSchemeConfig, fakeUpdatesSingle, fakeOptions)))
|
||||
.toMatchInlineSnapshot(`
|
||||
"🚀 Expo preview is ready!
|
||||
|
||||
- Project → **fake-project**
|
||||
- Platforms → **android**, **ios**
|
||||
- Scheme → **expogithubaction**
|
||||
- Scheme → **expogithubaction**, **ega**
|
||||
- Runtime Version → **exposdk:47.0.0**
|
||||
- **[More info](https://expo.dev/projects/fake-project-id/updates/fake-group-id)**
|
||||
|
||||
<a href="https://qr.expo.dev/eas-update?appScheme=expogithubaction&projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?appScheme=expogithubaction&projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
|
||||
<a href="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
|
||||
|
||||
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)"
|
||||
`);
|
||||
@@ -74,7 +81,7 @@ describe(createSummary, () => {
|
||||
|
||||
it('returns expected message for android only', () => {
|
||||
const fakeUpdate = fakeUpdatesSingle.filter(update => update.platform === 'android');
|
||||
expect(createSummary(fakeUpdate, getVariables(fakeExpoConfig, fakeUpdate))).toMatchInlineSnapshot(`
|
||||
expect(createSummary(fakeUpdate, getVariables(fakeExpoConfig, fakeUpdate, fakeOptions))).toMatchInlineSnapshot(`
|
||||
"🚀 Expo preview is ready!
|
||||
|
||||
- Project → **fake-project**
|
||||
@@ -82,7 +89,7 @@ describe(createSummary, () => {
|
||||
- Runtime Version → **exposdk:47.0.0**
|
||||
- **[More info](https://expo.dev/projects/fake-project-id/updates/fake-group-id)**
|
||||
|
||||
<a href="https://qr.expo.dev/eas-update?projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
|
||||
<a href="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
|
||||
|
||||
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)"
|
||||
`);
|
||||
@@ -90,7 +97,7 @@ describe(createSummary, () => {
|
||||
|
||||
it('returns expected message for ios only', () => {
|
||||
const fakeUpdate = fakeUpdatesSingle.filter(update => update.platform === 'ios');
|
||||
expect(createSummary(fakeUpdate, getVariables(fakeExpoConfig, fakeUpdate))).toMatchInlineSnapshot(`
|
||||
expect(createSummary(fakeUpdate, getVariables(fakeExpoConfig, fakeUpdate, fakeOptions))).toMatchInlineSnapshot(`
|
||||
"🚀 Expo preview is ready!
|
||||
|
||||
- Project → **fake-project**
|
||||
@@ -98,7 +105,7 @@ describe(createSummary, () => {
|
||||
- Runtime Version → **exposdk:47.0.0**
|
||||
- **[More info](https://expo.dev/projects/fake-project-id/updates/fake-group-id)**
|
||||
|
||||
<a href="https://qr.expo.dev/eas-update?projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
|
||||
<a href="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
|
||||
|
||||
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)"
|
||||
`);
|
||||
@@ -107,7 +114,56 @@ describe(createSummary, () => {
|
||||
|
||||
describe('mutliple update groups', () => {
|
||||
it('returns expected message for both platforms', () => {
|
||||
expect(createSummary(fakeUpdatesMultiple, getVariables(fakeExpoConfig, fakeUpdatesMultiple)))
|
||||
expect(createSummary(fakeUpdatesMultiple, getVariables(fakeExpoConfig, fakeUpdatesMultiple, fakeOptions)))
|
||||
.toMatchInlineSnapshot(`
|
||||
"🚀 Expo preview is ready!
|
||||
|
||||
- Project → **fake-project**
|
||||
- Platforms → **android**, **ios**
|
||||
|
||||
Android <br /> _(exposdk:47.0.0)_ <br /> **[More info](https://expo.dev/projects/fake-project-id/updates/fake-group-fake-android-id)** | iOS <br /> _(exposdk:47.0.0)_ <br /> **[More info](https://expo.dev/projects/fake-project-id/updates/fake-group-fake-ios-id)**
|
||||
--- | ---
|
||||
<a href="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-fake-android-id"><img src="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-fake-android-id" width="250px" height="250px" /></a> | <a href="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-fake-ios-id"><img src="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-fake-ios-id" width="250px" height="250px" /></a>
|
||||
|
||||
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)"
|
||||
`);
|
||||
});
|
||||
|
||||
it('returns expected message for android only', () => {
|
||||
const fakeUpdate = fakeUpdatesSingle.filter(update => update.platform === 'android');
|
||||
expect(createSummary(fakeUpdate, getVariables(fakeExpoConfig, fakeUpdate, fakeOptions))).toMatchInlineSnapshot(`
|
||||
"🚀 Expo preview is ready!
|
||||
|
||||
- Project → **fake-project**
|
||||
- Platform → **android**
|
||||
- Runtime Version → **exposdk:47.0.0**
|
||||
- **[More info](https://expo.dev/projects/fake-project-id/updates/fake-group-id)**
|
||||
|
||||
<a href="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
|
||||
|
||||
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)"
|
||||
`);
|
||||
});
|
||||
|
||||
it('returns expected message for ios only', () => {
|
||||
const fakeUpdate = fakeUpdatesSingle.filter(update => update.platform === 'ios');
|
||||
expect(createSummary(fakeUpdate, getVariables(fakeExpoConfig, fakeUpdate, fakeOptions))).toMatchInlineSnapshot(`
|
||||
"🚀 Expo preview is ready!
|
||||
|
||||
- Project → **fake-project**
|
||||
- Platform → **ios**
|
||||
- Runtime Version → **exposdk:47.0.0**
|
||||
- **[More info](https://expo.dev/projects/fake-project-id/updates/fake-group-id)**
|
||||
|
||||
<a href="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?appScheme=fake-project&projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
|
||||
|
||||
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)"
|
||||
`);
|
||||
});
|
||||
|
||||
it('returns Expo Go compatible QR code when forced', () => {
|
||||
const customOptions: typeof fakeOptions = { ...fakeOptions, qrTarget: 'expo-go' };
|
||||
expect(createSummary(fakeUpdatesMultiple, getVariables(fakeExpoConfig, fakeUpdatesMultiple, customOptions)))
|
||||
.toMatchInlineSnapshot(`
|
||||
"🚀 Expo preview is ready!
|
||||
|
||||
@@ -121,37 +177,5 @@ describe(createSummary, () => {
|
||||
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)"
|
||||
`);
|
||||
});
|
||||
|
||||
it('returns expected message for android only', () => {
|
||||
const fakeUpdate = fakeUpdatesSingle.filter(update => update.platform === 'android');
|
||||
expect(createSummary(fakeUpdate, getVariables(fakeExpoConfig, fakeUpdate))).toMatchInlineSnapshot(`
|
||||
"🚀 Expo preview is ready!
|
||||
|
||||
- Project → **fake-project**
|
||||
- Platform → **android**
|
||||
- Runtime Version → **exposdk:47.0.0**
|
||||
- **[More info](https://expo.dev/projects/fake-project-id/updates/fake-group-id)**
|
||||
|
||||
<a href="https://qr.expo.dev/eas-update?projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
|
||||
|
||||
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)"
|
||||
`);
|
||||
});
|
||||
|
||||
it('returns expected message for ios only', () => {
|
||||
const fakeUpdate = fakeUpdatesSingle.filter(update => update.platform === 'ios');
|
||||
expect(createSummary(fakeUpdate, getVariables(fakeExpoConfig, fakeUpdate))).toMatchInlineSnapshot(`
|
||||
"🚀 Expo preview is ready!
|
||||
|
||||
- Project → **fake-project**
|
||||
- Platform → **ios**
|
||||
- Runtime Version → **exposdk:47.0.0**
|
||||
- **[More info](https://expo.dev/projects/fake-project-id/updates/fake-group-id)**
|
||||
|
||||
<a href="https://qr.expo.dev/eas-update?projectId=fake-project-id&groupId=fake-group-id"><img src="https://qr.expo.dev/eas-update?projectId=fake-project-id&groupId=fake-group-id" width="250px" height="250px" /></a>
|
||||
|
||||
> Learn more about [𝝠 Expo Github Action](https://github.com/expo/expo-github-action/tree/main/preview#example-workflows)"
|
||||
`);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,57 @@
|
||||
import { ExpoConfig } from '@expo/config';
|
||||
|
||||
import { getQrTarget, getSchemesInOrderFromConfig } from '../src/comment';
|
||||
import { projectAppType } from '../src/expo';
|
||||
|
||||
jest.mock('../src/expo');
|
||||
|
||||
const fakeOptions = {
|
||||
workingDirectory: '',
|
||||
};
|
||||
|
||||
describe(getQrTarget, () => {
|
||||
it('returns `dev-build` for `qr-target: dev-build`', () => {
|
||||
expect(getQrTarget({ ...fakeOptions, qrTarget: 'dev-build' })).toBe('dev-build');
|
||||
});
|
||||
|
||||
it('returns `dev-build` for `qr-target: dev-client`', () => {
|
||||
expect(getQrTarget({ ...fakeOptions, qrTarget: 'dev-client' })).toBe('dev-build');
|
||||
});
|
||||
|
||||
it('returns `expo-go` for `qr-target: expo-go`', () => {
|
||||
expect(getQrTarget({ ...fakeOptions, qrTarget: 'expo-go' })).toBe('expo-go');
|
||||
});
|
||||
|
||||
it('throws for unknown `qr-target`', () => {
|
||||
expect(() => getQrTarget({ ...fakeOptions, qrTarget: 'unknown' } as any)).toThrow(
|
||||
`Invalid QR code target: "unknown", expected "expo-go" or "dev-build"`
|
||||
);
|
||||
});
|
||||
|
||||
it('returns infered `dev-build` when input is omitted', () => {
|
||||
jest.mocked(projectAppType).mockReturnValue('dev-build');
|
||||
expect(getQrTarget({ ...fakeOptions, qrTarget: undefined })).toBe('dev-build');
|
||||
});
|
||||
|
||||
it('returns infered `expo-go` when input is omitted', () => {
|
||||
jest.mocked(projectAppType).mockReturnValue('expo-go');
|
||||
expect(getQrTarget({ ...fakeOptions, qrTarget: undefined })).toBe('expo-go');
|
||||
});
|
||||
});
|
||||
|
||||
describe(getSchemesInOrderFromConfig, () => {
|
||||
it('returns empty array when not defined', () => {
|
||||
expect(getSchemesInOrderFromConfig({} as ExpoConfig)).toEqual([]);
|
||||
});
|
||||
|
||||
it('returns scheme as array when defined as string', () => {
|
||||
expect(getSchemesInOrderFromConfig({ scheme: 'ega' } as ExpoConfig)).toEqual(['ega']);
|
||||
});
|
||||
|
||||
it('returns schemes in order when defined as array', () => {
|
||||
expect(getSchemesInOrderFromConfig({ scheme: ['ega', 'expogithubaction'] } as ExpoConfig)).toEqual([
|
||||
'expogithubaction',
|
||||
'ega',
|
||||
]);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,36 @@
|
||||
import { getUpdateGroupQr } from '../src/eas';
|
||||
|
||||
describe(getUpdateGroupQr, () => {
|
||||
it('returns url for expo-go', () => {
|
||||
expect(
|
||||
getUpdateGroupQr({
|
||||
qrTarget: 'expo-go',
|
||||
projectId: 'projectId',
|
||||
updateGroupId: 'updateGroupId',
|
||||
appSlug: 'appslug',
|
||||
})
|
||||
).toBe('https://qr.expo.dev/eas-update?projectId=projectId&groupId=updateGroupId');
|
||||
});
|
||||
|
||||
it('returns url for dev-build', () => {
|
||||
expect(
|
||||
getUpdateGroupQr({
|
||||
qrTarget: 'dev-build',
|
||||
projectId: 'projectId',
|
||||
updateGroupId: 'updateGroupId',
|
||||
appSlug: 'appslug',
|
||||
})
|
||||
).toBe('https://qr.expo.dev/eas-update?appScheme=appslug&projectId=projectId&groupId=updateGroupId');
|
||||
});
|
||||
|
||||
it('returns url for dev-build, with `_` in appSlug', () => {
|
||||
expect(
|
||||
getUpdateGroupQr({
|
||||
qrTarget: 'dev-build',
|
||||
projectId: 'projectId',
|
||||
updateGroupId: 'updateGroupId',
|
||||
appSlug: 'hello_world',
|
||||
})
|
||||
).toBe('https://qr.expo.dev/eas-update?appScheme=helloworld&projectId=projectId&groupId=updateGroupId');
|
||||
});
|
||||
});
|
||||
+4
-2
@@ -1,8 +1,10 @@
|
||||
{
|
||||
"extends": "@tsconfig/node16",
|
||||
"extends": "@tsconfig/node20",
|
||||
"compilerOptions": {
|
||||
"outDir": "./build",
|
||||
"rootDir": "./src"
|
||||
"rootDir": "./src",
|
||||
"module": "CommonJS",
|
||||
"moduleResolution": "node"
|
||||
},
|
||||
"exclude": [
|
||||
"build",
|
||||
|
||||
Reference in new issue
Block a user