Skip to content

Commit

Permalink
fix(ci): avoid github rate limits (#1359)
Browse files Browse the repository at this point in the history
  • Loading branch information
emosbaugh authored Oct 22, 2024
1 parent a209111 commit 289a601
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,14 @@ jobs:
USE_CHAINGUARD: "1"
UPLOAD_BINARIES: "1"
SKIP_RELEASE: "1"
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export K0S_VERSION=$(make print-K0S_VERSION)
export EC_VERSION=$(git describe --tags --match='[0-9]*.[0-9]*.[0-9]*')
export SHORT_SHA=dev-${{ needs.git-sha.outputs.git_sha }}
export APP_VERSION=appver-dev-${{ needs.git-sha.outputs.git_sha }}
# avoid rate limiting
export FIO_VERSION=$(gh release list --repo axboe/fio --json tagName,isLatest | jq -r '.[] | select(.isLatest==true)|.tagName' | cut -d- -f2)
./scripts/build-and-release.sh
Expand Down Expand Up @@ -209,10 +212,13 @@ jobs:
UPLOAD_BINARIES: "1"
SKIP_RELEASE: "1"
MANGLE_METADATA: "1"
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export K0S_VERSION=$(make print-PREVIOUS_K0S_VERSION)
export EC_VERSION=$(git describe --tags --match='[0-9]*.[0-9]*.[0-9]*')-previous-k0s
export APP_VERSION=appver-dev-${{ needs.git-sha.outputs.git_sha }}-previous-k0s
# avoid rate limiting
export FIO_VERSION=$(gh release list --repo axboe/fio --json tagName,isLatest | jq -r '.[] | select(.isLatest==true)|.tagName' | cut -d- -f2)
./scripts/build-and-release.sh
Expand Down Expand Up @@ -275,10 +281,13 @@ jobs:
UPLOAD_BINARIES: "1"
SKIP_RELEASE: "1"
MANGLE_METADATA: "1"
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export K0S_VERSION=$(make print-K0S_VERSION)
export EC_VERSION=$(git describe --tags --match='[0-9]*.[0-9]*.[0-9]*')-upgrade
export APP_VERSION=appver-dev-${{ needs.git-sha.outputs.git_sha }}-upgrade
# avoid rate limiting
export FIO_VERSION=$(gh release list --repo axboe/fio --json tagName,isLatest | jq -r '.[] | select(.isLatest==true)|.tagName' | cut -d- -f2)
./scripts/build-and-release.sh
Expand Down Expand Up @@ -365,12 +374,10 @@ jobs:
with:
fetch-depth: 0
- name: Install replicated CLI
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl --retry 5 --retry-all-errors -fs https://api.github.com/repos/replicatedhq/replicated/releases/latest \
| grep "browser_download_url.*linux_amd64.tar.gz" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -O replicated.tar.gz -qi -
gh release download --repo replicatedhq/replicated --pattern '*linux_amd64.tar.gz' --output replicated.tar.gz
tar xf replicated.tar.gz replicated && rm replicated.tar.gz
mv replicated /usr/local/bin/replicated
- name: Create CI releases
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,22 @@ jobs:
export VERSION=`curl -L -s https://dl.k8s.io/release/stable.txt`
sed -i "/^KUBECTL_VERSION/c\KUBECTL_VERSION = $VERSION" Makefile
- name: K0s
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Remove the '-ec.X' suffix and only update if the prefix (upstream k0s release) has changed.
export CURVERSION=$(make print-K0S_VERSION)
export VERSION=`curl https://api.github.com/repos/k0sproject/k0s/releases/latest | jq -r .name`
export VERSION=$(gh release list --repo k0sproject/k0s --json name,isLatest | jq -r '.[] | select(.isLatest)|.name')
if [ "$CURVERSION" != "$VERSION" ]; then
sed -i "/^K0S_VERSION/c\K0S_VERSION = $VERSION" Makefile
sed -i "/^K0S_BINARY_SOURCE_OVERRIDE/c\K0S_BINARY_SOURCE_OVERRIDE =" Makefile
make go.mod
fi
- name: Troubleshoot
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export VERSION=`curl https://api.github.com/repos/replicatedhq/troubleshoot/releases/latest | jq -r .name`
export VERSION=$(gh release list --repo replicatedhq/troubleshoot --json name,isLatest | jq -r '.[] | select(.isLatest)|.name')
sed -i "/^TROUBLESHOOT_VERSION/c\TROUBLESHOOT_VERSION = $VERSION" Makefile
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
Expand Down

0 comments on commit 289a601

Please sign in to comment.