Skip to content

Upload WARP Version to Cloudflare KV #3848

Upload WARP Version to Cloudflare KV

Upload WARP Version to Cloudflare KV #3848

name: Upload WARP Version to Cloudflare KV
on:
schedule:
- cron: '10 * * * *'
workflow_dispatch:
jobs:
upload-linux-version:
runs-on: ubuntu-latest
outputs:
warp_version: ${{ steps.extract_version.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Fetch WARP Package Details
id: fetch_package_details
run: |
curl -fsSL https://pkg.cloudflareclient.com/dists/jammy/main/binary-amd64/Packages -o packages.txt
- name: Extract WARP Version
id: extract_version
run: |
VERSION=$(grep 'Version' packages.txt | cut -d ' ' -f 2)
echo "version=$VERSION" >> $GITHUB_OUTPUT
deploy:
needs: upload-linux-version
runs-on: ubuntu-latest
steps:
- name: Deploy to Cloudflare KV
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_KV_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
command: kv:key put --namespace-id=${{ secrets.KV_NAMESPACE_ID }} "linux-version" "${{ needs.upload-linux-version.outputs.warp_version }}"