Skip to content

Commit cc1f3e0

Browse files
mjoslynclaude
andcommitted
ci(release): bundle composer runtime deps (mPDF) in the release zip
git archive only ships tracked files, so vendor/ (gitignored) was missing and the catalog PDF export failed on a fresh install. Install --no-dev deps in CI and fold vendor/ into the zip so it's upload-and-activate. .gitattributes export-ignore curation is preserved via git archive. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent a73361e commit cc1f3e0

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,28 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v4
1616

17+
- name: Setup PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: '8.3'
21+
extensions: mbstring, gd
22+
tools: composer:v2
23+
coverage: none
24+
25+
- name: Install runtime dependencies
26+
# --no-dev keeps PHPUnit etc. out of the shipped zip; the committed
27+
# composer.lock makes the install reproducible.
28+
run: composer install --no-dev --optimize-autoloader --no-interaction --no-progress
29+
1730
- name: Build plugin zip
18-
# git archive honors the export-ignore rules in .gitattributes, so the zip
19-
# contains only runtime files and unzips to a wc-pricebook/ folder.
20-
run: git archive --format=zip --prefix=wc-pricebook/ -o "wc-pricebook-${GITHUB_REF_NAME}.zip" HEAD
31+
# git archive honors the export-ignore rules in .gitattributes (drops docs,
32+
# tests, CI config, etc.); we then fold in the installed vendor/ so the zip is
33+
# upload-and-activate (mPDF included). Unzips to a wc-pricebook/ folder.
34+
run: |
35+
mkdir -p build
36+
git archive --format=tar --prefix=wc-pricebook/ HEAD | tar -x -C build
37+
cp -R vendor build/wc-pricebook/vendor
38+
(cd build && zip -qr "../wc-pricebook-${GITHUB_REF_NAME}.zip" wc-pricebook)
2139
2240
- name: Create GitHub release
2341
uses: softprops/action-gh-release@v2

0 commit comments

Comments
 (0)