From d19f5400a4b9163ee28e7e430690699b4e130c4e Mon Sep 17 00:00:00 2001 From: Daniel Vu Date: Sun, 1 Oct 2023 23:21:22 -0400 Subject: [PATCH 1/3] Speeds up the upload process --- .github/workflows/use-sdk.yml | 19 ++----------------- Makefile | 4 ++-- gcp.sh | 5 ----- update.sh | 10 ---------- 4 files changed, 4 insertions(+), 34 deletions(-) delete mode 100755 gcp.sh delete mode 100755 update.sh diff --git a/.github/workflows/use-sdk.yml b/.github/workflows/use-sdk.yml index a1ef45f5735a..7c0a01cb6bb2 100644 --- a/.github/workflows/use-sdk.yml +++ b/.github/workflows/use-sdk.yml @@ -53,17 +53,9 @@ jobs: # run any `bun` or `bunx` command - run: bun install working-directory: contrib/sheet-pixie - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - uses: actions-rs/cargo@v1 - with: - command: install - args: fd-find - run: make clean - run: bun run contrib/sheet-pixie/index.ts ${{ needs.changes.outputs.sheet-json }} - - run: bash update.sh ${{ runner.temp }} - - run: bash sync_sheets.sh + - run: gcloud storage rsync --project=roll20-actual ${{ runner.temp }} "gs://roll20-cdn/$CDN_SHEETS_FOLDER" --cache-control='no-cache' force-update: name: Process HTML/CSS for all character sheets (force-update) @@ -90,13 +82,6 @@ jobs: # run any `bun` or `bunx` command - run: bun install working-directory: contrib/sheet-pixie - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - uses: actions-rs/cargo@v1 - with: - command: install - args: fd-find - run: make clean - run: make all - - run: bash force-update.sh "$RUNNER_TEMP" + - run: bash force-update.sh ${{ runner.temp }} diff --git a/Makefile b/Makefile index 188283afd0cd..6719e9d3f49d 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ config: fd . --exclude contrib --type d --max-depth 1 --exec cp $(DEFAULT_RELEASE_SCRIPT) {} \; || true clean: - rm -rf **/*/dist + rm -rf **/dist all: - fd . --strip-cwd-prefix --exclude contrib --exclude "Zelda BOTW" --type d --max-depth 1 --exec bun run contrib/sheet-pixie/index.ts "{}/sheet.json" \; + find * -mindepth 1 -maxdepth 1 -not -path 'Zelda BOTW/sheet.json' -type f -name "sheet.json" -print0 | parallel -0 bun run contrib/sheet-pixie/index.ts {} diff --git a/gcp.sh b/gcp.sh deleted file mode 100755 index 76ec0ebb785d..000000000000 --- a/gcp.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -# You need GCloud Access to the dropbox to run this script - -gcloud storage rsync --project=roll20-actual "$1/dist" "$3" --delete-unmatched-destination-objects --cache-control='no-cache' -gcloud storage rsync --project=roll20-actual "$1/translations" "$4" --delete-unmatched-destination-objects --cache-control='no-cache' || true diff --git a/update.sh b/update.sh deleted file mode 100755 index 0abac4d65343..000000000000 --- a/update.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -rm -rf sync_sheets.sh -touch sync_sheets.sh -echo '#!/bin/bash' > sync_sheets.sh -echo 'set -e' >> sync_sheets.sh -chmod +x sync_sheets.sh -CWD=$(pwd) -cd $1; -fd dist --type d --strip-cwd-prefix -j1 --exec bash -c 'echo ./gcp.sh \"$(pwd)/$(printf "%s" "{//}")\" \"$(printf "gs://roll20-cdn/$CDN_SHEETS_FOLDER/%s\n" "{//}")\" \"$(printf "gs://roll20-cdn/$CDN_SHEETS_FOLDER/%s" "{//}")/dist\" \"$(printf "gs://roll20-cdn/$CDN_SHEETS_FOLDER/%s" "{//}")/translations\"' | tee -a $CWD/sync_sheets.sh From 4b6f21135b55ca6c1dc509cf5a51b5856405ef18 Mon Sep 17 00:00:00 2001 From: Daniel Vu Date: Sun, 1 Oct 2023 23:23:48 -0400 Subject: [PATCH 2/3] Adds missing flag --- .github/workflows/use-sdk.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/use-sdk.yml b/.github/workflows/use-sdk.yml index 7c0a01cb6bb2..fc9f96243aa6 100644 --- a/.github/workflows/use-sdk.yml +++ b/.github/workflows/use-sdk.yml @@ -55,7 +55,7 @@ jobs: working-directory: contrib/sheet-pixie - run: make clean - run: bun run contrib/sheet-pixie/index.ts ${{ needs.changes.outputs.sheet-json }} - - run: gcloud storage rsync --project=roll20-actual ${{ runner.temp }} "gs://roll20-cdn/$CDN_SHEETS_FOLDER" --cache-control='no-cache' + - run: gcloud storage rsync --project=roll20-actual ${{ runner.temp }} "gs://roll20-cdn/$CDN_SHEETS_FOLDER" --cache-control='no-cache' --recursive force-update: name: Process HTML/CSS for all character sheets (force-update) From 37e9827d7dbec3ce39e9f12f3748e194d71c0574 Mon Sep 17 00:00:00 2001 From: Daniel Vu Date: Sun, 1 Oct 2023 23:24:26 -0400 Subject: [PATCH 3/3] Removes deprecated step --- .github/workflows/use-sdk.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/use-sdk.yml b/.github/workflows/use-sdk.yml index fc9f96243aa6..63bdd0961ba9 100644 --- a/.github/workflows/use-sdk.yml +++ b/.github/workflows/use-sdk.yml @@ -53,7 +53,6 @@ jobs: # run any `bun` or `bunx` command - run: bun install working-directory: contrib/sheet-pixie - - run: make clean - run: bun run contrib/sheet-pixie/index.ts ${{ needs.changes.outputs.sheet-json }} - run: gcloud storage rsync --project=roll20-actual ${{ runner.temp }} "gs://roll20-cdn/$CDN_SHEETS_FOLDER" --cache-control='no-cache' --recursive @@ -82,6 +81,5 @@ jobs: # run any `bun` or `bunx` command - run: bun install working-directory: contrib/sheet-pixie - - run: make clean - run: make all - run: bash force-update.sh ${{ runner.temp }}