Skip to content

Commit

Permalink
Merge branch 'feature/CSC-1652-gh-action-for-processing-custom-sheets…
Browse files Browse the repository at this point in the history
…' into staging
  • Loading branch information
danielxvu committed Oct 1, 2023
2 parents 67def0c + a7d3d32 commit 7001fdf
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 21 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/use-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
CDN_SHEETS_FOLDER: ${{ vars.CDN_SHEETS_FOLDER }}
DEST_DIR: /tmp
steps:
- uses: actions/checkout@v3
- id: 'auth'
Expand All @@ -62,8 +61,8 @@ jobs:
command: install
args: fd-find
- run: make clean
- run: DEST_DIR=$RUNNER_TEMP bun run contrib/sheet-pixie/index.ts ${{ needs.changes.outputs.sheet-json }}
- run: bash update.sh
- run: bun run contrib/sheet-pixie/index.ts ${{ needs.changes.outputs.sheet-json }}
- run: bash update.sh ${{ runner.temp }}
- run: bash sync_sheets.sh

force-update:
Expand All @@ -74,7 +73,6 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
CDN_SHEETS_FOLDER: ${{ vars.CDN_SHEETS_FOLDER }}
DEST_DIR: /tmp
steps:
- uses: actions/checkout@v3
- id: 'auth'
Expand All @@ -101,4 +99,4 @@ jobs:
args: fd-find
- run: make clean
- run: make all
- run: bash force-update.sh "$DEST_DIR"
- run: bash force-update.sh "$RUNNER_TEMP"
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ Network Trash Folder
Temporary Items
.apdisk

**/*/release-ci.sh
!release-ci.sh
sync_sheets.sh

**/*/dist/*.html
Expand Down
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
SHELL := /bin/bash

# Change this value to whichever variant you're currently testing a certain sheet with
DEFAULT_RELEASE_SCRIPT := release-ci.sh
CDN_SHEETS_FOLDER := custom-sheets-staging

listing:
fd . --exclude contrib --type d --max-depth 1 | sort

Expand Down
2 changes: 1 addition & 1 deletion contrib/sheet-pixie/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async function onSheetChange(sheetDir: string) {
const cssRes = await tryCss(Bun.file(`${sheetDir}/${cssPath}`), advanced);
const { css, rawCss } = cssRes;

const distDir = `${process.env.DEST_DIR || ''}/${sheetDir}/dist`;
const distDir = `${process.env.RUNNER_TEMP || '/tmp'}/${sheetDir}/dist`;
rmSync(distDir, { recursive: true, force: true });
mkdirSync(distDir, { recursive: true });
await Promise.all([
Expand Down
1 change: 1 addition & 0 deletions contrib/sheet-pixie/save.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
function saveToFile(path: string, content: string) {
console.log("Writing content to file: " + path);
return Bun.write(path, content);
}
export { saveToFile };
8 changes: 0 additions & 8 deletions release-ci.sh

This file was deleted.

4 changes: 3 additions & 1 deletion update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ touch sync_sheets.sh
echo '#!/bin/bash' > sync_sheets.sh
echo 'set -e' >> sync_sheets.sh
chmod +x sync_sheets.sh
fd dist --type d --strip-cwd-prefix -j1 --exec bash -c 'echo ./gcp.sh \"$(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 sync_sheets.sh
CWD=$(pwd)
cd $1;
fd dist --type d --strip-cwd-prefix -j1 --exec bash -c 'echo ./gcp.sh \"$(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

0 comments on commit 7001fdf

Please sign in to comment.