From 00a1eefeeed1666e0373066a7f7faad835414d7c Mon Sep 17 00:00:00 2001 From: Isaac Hill <71404865+isaachilly@users.noreply.github.com> Date: Fri, 23 Oct 2026 16:07:10 +0200 Subject: [PATCH] Build project (if build command present) before npm publish and pack --- .github/workflows/release.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f97924970..1aace89db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,7 +45,7 @@ jobs: echo "project=$PROJECT" >> $GITHUB_OUTPUT echo "version=$VERSION" >> $GITHUB_OUTPUT echo "tag=$TAG" >> $GITHUB_OUTPUT - - run: (cd $PROJECT; npm publish) + - run: (cd $PROJECT; npm ci && npm run build --if-present && npm publish) upload-asset: runs-on: ubuntu-latest timeout-minutes: 10 @@ -59,8 +59,14 @@ jobs: with: node-version: '22.x' registry-url: 'https://registry.npmjs.org' - - name: Install production deps - run: npm install --only=production + - name: Install deps + run: npm ci + working-directory: ${{ needs.deploy-npm-module.outputs.PROJECT }} + - name: Run build + run: npm run build --if-present + working-directory: ${{ needs.deploy-npm-module.outputs.PROJECT }} + - name: Remove dev deps + run: npm prune --omit=dev working-directory: ${{ needs.deploy-npm-module.outputs.PROJECT }} - name: Create package tarball run: echo "tgz_name=$(npm pack)" >> $GITHUB_OUTPUT