Skip to content

Commit 6ae964d

Browse files
committed
ci: Linux packaging smoke on packaging-related PRs
Runs electron-builder --publish never on ubuntu so misconfigured linux.target / missing maintainer / missing rpmbuild is caught in the PR, not when someone cuts a release tag. Gated by a paths-filter on electron-builder.yml / resources / scripts / workflows / pnpm-lock.yaml so unrelated PRs don't pay the ~4min packaging cost. Asserts all three artifacts (.AppImage / .deb / .rpm) land in the release/ directory before the job passes. Signed-off-by: hqhq1025 <1506751656@qq.com>
1 parent 68ec6b5 commit 6ae964d

1 file changed

Lines changed: 71 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,77 @@ jobs:
4646
- name: Build smoke (electron-vite bundle)
4747
run: pnpm --filter @open-codesign/desktop exec electron-vite build
4848

49+
# Linux packaging smoke — actually runs electron-builder for the Linux
50+
# targets (AppImage + deb + rpm) so misconfiguration in
51+
# apps/desktop/electron-builder.yml (missing maintainer, bad icon size,
52+
# wrong artifactName, missing rpmbuild) is caught on every PR instead
53+
# of only when a tag release is cut. Runs in parallel with `check` and
54+
# only on PRs/pushes that touch packaging-relevant files so unrelated
55+
# PRs don't pay the ~4min cost.
56+
package-linux-smoke:
57+
name: Linux packaging smoke
58+
runs-on: ubuntu-latest
59+
timeout-minutes: 15
60+
steps:
61+
- uses: actions/checkout@v4
62+
63+
- name: Detect packaging-relevant changes
64+
id: changes
65+
uses: dorny/paths-filter@v3
66+
with:
67+
filters: |
68+
packaging:
69+
- 'apps/desktop/electron-builder.yml'
70+
- 'apps/desktop/package.json'
71+
- 'apps/desktop/resources/**'
72+
- 'apps/desktop/scripts/**'
73+
- '.github/workflows/ci.yml'
74+
- '.github/workflows/release.yml'
75+
- 'package.json'
76+
- 'pnpm-lock.yaml'
77+
78+
- name: Setup pnpm
79+
if: steps.changes.outputs.packaging == 'true'
80+
uses: pnpm/action-setup@v4
81+
82+
- name: Setup Node
83+
if: steps.changes.outputs.packaging == 'true'
84+
uses: actions/setup-node@v4
85+
with:
86+
node-version-file: .nvmrc
87+
cache: pnpm
88+
89+
- name: Install
90+
if: steps.changes.outputs.packaging == 'true'
91+
run: pnpm install --frozen-lockfile
92+
93+
- name: Install rpmbuild
94+
if: steps.changes.outputs.packaging == 'true'
95+
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends rpm
96+
97+
- name: Build workspace
98+
if: steps.changes.outputs.packaging == 'true'
99+
run: pnpm --filter '!@open-codesign/desktop' -r build
100+
101+
- name: Package Linux (AppImage + deb + rpm)
102+
if: steps.changes.outputs.packaging == 'true'
103+
env:
104+
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
105+
run: pnpm --filter @open-codesign/desktop release
106+
107+
- name: Assert artifacts
108+
if: steps.changes.outputs.packaging == 'true'
109+
run: |
110+
cd apps/desktop/release
111+
ls -la
112+
for ext in AppImage deb rpm; do
113+
if ! ls *."$ext" >/dev/null 2>&1; then
114+
echo "::error::no .$ext produced by electron-builder"
115+
exit 1
116+
fi
117+
done
118+
echo "All three Linux artifacts present."
119+
49120
dco:
50121
name: DCO check
51122
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)