Upload WARP Mac Versions to Cloudflare KV #3588
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Upload WARP Mac Versions to Cloudflare KV | |
on: | |
schedule: | |
- cron: '10 * * * *' | |
workflow_dispatch: | |
jobs: | |
fetch-mac-versions: | |
runs-on: ubuntu-latest | |
outputs: | |
release_version: ${{ steps.extract_release_version.outputs.version }} | |
beta_version: ${{ steps.extract_beta_version.outputs.version }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Fetch WARP Mac Release Version | |
id: extract_release_version | |
run: | | |
RELEASE_VERSION=$(curl -fsSl "https://install.appcenter.ms/api/v0.1/apps/cloudflare/1.1.1.1-macos-1/distribution_groups/release/public_releases" | jq -r '.[0].short_version') | |
echo "version=$RELEASE_VERSION" >> $GITHUB_OUTPUT | |
- name: Fetch WARP Mac Beta Version | |
id: extract_beta_version | |
run: | | |
BETA_VERSION=$(curl -fsSl "https://install.appcenter.ms/api/v0.1/apps/cloudflare/1.1.1.1-macos/distribution_groups/beta/public_releases" | jq -r '.[0].short_version') | |
echo "version=$BETA_VERSION" >> $GITHUB_OUTPUT | |
deploy-release-version: | |
needs: fetch-mac-versions | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy Release Version 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 }} "mac-release-version" ${{ needs.fetch-mac-versions.outputs.release_version }} | |
deploy-beta-version: | |
needs: fetch-mac-versions | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy Beta Version 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 }} "mac-beta-version" ${{ needs.fetch-mac-versions.outputs.beta_version }} |