From 8fb27eaa9298295d2e2068cb3012557a318c7087 Mon Sep 17 00:00:00 2001 From: Alain Bourgeois Date: Thu, 12 Feb 2026 18:41:25 +0100 Subject: [PATCH] Revert "publish to gh-pages remove PUBLIC-PATH" --- .github/workflows/ci.yml | 7 +++++-- package.json | 1 + webpack.config.mjs | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd5b57d8..e2782e56 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,9 +39,12 @@ jobs: runs-on: ubuntu-latest if: github.ref == 'refs/heads/main' steps: - - uses: actions/download-artifact@v7 + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 with: - name: build + node-version: 20 + - run: npm ci + - run: npm run build:ghpages - uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index a9c4af4f..5624e848 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "scripts": { "clean": "rm -rf dist ./src/versionInfo.ts", "build": "npm run clean && npm run build-version && npm run typecheck && npm run build-dist && npm run postbuild-js", + "build:ghpages": "npm run clean && npm run build-version && npm run typecheck && PUBLIC_PATH=/mashlib/dist/ npm run build-dist && npm run postbuild-js", "build-version": "./timestamp.sh > src/versionInfo.ts && eslint 'src/versionInfo.ts' --fix", "build-dist": "webpack --progress --mode=production", "postbuild-js": "rm -f dist/versionInfo.d.ts dist/versionInfo.d.ts.map", diff --git a/webpack.config.mjs b/webpack.config.mjs index a3c3637e..ea7a925d 100644 --- a/webpack.config.mjs +++ b/webpack.config.mjs @@ -24,7 +24,7 @@ const common = { output: { path: path.resolve(process.cwd(), 'dist'), // Use /mashlib/dist/ for GitHub Pages, / for localhost - publicPath: '/', + publicPath: process.env.PUBLIC_PATH || '/', library: { name: 'Mashlib', type: 'umd'