From 554933ad00968db77b2c698491dd7e922cd034fa Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 14:56:52 -0400 Subject: [PATCH 01/24] Add GitHub token to Cocoapods Github URL to avoid throttling. --- .github/workflows/cpp-packaging.yml | 13 +++++++++++++ .github/workflows/integration_tests.yml | 13 +++++++++++++ .github/workflows/ios.yml | 12 ++++++++++++ 3 files changed, 38 insertions(+) diff --git a/.github/workflows/cpp-packaging.yml b/.github/workflows/cpp-packaging.yml index 74aeb6b5c3..2b60ea76ee 100644 --- a/.github/workflows/cpp-packaging.yml +++ b/.github/workflows/cpp-packaging.yml @@ -401,6 +401,19 @@ jobs: fi echo "VERBOSE_FLAG=${verbose_flag}" >> $GITHUB_ENV + - name: add GitHub token to Cocoapods repo (macos) + if: runner.os == 'macOS' + run: | + # Change the remote URL for this pod repo to include the GitHub token. + pod repo list + if [[ -d ~/.cocoapods/repos/cocoapods ]]; then + cd ~/.cocoapods/repos/cocoapods + git remote set-url origin https://${GITHUB_TOKEN}@github.com/CocoaPods/Specs.git + cd - + else + pod repo add cocoapods ${GITHUB_TOKEN}/@github.com/CocoaPods/Specs.git + fi + # Run the build in the host OS default shell since Windows can't handle long path names in bash. - name: Build desktop SDK run: | diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index f703331ca4..bca6e131e9 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -274,6 +274,19 @@ jobs: startsWith(matrix.os, 'ubuntu') run: | sudo apt install openssl + - name: add GitHub token to Cocoapods repo (macos) + if: runner.os == 'macOS' + run: | + # Change the remote URL for this pod repo to include the GitHub token. + pod repo list + if [[ -d ~/.cocoapods/repos/cocoapods ]]; then + cd ~/.cocoapods/repos/cocoapods + git remote set-url origin https://${GITHUB_TOKEN}@github.com/CocoaPods/Specs.git + cd - + else + pod repo add cocoapods https://${GITHUB_TOKEN}@github.com/CocoaPods/Specs.git + fi + - name: Fetch prebuilt packaged SDK from previous run uses: dawidd6/action-download-artifact@v2 if: ${{ github.event.inputs.test_packaged_sdk != '' }} diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index a1a8051071..67ed8a429b 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -53,6 +53,18 @@ jobs: run: | build_scripts/ios/install_prereqs.sh + - name: add GitHub token to Cocoapods repo (macos) + run: | + # Change the remote URL for this pod repo to include the GitHub token. + pod repo list + if [[ -d ~/.cocoapods/repos/cocoapods ]]; then + cd ~/.cocoapods/repos/cocoapods + git remote set-url origin https://${GITHUB_TOKEN}@github.com/CocoaPods/Specs.git + cd - + else + pod repo add cocoapods ${GITHUB_TOKEN}/@github.com/CocoaPods/Specs.git + fi + - name: Build SDK run: | build_scripts/ios/build.sh -b ios_build -s . From c3de00e72ce1545b7d9d1bff6631e142eaebdeed Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 15:08:25 -0400 Subject: [PATCH 02/24] Use github.token instead of ${GITHUB_TOKEN}; fix URL. --- .github/workflows/cpp-packaging.yml | 5 +++-- .github/workflows/integration_tests.yml | 4 ++-- .github/workflows/ios.yml | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cpp-packaging.yml b/.github/workflows/cpp-packaging.yml index 2b60ea76ee..d6264896e2 100644 --- a/.github/workflows/cpp-packaging.yml +++ b/.github/workflows/cpp-packaging.yml @@ -37,6 +37,7 @@ env: xcodeVersion: "12.2" # LLVM version with ARM MachO support has no version number yet. llvmVer: "5f187f0afaad33013ba03454c4749d99b1362534" + GITHUB_TOKEN: ${{ github.token }} jobs: log_inputs: @@ -408,10 +409,10 @@ jobs: pod repo list if [[ -d ~/.cocoapods/repos/cocoapods ]]; then cd ~/.cocoapods/repos/cocoapods - git remote set-url origin https://${GITHUB_TOKEN}@github.com/CocoaPods/Specs.git + git remote set-url origin https://${{ github.token}}@github.com/CocoaPods/Specs.git cd - else - pod repo add cocoapods ${GITHUB_TOKEN}/@github.com/CocoaPods/Specs.git + pod repo add cocoapods https://${{ github.token }}@github.com/CocoaPods/Specs.git fi # Run the build in the host OS default shell since Windows can't handle long path names in bash. diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index bca6e131e9..bd20187d4d 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -281,10 +281,10 @@ jobs: pod repo list if [[ -d ~/.cocoapods/repos/cocoapods ]]; then cd ~/.cocoapods/repos/cocoapods - git remote set-url origin https://${GITHUB_TOKEN}@github.com/CocoaPods/Specs.git + git remote set-url origin https://${{ github.token }}@github.com/CocoaPods/Specs.git cd - else - pod repo add cocoapods https://${GITHUB_TOKEN}@github.com/CocoaPods/Specs.git + pod repo add cocoapods https://${{ github.token }}@github.com/CocoaPods/Specs.git fi - name: Fetch prebuilt packaged SDK from previous run diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 67ed8a429b..c7ed4b46a0 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -59,10 +59,10 @@ jobs: pod repo list if [[ -d ~/.cocoapods/repos/cocoapods ]]; then cd ~/.cocoapods/repos/cocoapods - git remote set-url origin https://${GITHUB_TOKEN}@github.com/CocoaPods/Specs.git + git remote set-url origin https://${{ github.token }}@github.com/CocoaPods/Specs.git cd - else - pod repo add cocoapods ${GITHUB_TOKEN}/@github.com/CocoaPods/Specs.git + pod repo add cocoapods https://${{ github.token }}@github.com/CocoaPods/Specs.git fi - name: Build SDK From eaf479abda25eb9b6aec9569b315d28e82601994 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 15:22:07 -0400 Subject: [PATCH 03/24] Only temporarily modify the repo URL to include the token. Otherwise, Cocoapods loses track of which repo this is and attempts to fetch it again when you run pod install. --- .github/workflows/cpp-packaging.yml | 20 ++++++++++++-------- .github/workflows/integration_tests.yml | 21 ++++++++++++--------- .github/workflows/ios.yml | 20 ++++++++++++-------- 3 files changed, 36 insertions(+), 25 deletions(-) diff --git a/.github/workflows/cpp-packaging.yml b/.github/workflows/cpp-packaging.yml index d6264896e2..d75b377fd4 100644 --- a/.github/workflows/cpp-packaging.yml +++ b/.github/workflows/cpp-packaging.yml @@ -402,18 +402,22 @@ jobs: fi echo "VERBOSE_FLAG=${verbose_flag}" >> $GITHUB_ENV - - name: add GitHub token to Cocoapods repo (macos) + - name: Fetch Cocoapods repo with github token (macos) if: runner.os == 'macOS' run: | - # Change the remote URL for this pod repo to include the GitHub token. + # Temporarily modify the remote URL for this pod repo to include the GitHub token, + # then perform a repo update, to ensure the latest repo (not throttled by GitHub). pod repo list - if [[ -d ~/.cocoapods/repos/cocoapods ]]; then - cd ~/.cocoapods/repos/cocoapods - git remote set-url origin https://${{ github.token}}@github.com/CocoaPods/Specs.git - cd - - else - pod repo add cocoapods https://${{ github.token }}@github.com/CocoaPods/Specs.git + if [[ ! -d ~/.cocoapods/repos/cocoapods ]]; then + # Get the pod repo first, if it doesn't exist already. + pod repo add cocoapods https://github.com/CocoaPods/Specs.git fi + # Temporarily set it to use the token, and use that to update. + cd ~/.cocoapods/repos/cocoapods + git remote set-url origin https://${{ github.token }}@github.com/CocoaPods/Specs.git + pod repo update + git remote set-url origin https://github.com/CocoaPods/Specs.git + cd - # Run the build in the host OS default shell since Windows can't handle long path names in bash. - name: Build desktop SDK diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index bd20187d4d..59d9cec892 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -274,19 +274,22 @@ jobs: startsWith(matrix.os, 'ubuntu') run: | sudo apt install openssl - - name: add GitHub token to Cocoapods repo (macos) + - name: Fetch Cocoapods repo with github token (macos) if: runner.os == 'macOS' run: | - # Change the remote URL for this pod repo to include the GitHub token. + # Temporarily modify the remote URL for this pod repo to include the GitHub token, + # then perform a repo update, to ensure the latest repo (not throttled by GitHub). pod repo list - if [[ -d ~/.cocoapods/repos/cocoapods ]]; then - cd ~/.cocoapods/repos/cocoapods - git remote set-url origin https://${{ github.token }}@github.com/CocoaPods/Specs.git - cd - - else - pod repo add cocoapods https://${{ github.token }}@github.com/CocoaPods/Specs.git + if [[ ! -d ~/.cocoapods/repos/cocoapods ]]; then + # Get the pod repo first, if it doesn't exist already. + pod repo add cocoapods https://github.com/CocoaPods/Specs.git fi - + # Temporarily set it to use the token, and use that to update. + cd ~/.cocoapods/repos/cocoapods + git remote set-url origin https://${{ github.token }}@github.com/CocoaPods/Specs.git + pod repo update + git remote set-url origin https://github.com/CocoaPods/Specs.git + cd - - name: Fetch prebuilt packaged SDK from previous run uses: dawidd6/action-download-artifact@v2 if: ${{ github.event.inputs.test_packaged_sdk != '' }} diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index c7ed4b46a0..7e8be27c18 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -53,17 +53,21 @@ jobs: run: | build_scripts/ios/install_prereqs.sh - - name: add GitHub token to Cocoapods repo (macos) + - name: Fetch Cocoapods repo with github token (macos) run: | - # Change the remote URL for this pod repo to include the GitHub token. + # Temporarily modify the remote URL for this pod repo to include the GitHub token, + # then perform a repo update, to ensure the latest repo (not throttled by GitHub). pod repo list - if [[ -d ~/.cocoapods/repos/cocoapods ]]; then - cd ~/.cocoapods/repos/cocoapods - git remote set-url origin https://${{ github.token }}@github.com/CocoaPods/Specs.git - cd - - else - pod repo add cocoapods https://${{ github.token }}@github.com/CocoaPods/Specs.git + if [[ ! -d ~/.cocoapods/repos/cocoapods ]]; then + # Get the pod repo first, if it doesn't exist already. + pod repo add cocoapods https://github.com/CocoaPods/Specs.git fi + # Temporarily set it to use the token, and use that to update. + cd ~/.cocoapods/repos/cocoapods + git remote set-url origin https://${{ github.token }}@github.com/CocoaPods/Specs.git + pod repo update + git remote set-url origin https://github.com/CocoaPods/Specs.git + cd - - name: Build SDK run: | From 82e06c58ff9663771eda1892236e8c6d8412e1ef Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 15:35:55 -0400 Subject: [PATCH 04/24] Initially add the cocoapods repo with the token --- .github/workflows/cpp-packaging.yml | 9 ++++++--- .github/workflows/integration_tests.yml | 9 ++++++--- .github/workflows/ios.yml | 9 ++++++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cpp-packaging.yml b/.github/workflows/cpp-packaging.yml index d75b377fd4..978826b131 100644 --- a/.github/workflows/cpp-packaging.yml +++ b/.github/workflows/cpp-packaging.yml @@ -410,12 +410,15 @@ jobs: pod repo list if [[ ! -d ~/.cocoapods/repos/cocoapods ]]; then # Get the pod repo first, if it doesn't exist already. - pod repo add cocoapods https://github.com/CocoaPods/Specs.git + pod repo add cocoapods https://${{ github.token }}@github.com/CocoaPods/Specs.git + else + cd ~/.cocoapods/repos/cocoapods + git remote set-url origin https://${{ github.token }}@github.com/CocoaPods/Specs.git + cd - fi # Temporarily set it to use the token, and use that to update. - cd ~/.cocoapods/repos/cocoapods - git remote set-url origin https://${{ github.token }}@github.com/CocoaPods/Specs.git pod repo update + cd ~/.cocoapods/repos/cocoapods git remote set-url origin https://github.com/CocoaPods/Specs.git cd - diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 59d9cec892..0a840b9823 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -282,12 +282,15 @@ jobs: pod repo list if [[ ! -d ~/.cocoapods/repos/cocoapods ]]; then # Get the pod repo first, if it doesn't exist already. - pod repo add cocoapods https://github.com/CocoaPods/Specs.git + pod repo add cocoapods https://${{ github.token }}@github.com/CocoaPods/Specs.git + else + cd ~/.cocoapods/repos/cocoapods + git remote set-url origin https://${{ github.token }}@github.com/CocoaPods/Specs.git + cd - fi # Temporarily set it to use the token, and use that to update. - cd ~/.cocoapods/repos/cocoapods - git remote set-url origin https://${{ github.token }}@github.com/CocoaPods/Specs.git pod repo update + cd ~/.cocoapods/repos/cocoapods git remote set-url origin https://github.com/CocoaPods/Specs.git cd - - name: Fetch prebuilt packaged SDK from previous run diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 7e8be27c18..5cb5d52319 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -60,12 +60,15 @@ jobs: pod repo list if [[ ! -d ~/.cocoapods/repos/cocoapods ]]; then # Get the pod repo first, if it doesn't exist already. - pod repo add cocoapods https://github.com/CocoaPods/Specs.git + pod repo add cocoapods https://${{ github.token }}@github.com/CocoaPods/Specs.git + else + cd ~/.cocoapods/repos/cocoapods + git remote set-url origin https://${{ github.token }}@github.com/CocoaPods/Specs.git + cd - fi # Temporarily set it to use the token, and use that to update. - cd ~/.cocoapods/repos/cocoapods - git remote set-url origin https://${{ github.token }}@github.com/CocoaPods/Specs.git pod repo update + cd ~/.cocoapods/repos/cocoapods git remote set-url origin https://github.com/CocoaPods/Specs.git cd - From 28f7b202d4e20a079640447f99cadc8c7c6ab93e Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 16:03:02 -0400 Subject: [PATCH 05/24] Change flow slightly --- .github/workflows/cpp-packaging.yml | 5 +++-- .github/workflows/integration_tests.yml | 5 +++-- .github/workflows/ios.yml | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cpp-packaging.yml b/.github/workflows/cpp-packaging.yml index 978826b131..e6805e7a56 100644 --- a/.github/workflows/cpp-packaging.yml +++ b/.github/workflows/cpp-packaging.yml @@ -412,12 +412,13 @@ jobs: # Get the pod repo first, if it doesn't exist already. pod repo add cocoapods https://${{ github.token }}@github.com/CocoaPods/Specs.git else + # Temporarily set it to use the token, and use that to update. cd ~/.cocoapods/repos/cocoapods git remote set-url origin https://${{ github.token }}@github.com/CocoaPods/Specs.git + pod repo update cd - fi - # Temporarily set it to use the token, and use that to update. - pod repo update + # Set the source back to non-token URL. cd ~/.cocoapods/repos/cocoapods git remote set-url origin https://github.com/CocoaPods/Specs.git cd - diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 0a840b9823..a138b8d961 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -284,12 +284,13 @@ jobs: # Get the pod repo first, if it doesn't exist already. pod repo add cocoapods https://${{ github.token }}@github.com/CocoaPods/Specs.git else + # Temporarily set it to use the token, and use that to update. cd ~/.cocoapods/repos/cocoapods git remote set-url origin https://${{ github.token }}@github.com/CocoaPods/Specs.git + pod repo update cd - fi - # Temporarily set it to use the token, and use that to update. - pod repo update + # Set the source back to non-token URL. cd ~/.cocoapods/repos/cocoapods git remote set-url origin https://github.com/CocoaPods/Specs.git cd - diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 5cb5d52319..3f9711f4e8 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -62,12 +62,13 @@ jobs: # Get the pod repo first, if it doesn't exist already. pod repo add cocoapods https://${{ github.token }}@github.com/CocoaPods/Specs.git else + # Temporarily set it to use the token, and use that to update. cd ~/.cocoapods/repos/cocoapods git remote set-url origin https://${{ github.token }}@github.com/CocoaPods/Specs.git + pod repo update cd - fi - # Temporarily set it to use the token, and use that to update. - pod repo update + # Set the source back to non-token URL. cd ~/.cocoapods/repos/cocoapods git remote set-url origin https://github.com/CocoaPods/Specs.git cd - From 0adc2624cb0acb701d593d777819c6b95afeb9ef Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 16:14:47 -0400 Subject: [PATCH 06/24] Fix integration test --- .github/workflows/integration_tests.yml | 40 ++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index a138b8d961..fc89447a84 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -274,26 +274,6 @@ jobs: startsWith(matrix.os, 'ubuntu') run: | sudo apt install openssl - - name: Fetch Cocoapods repo with github token (macos) - if: runner.os == 'macOS' - run: | - # Temporarily modify the remote URL for this pod repo to include the GitHub token, - # then perform a repo update, to ensure the latest repo (not throttled by GitHub). - pod repo list - if [[ ! -d ~/.cocoapods/repos/cocoapods ]]; then - # Get the pod repo first, if it doesn't exist already. - pod repo add cocoapods https://${{ github.token }}@github.com/CocoaPods/Specs.git - else - # Temporarily set it to use the token, and use that to update. - cd ~/.cocoapods/repos/cocoapods - git remote set-url origin https://${{ github.token }}@github.com/CocoaPods/Specs.git - pod repo update - cd - - fi - # Set the source back to non-token URL. - cd ~/.cocoapods/repos/cocoapods - git remote set-url origin https://github.com/CocoaPods/Specs.git - cd - - name: Fetch prebuilt packaged SDK from previous run uses: dawidd6/action-download-artifact@v2 if: ${{ github.event.inputs.test_packaged_sdk != '' }} @@ -536,6 +516,26 @@ jobs: # homebrew. This prevents errors arising from the shut down of # binutils, used by older version of homebrew for hosting packages. brew update + - name: Fetch Cocoapods repo with github token (macos) + if: runner.os == 'macOS' + run: | + # Temporarily modify the remote URL for this pod repo to include the GitHub token, + # then perform a repo update, to ensure the latest repo (not throttled by GitHub). + pod repo list + if [[ ! -d ~/.cocoapods/repos/cocoapods ]]; then + # Get the pod repo first, if it doesn't exist already. + pod repo add cocoapods https://${{ github.token }}@github.com/CocoaPods/Specs.git + else + # Temporarily set it to use the token, and use that to update. + cd ~/.cocoapods/repos/cocoapods + git remote set-url origin https://${{ github.token }}@github.com/CocoaPods/Specs.git + pod repo update + cd - + fi + # Set the source back to non-token URL. + cd ~/.cocoapods/repos/cocoapods + git remote set-url origin https://github.com/CocoaPods/Specs.git + cd - - name: Install SDK iOS prerequisites run: build_scripts/ios/install_prereqs.sh - name: Prepare for integration tests From bd8ecb468faed7fc8003e29cf45971188ee8eb86 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 16:16:34 -0400 Subject: [PATCH 07/24] Fix --- .github/workflows/integration_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index fc89447a84..8af7fea818 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -517,7 +517,7 @@ jobs: # binutils, used by older version of homebrew for hosting packages. brew update - name: Fetch Cocoapods repo with github token (macos) - if: runner.os == 'macOS' + if: startsWith(matrix.os, 'macos') run: | # Temporarily modify the remote URL for this pod repo to include the GitHub token, # then perform a repo update, to ensure the latest repo (not throttled by GitHub). From 084482375b0a9855e5475314de2524aa94222920 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 16:39:02 -0400 Subject: [PATCH 08/24] Remove pod repo list command. --- .github/workflows/cpp-packaging.yml | 1 - .github/workflows/integration_tests.yml | 1 - .github/workflows/ios.yml | 1 - 3 files changed, 3 deletions(-) diff --git a/.github/workflows/cpp-packaging.yml b/.github/workflows/cpp-packaging.yml index e6805e7a56..f9cb311707 100644 --- a/.github/workflows/cpp-packaging.yml +++ b/.github/workflows/cpp-packaging.yml @@ -407,7 +407,6 @@ jobs: run: | # Temporarily modify the remote URL for this pod repo to include the GitHub token, # then perform a repo update, to ensure the latest repo (not throttled by GitHub). - pod repo list if [[ ! -d ~/.cocoapods/repos/cocoapods ]]; then # Get the pod repo first, if it doesn't exist already. pod repo add cocoapods https://${{ github.token }}@github.com/CocoaPods/Specs.git diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 8af7fea818..579baf8cff 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -521,7 +521,6 @@ jobs: run: | # Temporarily modify the remote URL for this pod repo to include the GitHub token, # then perform a repo update, to ensure the latest repo (not throttled by GitHub). - pod repo list if [[ ! -d ~/.cocoapods/repos/cocoapods ]]; then # Get the pod repo first, if it doesn't exist already. pod repo add cocoapods https://${{ github.token }}@github.com/CocoaPods/Specs.git diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 3f9711f4e8..c7fc4c0d8b 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -57,7 +57,6 @@ jobs: run: | # Temporarily modify the remote URL for this pod repo to include the GitHub token, # then perform a repo update, to ensure the latest repo (not throttled by GitHub). - pod repo list if [[ ! -d ~/.cocoapods/repos/cocoapods ]]; then # Get the pod repo first, if it doesn't exist already. pod repo add cocoapods https://${{ github.token }}@github.com/CocoaPods/Specs.git From d529fdc7b793e8851f6911ad837edcdfda3bb93e Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 16:42:38 -0400 Subject: [PATCH 09/24] Move C++ packaging step to the right place. --- .github/workflows/cpp-packaging.yml | 39 ++++++++++++++--------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/.github/workflows/cpp-packaging.yml b/.github/workflows/cpp-packaging.yml index f9cb311707..02225aff51 100644 --- a/.github/workflows/cpp-packaging.yml +++ b/.github/workflows/cpp-packaging.yml @@ -197,6 +197,25 @@ jobs: with: python-version: 3.7 + - name: Fetch Cocoapods repo with github token (macos) + run: | + # Temporarily modify the remote URL for this pod repo to include the GitHub token, + # then perform a repo update, to ensure the latest repo (not throttled by GitHub). + if [[ ! -d ~/.cocoapods/repos/cocoapods ]]; then + # Get the pod repo first, if it doesn't exist already. + pod repo add cocoapods https://${{ github.token }}@github.com/CocoaPods/Specs.git + else + # Temporarily set it to use the token, and use that to update. + cd ~/.cocoapods/repos/cocoapods + git remote set-url origin https://${{ github.token }}@github.com/CocoaPods/Specs.git + pod repo update + cd - + fi + # Set the source back to non-token URL. + cd ~/.cocoapods/repos/cocoapods + git remote set-url origin https://github.com/CocoaPods/Specs.git + cd - + - name: install prerequisites run: sdk-src/build_scripts/ios/install_prereqs.sh @@ -402,26 +421,6 @@ jobs: fi echo "VERBOSE_FLAG=${verbose_flag}" >> $GITHUB_ENV - - name: Fetch Cocoapods repo with github token (macos) - if: runner.os == 'macOS' - run: | - # Temporarily modify the remote URL for this pod repo to include the GitHub token, - # then perform a repo update, to ensure the latest repo (not throttled by GitHub). - if [[ ! -d ~/.cocoapods/repos/cocoapods ]]; then - # Get the pod repo first, if it doesn't exist already. - pod repo add cocoapods https://${{ github.token }}@github.com/CocoaPods/Specs.git - else - # Temporarily set it to use the token, and use that to update. - cd ~/.cocoapods/repos/cocoapods - git remote set-url origin https://${{ github.token }}@github.com/CocoaPods/Specs.git - pod repo update - cd - - fi - # Set the source back to non-token URL. - cd ~/.cocoapods/repos/cocoapods - git remote set-url origin https://github.com/CocoaPods/Specs.git - cd - - # Run the build in the host OS default shell since Windows can't handle long path names in bash. - name: Build desktop SDK run: | From 91b05011cbdb9d90e6980bb1053e015eebab2e02 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 17:02:44 -0400 Subject: [PATCH 10/24] Add GITHUB_TOKEN env var to other workflows. --- .github/workflows/android.yml | 1 + .github/workflows/desktop.yml | 1 + .github/workflows/integration_tests.yml | 3 +-- .github/workflows/ios.yml | 4 ++++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index a8818e7d53..a544072575 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -12,6 +12,7 @@ on: env: CCACHE_DIR: ${{ github.workspace }}/ccache_dir + GITHUB_TOKEN: ${{ github.token }} jobs: prepare_matrix: diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 9e3bb37213..29158ef295 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -12,6 +12,7 @@ on: env: CCACHE_DIR: ${{ github.workspace }}/ccache_dir + GITHUB_TOKEN: ${{ github.token }} jobs: prepare_matrix: diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 579baf8cff..bc34613ada 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -47,6 +47,7 @@ env: statusCommentIdentifier: "integration-test-status-comment" pythonVersion: '3.7' artifactRetentionDays: 2 + GITHUB_TOKEN: ${{ github.token }} jobs: check_and_prepare: @@ -69,8 +70,6 @@ jobs: uses: lannonbr/repo-permission-check-action@2.0.0 with: permission: "admin" - env: - GITHUB_TOKEN: ${{ github.token }} ### It sets "github_ref,trigger,pr_number,requested_tests" outputs to control the following jobs and steps ### trigger value: manual_trigger, scheduled_trigger, label_trigger, postsubmit_trigger - id: set_outputs diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index c7fc4c0d8b..27bbafe2e9 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -9,6 +9,10 @@ on: description: 'Use an expanded matrix?' default: '0' required: true + +env: + GITHUB_TOKEN: ${{ github.token }} + jobs: prepare_matrix: runs-on: ubuntu-latest From 58290295a1c1b1c854f6de31032e414832d3a648 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 22:33:41 -0400 Subject: [PATCH 11/24] For debugging, check the git credentials --- .github/workflows/ios.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 27bbafe2e9..97b6b0406d 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -59,6 +59,7 @@ jobs: - name: Fetch Cocoapods repo with github token (macos) run: | + cat .git-credentials # Temporarily modify the remote URL for this pod repo to include the GitHub token, # then perform a repo update, to ensure the latest repo (not throttled by GitHub). if [[ ! -d ~/.cocoapods/repos/cocoapods ]]; then From 4bc4a50530398c1e3e348c7658867b85fb340a11 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 22:36:26 -0400 Subject: [PATCH 12/24] Reorder --- .github/workflows/ios.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 97b6b0406d..47403b5284 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -53,13 +53,10 @@ jobs: python-version: 3.7 architecture: "x64" - - name: Install prerequisites - run: | - build_scripts/ios/install_prereqs.sh - - name: Fetch Cocoapods repo with github token (macos) run: | - cat .git-credentials + git config --global credential.helper store + .git-credentials # Temporarily modify the remote URL for this pod repo to include the GitHub token, # then perform a repo update, to ensure the latest repo (not throttled by GitHub). if [[ ! -d ~/.cocoapods/repos/cocoapods ]]; then @@ -77,6 +74,10 @@ jobs: git remote set-url origin https://github.com/CocoaPods/Specs.git cd - + - name: Install prerequisites + run: | + build_scripts/ios/install_prereqs.sh + - name: Build SDK run: | build_scripts/ios/build.sh -b ios_build -s . From abb9dd0b160453c71c79d57a02d9ca5b352108de Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 22:37:49 -0400 Subject: [PATCH 13/24] Fix debug output --- .github/workflows/ios.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 47403b5284..d37d4fd3b7 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -56,7 +56,7 @@ jobs: - name: Fetch Cocoapods repo with github token (macos) run: | git config --global credential.helper store - .git-credentials + cat .git-credentials # Temporarily modify the remote URL for this pod repo to include the GitHub token, # then perform a repo update, to ensure the latest repo (not throttled by GitHub). if [[ ! -d ~/.cocoapods/repos/cocoapods ]]; then From 1df837a53effdf8da02ca180a0b16dc4a76dc885 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 22:40:34 -0400 Subject: [PATCH 14/24] Try using git-credentials --- .github/workflows/ios.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index d37d4fd3b7..e59b095141 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -55,8 +55,10 @@ jobs: - name: Fetch Cocoapods repo with github token (macos) run: | + echo 'https://bad${{ github.token }}@github.com' > ~/.git-credentials git config --global credential.helper store - cat .git-credentials + pod repo add cocoapods https://github.com/CocoaPods/Specs.git + exit # Temporarily modify the remote URL for this pod repo to include the GitHub token, # then perform a repo update, to ensure the latest repo (not throttled by GitHub). if [[ ! -d ~/.cocoapods/repos/cocoapods ]]; then From c468b2fb29264494ba6a43731536044f74b747b4 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 22:42:01 -0400 Subject: [PATCH 15/24] Try bad token for debugging --- .github/workflows/ios.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index e59b095141..8bd141eccd 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -57,7 +57,7 @@ jobs: run: | echo 'https://bad${{ github.token }}@github.com' > ~/.git-credentials git config --global credential.helper store - pod repo add cocoapods https://github.com/CocoaPods/Specs.git + pod repo add cocoapods https://bad${{ github.token }}@github.com/CocoaPods/Specs.git exit # Temporarily modify the remote URL for this pod repo to include the GitHub token, # then perform a repo update, to ensure the latest repo (not throttled by GitHub). From bddf4fb99e2621e4ab4b7f0a888f7a44a1574a07 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 22:44:29 -0400 Subject: [PATCH 16/24] Try new path to credentials --- .github/workflows/ios.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 8bd141eccd..889d34ce90 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -55,6 +55,7 @@ jobs: - name: Fetch Cocoapods repo with github token (macos) run: | + cat $XDG_CONFIG_HOME/git/credentials echo 'https://bad${{ github.token }}@github.com' > ~/.git-credentials git config --global credential.helper store pod repo add cocoapods https://bad${{ github.token }}@github.com/CocoaPods/Specs.git From 66a2402ec5fe62f9217ea09f0bce4aa300a80c2a Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 22:46:21 -0400 Subject: [PATCH 17/24] More config debugging --- .github/workflows/ios.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 889d34ce90..084c97867d 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -55,9 +55,11 @@ jobs: - name: Fetch Cocoapods repo with github token (macos) run: | + git config --global credential.helper store cat $XDG_CONFIG_HOME/git/credentials + echo "-----" + cat .gitconfig echo 'https://bad${{ github.token }}@github.com' > ~/.git-credentials - git config --global credential.helper store pod repo add cocoapods https://bad${{ github.token }}@github.com/CocoaPods/Specs.git exit # Temporarily modify the remote URL for this pod repo to include the GitHub token, From 4d9485917a1465d0df88c4d83729ebde6124eefe Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 22:48:01 -0400 Subject: [PATCH 18/24] Fix script --- .github/workflows/ios.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 084c97867d..5d2fb8b26f 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -56,8 +56,6 @@ jobs: - name: Fetch Cocoapods repo with github token (macos) run: | git config --global credential.helper store - cat $XDG_CONFIG_HOME/git/credentials - echo "-----" cat .gitconfig echo 'https://bad${{ github.token }}@github.com' > ~/.git-credentials pod repo add cocoapods https://bad${{ github.token }}@github.com/CocoaPods/Specs.git From 24c2dbd5896db9eb6384f1a7c23023b36912c333 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 22:50:34 -0400 Subject: [PATCH 19/24] Try home path --- .github/workflows/ios.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 5d2fb8b26f..55bf92e413 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -56,7 +56,7 @@ jobs: - name: Fetch Cocoapods repo with github token (macos) run: | git config --global credential.helper store - cat .gitconfig + cat ~/.git-credentials || true echo 'https://bad${{ github.token }}@github.com' > ~/.git-credentials pod repo add cocoapods https://bad${{ github.token }}@github.com/CocoaPods/Specs.git exit From 72be028f2d1f3aed84f11ad298a9dd21acde0033 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 22:55:10 -0400 Subject: [PATCH 20/24] Remove bad token --- .github/workflows/ios.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 55bf92e413..8b1cc98e01 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -57,8 +57,7 @@ jobs: run: | git config --global credential.helper store cat ~/.git-credentials || true - echo 'https://bad${{ github.token }}@github.com' > ~/.git-credentials - pod repo add cocoapods https://bad${{ github.token }}@github.com/CocoaPods/Specs.git + echo 'https://${{ github.token }}@github.com' > ~/.git-credentials exit # Temporarily modify the remote URL for this pod repo to include the GitHub token, # then perform a repo update, to ensure the latest repo (not throttled by GitHub). From 0fa2e619f5408f6b6e776eda091084b54ea741b9 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 23:00:52 -0400 Subject: [PATCH 21/24] Try using git credential-helper instead --- .github/workflows/ios.yml | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 8b1cc98e01..7013cc011e 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -53,28 +53,11 @@ jobs: python-version: 3.7 architecture: "x64" - - name: Fetch Cocoapods repo with github token (macos) + - name: Store git credentials for all git commands run: | - git config --global credential.helper store - cat ~/.git-credentials || true + git config --global --get-regexp . + git config --global credential.helper 'store --file ~/.git-credentials' echo 'https://${{ github.token }}@github.com' > ~/.git-credentials - exit - # Temporarily modify the remote URL for this pod repo to include the GitHub token, - # then perform a repo update, to ensure the latest repo (not throttled by GitHub). - if [[ ! -d ~/.cocoapods/repos/cocoapods ]]; then - # Get the pod repo first, if it doesn't exist already. - pod repo add cocoapods https://${{ github.token }}@github.com/CocoaPods/Specs.git - else - # Temporarily set it to use the token, and use that to update. - cd ~/.cocoapods/repos/cocoapods - git remote set-url origin https://${{ github.token }}@github.com/CocoaPods/Specs.git - pod repo update - cd - - fi - # Set the source back to non-token URL. - cd ~/.cocoapods/repos/cocoapods - git remote set-url origin https://github.com/CocoaPods/Specs.git - cd - - name: Install prerequisites run: | From 30316196fa8d3893968025ffc250533d49b812f4 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 23:03:28 -0400 Subject: [PATCH 22/24] Check that config was set --- .github/workflows/ios.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 7013cc011e..d699ac14a4 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -58,6 +58,7 @@ jobs: git config --global --get-regexp . git config --global credential.helper 'store --file ~/.git-credentials' echo 'https://${{ github.token }}@github.com' > ~/.git-credentials + git config --global --get-regexp . - name: Install prerequisites run: | From 74b2c32131da70238fc4c6e504ba3e940151d257 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 23:17:41 -0400 Subject: [PATCH 23/24] Set git credential token instead of manually changing pod source. --- .github/workflows/android.yml | 7 +++++ .github/workflows/cpp-packaging.yml | 40 +++++++++++++------------ .github/workflows/desktop.yml | 7 +++++ .github/workflows/integration_tests.yml | 37 +++++++++++------------ .github/workflows/ios.yml | 14 ++++----- 5 files changed, 60 insertions(+), 45 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index a544072575..fcabfd9436 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -46,6 +46,13 @@ jobs: architecture: ${{ fromJson(needs.prepare_matrix.outputs.matrix_architecture) }} python_version: ${{ fromJson(needs.prepare_matrix.outputs.matrix_python_version) }} steps: + - name: Store git credentials for all git commands + # Forces all git commands to use authenticated https, to prevent throttling. + shell: bash + run: | + git config --global credential.helper 'store --file $TMPDIR/git-credentials' + echo 'https://${{ github.token }}@github.com' > $TMPDIR/git-credentials + - name: Check expanded matrix config if: github.event.inputs.expanded_matrix == '1' run: | diff --git a/.github/workflows/cpp-packaging.yml b/.github/workflows/cpp-packaging.yml index 02225aff51..f5a9c8158b 100644 --- a/.github/workflows/cpp-packaging.yml +++ b/.github/workflows/cpp-packaging.yml @@ -183,6 +183,13 @@ jobs: runs-on: macos-latest if: ${{ github.event.inputs.downloadPublicVersion == '' && github.event.inputs.downloadPreviousRun == '' }} steps: + - name: Store git credentials for all git commands + # Forces all git commands to use authenticated https, to prevent throttling. + shell: bash + run: | + git config --global credential.helper 'store --file $TMPDIR/git-credentials' + echo 'https://${{ github.token }}@github.com' > $TMPDIR/git-credentials + - name: setup Xcode version (macos) if: runner.os == 'macOS' run: sudo xcode-select -s /Applications/Xcode_${{ env.xcodeVersion }}.app/Contents/Developer @@ -197,25 +204,6 @@ jobs: with: python-version: 3.7 - - name: Fetch Cocoapods repo with github token (macos) - run: | - # Temporarily modify the remote URL for this pod repo to include the GitHub token, - # then perform a repo update, to ensure the latest repo (not throttled by GitHub). - if [[ ! -d ~/.cocoapods/repos/cocoapods ]]; then - # Get the pod repo first, if it doesn't exist already. - pod repo add cocoapods https://${{ github.token }}@github.com/CocoaPods/Specs.git - else - # Temporarily set it to use the token, and use that to update. - cd ~/.cocoapods/repos/cocoapods - git remote set-url origin https://${{ github.token }}@github.com/CocoaPods/Specs.git - pod repo update - cd - - fi - # Set the source back to non-token URL. - cd ~/.cocoapods/repos/cocoapods - git remote set-url origin https://github.com/CocoaPods/Specs.git - cd - - - name: install prerequisites run: sdk-src/build_scripts/ios/install_prereqs.sh @@ -262,6 +250,13 @@ jobs: with: path: sdk-src + - name: Store git credentials for all git commands + # Forces all git commands to use authenticated https, to prevent throttling. + shell: bash + run: | + git config --global credential.helper 'store --file $TMPDIR/git-credentials' + echo 'https://${{ github.token }}@github.com' > $TMPDIR/git-credentials + - name: Cache NDK id: cache_ndk uses: actions/cache@v2 @@ -353,6 +348,13 @@ jobs: architecture: "arm64" steps: + - name: Store git credentials for all git commands + # Forces all git commands to use authenticated https, to prevent throttling. + shell: bash + run: | + git config --global credential.helper 'store --file $TMPDIR/git-credentials' + echo 'https://${{ github.token }}@github.com' > $TMPDIR/git-credentials + - name: setup Xcode version (macos) if: runner.os == 'macOS' run: sudo xcode-select -s /Applications/Xcode_${{ env.xcodeVersion }}.app/Contents/Developer diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 29158ef295..6ad000fb4e 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -86,6 +86,13 @@ jobs: - xcode_version: "11.7" architecture: "arm64" steps: + - name: Store git credentials for all git commands + # Forces all git commands to use authenticated https, to prevent throttling. + shell: bash + run: | + git config --global credential.helper 'store --file $TMPDIR/git-credentials' + echo 'https://${{ github.token }}@github.com' > $TMPDIR/git-credentials + - name: Setup Xcode version (macos) if: runner.os == 'macOS' run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode_version }}.app/Contents/Developer diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index bc34613ada..94f8488a6d 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -212,6 +212,12 @@ jobs: with: ref: ${{needs.check_and_prepare.outputs.github_ref}} submodules: true + - name: Store git credentials for all git commands + # Forces all git commands to use authenticated https, to prevent throttling. + shell: bash + run: | + git config --global credential.helper 'store --file $TMPDIR/git-credentials' + echo 'https://${{ github.token }}@github.com' > $TMPDIR/git-credentials - name: Set env vars (Linux) if: startsWith(matrix.os, 'ubuntu') run: echo "VCPKG_TRIPLET=x64-linux" >> $GITHUB_ENV @@ -385,6 +391,12 @@ jobs: with: ref: ${{needs.check_and_prepare.outputs.github_ref}} submodules: true + - name: Store git credentials for all git commands + # Forces all git commands to use authenticated https, to prevent throttling. + shell: bash + run: | + git config --global credential.helper 'store --file $TMPDIR/git-credentials' + echo 'https://${{ github.token }}@github.com' > $TMPDIR/git-credentials - name: Add msbuild to PATH (Windows) if: startsWith(matrix.os, 'windows') uses: microsoft/setup-msbuild@v1.0.2 @@ -500,6 +512,12 @@ jobs: with: ref: ${{needs.check_and_prepare.outputs.github_ref}} submodules: true + - name: Store git credentials for all git commands + # Forces all git commands to use authenticated https, to prevent throttling. + shell: bash + run: | + git config --global credential.helper 'store --file $TMPDIR/git-credentials' + echo 'https://${{ github.token }}@github.com' > $TMPDIR/git-credentials - name: Setup python uses: actions/setup-python@v2 with: @@ -515,25 +533,6 @@ jobs: # homebrew. This prevents errors arising from the shut down of # binutils, used by older version of homebrew for hosting packages. brew update - - name: Fetch Cocoapods repo with github token (macos) - if: startsWith(matrix.os, 'macos') - run: | - # Temporarily modify the remote URL for this pod repo to include the GitHub token, - # then perform a repo update, to ensure the latest repo (not throttled by GitHub). - if [[ ! -d ~/.cocoapods/repos/cocoapods ]]; then - # Get the pod repo first, if it doesn't exist already. - pod repo add cocoapods https://${{ github.token }}@github.com/CocoaPods/Specs.git - else - # Temporarily set it to use the token, and use that to update. - cd ~/.cocoapods/repos/cocoapods - git remote set-url origin https://${{ github.token }}@github.com/CocoaPods/Specs.git - pod repo update - cd - - fi - # Set the source back to non-token URL. - cd ~/.cocoapods/repos/cocoapods - git remote set-url origin https://github.com/CocoaPods/Specs.git - cd - - name: Install SDK iOS prerequisites run: build_scripts/ios/install_prereqs.sh - name: Prepare for integration tests diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index d699ac14a4..538b5bf6c0 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -39,6 +39,13 @@ jobs: matrix: xcode_verison: ${{ fromJson(needs.prepare_matrix.outputs.matrix_xcode_version) }} steps: + - name: Store git credentials for all git commands + # Forces all git commands to use authenticated https, to prevent throttling. + shell: bash + run: | + git config --global credential.helper 'store --file $TMPDIR/git-credentials' + echo 'https://${{ github.token }}@github.com' > $TMPDIR/git-credentials + - name: setup Xcode version (macos) if: runner.os == 'macOS' run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode_verison }}.app/Contents/Developer @@ -53,13 +60,6 @@ jobs: python-version: 3.7 architecture: "x64" - - name: Store git credentials for all git commands - run: | - git config --global --get-regexp . - git config --global credential.helper 'store --file ~/.git-credentials' - echo 'https://${{ github.token }}@github.com' > ~/.git-credentials - git config --global --get-regexp . - - name: Install prerequisites run: | build_scripts/ios/install_prereqs.sh From eeffc52a7ccbfa9ca7cbaaa0fbad8613184dd853 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Tue, 2 Nov 2021 23:22:55 -0400 Subject: [PATCH 24/24] Fix temp directory --- .github/workflows/android.yml | 4 ++-- .github/workflows/cpp-packaging.yml | 12 ++++++------ .github/workflows/desktop.yml | 4 ++-- .github/workflows/integration_tests.yml | 12 ++++++------ .github/workflows/ios.yml | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index fcabfd9436..f0b3bf8c71 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -50,8 +50,8 @@ jobs: # Forces all git commands to use authenticated https, to prevent throttling. shell: bash run: | - git config --global credential.helper 'store --file $TMPDIR/git-credentials' - echo 'https://${{ github.token }}@github.com' > $TMPDIR/git-credentials + git config --global credential.helper 'store --file /tmp/git-credentials' + echo 'https://${{ github.token }}@github.com' > /tmp/git-credentials - name: Check expanded matrix config if: github.event.inputs.expanded_matrix == '1' diff --git a/.github/workflows/cpp-packaging.yml b/.github/workflows/cpp-packaging.yml index f5a9c8158b..13db3f4219 100644 --- a/.github/workflows/cpp-packaging.yml +++ b/.github/workflows/cpp-packaging.yml @@ -187,8 +187,8 @@ jobs: # Forces all git commands to use authenticated https, to prevent throttling. shell: bash run: | - git config --global credential.helper 'store --file $TMPDIR/git-credentials' - echo 'https://${{ github.token }}@github.com' > $TMPDIR/git-credentials + git config --global credential.helper 'store --file /tmp/git-credentials' + echo 'https://${{ github.token }}@github.com' > /tmp/git-credentials - name: setup Xcode version (macos) if: runner.os == 'macOS' @@ -254,8 +254,8 @@ jobs: # Forces all git commands to use authenticated https, to prevent throttling. shell: bash run: | - git config --global credential.helper 'store --file $TMPDIR/git-credentials' - echo 'https://${{ github.token }}@github.com' > $TMPDIR/git-credentials + git config --global credential.helper 'store --file /tmp/git-credentials' + echo 'https://${{ github.token }}@github.com' > /tmp/git-credentials - name: Cache NDK id: cache_ndk @@ -352,8 +352,8 @@ jobs: # Forces all git commands to use authenticated https, to prevent throttling. shell: bash run: | - git config --global credential.helper 'store --file $TMPDIR/git-credentials' - echo 'https://${{ github.token }}@github.com' > $TMPDIR/git-credentials + git config --global credential.helper 'store --file /tmp/git-credentials' + echo 'https://${{ github.token }}@github.com' > /tmp/git-credentials - name: setup Xcode version (macos) if: runner.os == 'macOS' diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 6ad000fb4e..291ab1cac2 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -90,8 +90,8 @@ jobs: # Forces all git commands to use authenticated https, to prevent throttling. shell: bash run: | - git config --global credential.helper 'store --file $TMPDIR/git-credentials' - echo 'https://${{ github.token }}@github.com' > $TMPDIR/git-credentials + git config --global credential.helper 'store --file /tmp/git-credentials' + echo 'https://${{ github.token }}@github.com' > /tmp/git-credentials - name: Setup Xcode version (macos) if: runner.os == 'macOS' diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 94f8488a6d..78f4676b9e 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -216,8 +216,8 @@ jobs: # Forces all git commands to use authenticated https, to prevent throttling. shell: bash run: | - git config --global credential.helper 'store --file $TMPDIR/git-credentials' - echo 'https://${{ github.token }}@github.com' > $TMPDIR/git-credentials + git config --global credential.helper 'store --file /tmp/git-credentials' + echo 'https://${{ github.token }}@github.com' > /tmp/git-credentials - name: Set env vars (Linux) if: startsWith(matrix.os, 'ubuntu') run: echo "VCPKG_TRIPLET=x64-linux" >> $GITHUB_ENV @@ -395,8 +395,8 @@ jobs: # Forces all git commands to use authenticated https, to prevent throttling. shell: bash run: | - git config --global credential.helper 'store --file $TMPDIR/git-credentials' - echo 'https://${{ github.token }}@github.com' > $TMPDIR/git-credentials + git config --global credential.helper 'store --file /tmp/git-credentials' + echo 'https://${{ github.token }}@github.com' > /tmp/git-credentials - name: Add msbuild to PATH (Windows) if: startsWith(matrix.os, 'windows') uses: microsoft/setup-msbuild@v1.0.2 @@ -516,8 +516,8 @@ jobs: # Forces all git commands to use authenticated https, to prevent throttling. shell: bash run: | - git config --global credential.helper 'store --file $TMPDIR/git-credentials' - echo 'https://${{ github.token }}@github.com' > $TMPDIR/git-credentials + git config --global credential.helper 'store --file /tmp/git-credentials' + echo 'https://${{ github.token }}@github.com' > /tmp/git-credentials - name: Setup python uses: actions/setup-python@v2 with: diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 538b5bf6c0..71d4481147 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -43,8 +43,8 @@ jobs: # Forces all git commands to use authenticated https, to prevent throttling. shell: bash run: | - git config --global credential.helper 'store --file $TMPDIR/git-credentials' - echo 'https://${{ github.token }}@github.com' > $TMPDIR/git-credentials + git config --global credential.helper 'store --file /tmp/git-credentials' + echo 'https://${{ github.token }}@github.com' > /tmp/git-credentials - name: setup Xcode version (macos) if: runner.os == 'macOS'