mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-06 17:15:47 -06:00
fix: use bun and web.build.ts in build workflow, use minify & cwd args for tailwindcss cli
This commit is contained in:
21
.github/workflows/build.yaml
vendored
21
.github/workflows/build.yaml
vendored
@@ -104,11 +104,10 @@ jobs:
|
|||||||
- name: Rust Cache
|
- name: Rust Cache
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
|
|
||||||
- name: Install pnpm
|
- name: Setup Bun
|
||||||
uses: pnpm/action-setup@v3
|
uses: oven-sh/setup-bun@v2
|
||||||
with:
|
with:
|
||||||
version: 8
|
bun-version: latest
|
||||||
run_install: true
|
|
||||||
|
|
||||||
- name: Build with Emscripten
|
- name: Build with Emscripten
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -121,7 +120,7 @@ jobs:
|
|||||||
echo "Build attempt $attempt of $MAX_RETRIES"
|
echo "Build attempt $attempt of $MAX_RETRIES"
|
||||||
|
|
||||||
# Capture output and check for specific error while preserving real-time output
|
# Capture output and check for specific error while preserving real-time output
|
||||||
if cargo build --target=wasm32-unknown-emscripten --release 2>&1 | tee /tmp/build_output.log; then
|
if bun run web.build.ts 2>&1 | tee /tmp/build_output.log; then
|
||||||
echo "Build successful on attempt $attempt"
|
echo "Build successful on attempt $attempt"
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
@@ -148,18 +147,6 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Assemble
|
|
||||||
run: |
|
|
||||||
echo "Generating CSS"
|
|
||||||
pnpx postcss-cli ./assets/site/styles.scss -o ./assets/site/build.css
|
|
||||||
|
|
||||||
echo "Copying WASM files"
|
|
||||||
|
|
||||||
mkdir -p dist
|
|
||||||
cp assets/site/{build.css,favicon.ico,index.html} dist
|
|
||||||
output_folder="target/wasm32-unknown-emscripten/release"
|
|
||||||
cp $output_folder/pacman.{wasm,js} $output_folder/deps/pacman.data dist
|
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-pages-artifact@v3
|
uses: actions/upload-pages-artifact@v3
|
||||||
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
||||||
|
|||||||
@@ -42,8 +42,9 @@ async function build(release: boolean, env: Record<string, string>) {
|
|||||||
release ? "--release" : ""
|
release ? "--release" : ""
|
||||||
}`.env(env);
|
}`.env(env);
|
||||||
|
|
||||||
log("Generating CSS");
|
log("Invoking @tailwindcss/cli");
|
||||||
await $`npx @tailwindcss/cli -i ./assets/site/styles.css -o ./assets/site/build.css`;
|
// unfortunately, bunx doesn't seem to work with @tailwindcss/cli, so we have to use npx directly
|
||||||
|
await $`npx --yes @tailwindcss/cli --minify --input styles.css --output build.css --cwd assets/site`;
|
||||||
|
|
||||||
const buildType = release ? "release" : "debug";
|
const buildType = release ? "release" : "debug";
|
||||||
const siteFolder = resolve("assets/site");
|
const siteFolder = resolve("assets/site");
|
||||||
|
|||||||
Reference in New Issue
Block a user