From 818cb544b61052140361add8b8aca661c5df1c2e Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdx@users.noreply.github.com> Date: Sun, 26 Nov 2023 20:32:30 -0600 Subject: [PATCH] release: add shadow publishing to R2 --- .github/workflows/rtx.yml | 2 ++ scripts/publish-r2.sh | 10 ++++++++++ scripts/release.sh | 1 + 3 files changed, 13 insertions(+) create mode 100755 scripts/publish-r2.sh diff --git a/.github/workflows/rtx.yml b/.github/workflows/rtx.yml index 8f3d0baa49..674f3ceafe 100644 --- a/.github/workflows/rtx.yml +++ b/.github/workflows/rtx.yml @@ -271,6 +271,8 @@ jobs: env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + CLOUDFLARE_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_ACCESS_KEY_ID }} + CLOUDFLARE_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_SECRET_ACCESS_KEY }} - name: homebrew-tap push run: git push working-directory: homebrew-tap diff --git a/scripts/publish-r2.sh b/scripts/publish-r2.sh new file mode 100755 index 0000000000..fc6ebc1e84 --- /dev/null +++ b/scripts/publish-r2.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -euxo pipefail + +export AWS_DEFAULT_REGION=auto +export AWS_DEFAULT_OUTPUT=json +export AWS_ENDPOINT_URL=https://6e243906ff257b965bcae8025c2fc344.r2.cloudflarestorage.com +export AWS_ACCESS_KEY_ID=$CLOUDFLARE_ACCESS_KEY_ID +export AWS_SECRET_ACCESS_KEY=$CLOUDFLARE_SECRET_ACCESS_KEY + +./rtx/scripts/publish-s3.sh || true diff --git a/scripts/release.sh b/scripts/release.sh index 04f48997ed..d0cff6877c 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -61,6 +61,7 @@ gpg -u 408B88DB29DDE9E0 --output "$RELEASE_DIR"/install.sh.sig --sign "$RELEASE_ NPM_PREFIX=@jdxcode/rtx ./rtx/scripts/release-npm.sh NPM_PREFIX=rtx-cli ./rtx/scripts/release-npm.sh ./rtx/scripts/publish-s3.sh +./rtx/scripts/publish-r2.sh ./rtx/scripts/render-homebrew.sh >homebrew-tap/rtx.rb pushd homebrew-tap