Skip to content

Add GitHub token to saved credentials to avoid throttling. #727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Nov 3, 2021
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
554933a
Add GitHub token to Cocoapods Github URL to avoid throttling.
jonsimantov Nov 2, 2021
c3de00e
Use github.token instead of ${GITHUB_TOKEN}; fix URL.
jonsimantov Nov 2, 2021
eaf479a
Only temporarily modify the repo URL to include the token.
jonsimantov Nov 2, 2021
82e06c5
Initially add the cocoapods repo with the token
jonsimantov Nov 2, 2021
28f7b20
Change flow slightly
jonsimantov Nov 2, 2021
0adc262
Fix integration test
jonsimantov Nov 2, 2021
bd8ecb4
Fix
jonsimantov Nov 2, 2021
efd6709
Merge branch 'main' into feature/add-token-to-pod-repo
jonsimantov Nov 2, 2021
0844823
Remove pod repo list command.
jonsimantov Nov 2, 2021
d529fdc
Move C++ packaging step to the right place.
jonsimantov Nov 2, 2021
91b0501
Add GITHUB_TOKEN env var to other workflows.
jonsimantov Nov 2, 2021
5829029
For debugging, check the git credentials
jonsimantov Nov 3, 2021
4bc4a50
Reorder
jonsimantov Nov 3, 2021
abb9dd0
Fix debug output
jonsimantov Nov 3, 2021
1df837a
Try using git-credentials
jonsimantov Nov 3, 2021
c468b2f
Try bad token for debugging
jonsimantov Nov 3, 2021
bddf4fb
Try new path to credentials
jonsimantov Nov 3, 2021
66a2402
More config debugging
jonsimantov Nov 3, 2021
4d94859
Fix script
jonsimantov Nov 3, 2021
24c2dbd
Try home path
jonsimantov Nov 3, 2021
72be028
Remove bad token
jonsimantov Nov 3, 2021
0fa2e61
Try using git credential-helper instead
jonsimantov Nov 3, 2021
3031619
Check that config was set
jonsimantov Nov 3, 2021
74b2c32
Set git credential token instead of manually changing pod source.
jonsimantov Nov 3, 2021
eeffc52
Fix temp directory
jonsimantov Nov 3, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/cpp-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -196,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

Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,25 @@ 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
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,25 @@ jobs:
run: |
build_scripts/ios/install_prereqs.sh

- 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: Build SDK
run: |
build_scripts/ios/build.sh -b ios_build -s .