Skip to content

Commit 97d80f2

Browse files
committed
ci(debian): package .deb artifacts using printf to avoid YAML heredoc parsing issues
1 parent f95c6fc commit 97d80f2

2 files changed

Lines changed: 40 additions & 4 deletions

File tree

.github/workflows/build.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,23 @@ jobs:
171171
- name: Package artifacts (Debian)
172172
shell: bash
173173
run: |
174-
mkdir -p artifacts
174+
set -euo pipefail
175+
mkdir -p artifacts pkg
176+
# Copy raw binaries
175177
cp dist/WINFF-GUI-PyQt6 artifacts/WINFF-GUI-PyQt6-debian-x64
176178
cp dist/WINFF-GUI-Tkinter artifacts/WINFF-GUI-Tkinter-debian-x64
179+
# Build simple .deb packages (version from CI run number)
180+
VER="0.0.0-ci-${GITHUB_RUN_NUMBER:-0}"
181+
for app in WINFF-GUI-PyQt6 WINFF-GUI-Tkinter; do
182+
pkgname=$(echo "$app" | tr '[:upper:]' '[:lower:]' | tr '_' '-')
183+
pkgdir="pkg/${pkgname}_${VER}_amd64"
184+
mkdir -p "$pkgdir/DEBIAN" "$pkgdir/usr/local/bin"
185+
cp "dist/${app}" "$pkgdir/usr/local/bin/${app}"
186+
chmod 0755 "$pkgdir/usr/local/bin/${app}"
187+
printf 'Package: %s\nVersion: %s\nSection: utils\nPriority: optional\nArchitecture: amd64\nMaintainer: GitHub Actions <noreply@github.local>\nDescription: FFmpeg GUI (%s) built via CI for Debian 13 (bookworm)\n' \
188+
"$pkgname" "$VER" "$app" > "$pkgdir/DEBIAN/control"
189+
dpkg-deb -b "$pkgdir" "artifacts/${pkgname}_${VER}_amd64.deb"
190+
done
177191
178192
- name: Upload artifacts (Debian)
179193
uses: actions/upload-artifact@v4

.github/workflows/release.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,24 @@ jobs:
155155
- name: Package artifacts (Debian)
156156
shell: bash
157157
run: |
158-
mkdir -p artifacts
158+
set -euo pipefail
159+
mkdir -p artifacts pkg
160+
# Copy raw binaries
159161
cp dist/WINFF-GUI-PyQt6 artifacts/WINFF-GUI-PyQt6-debian-x64
160162
cp dist/WINFF-GUI-Tkinter artifacts/WINFF-GUI-Tkinter-debian-x64
163+
# Build simple .deb packages (version from CI run number)
164+
VER="${GITHUB_REF_NAME:-v0.0.0}"
165+
VER_DEB="${VER#v}"
166+
for app in WINFF-GUI-PyQt6 WINFF-GUI-Tkinter; do
167+
pkgname=$(echo "$app" | tr '[:upper:]' '[:lower:]' | tr '_' '-')
168+
pkgdir="pkg/${pkgname}_${VER_DEB}_amd64"
169+
mkdir -p "$pkgdir/DEBIAN" "$pkgdir/usr/local/bin"
170+
cp "dist/${app}" "$pkgdir/usr/local/bin/${app}"
171+
chmod 0755 "$pkgdir/usr/local/bin/${app}"
172+
printf 'Package: %s\nVersion: %s\nSection: utils\nPriority: optional\nArchitecture: amd64\nMaintainer: GitHub Actions <noreply@github.local>\nDescription: FFmpeg GUI (%s) built via CI for Debian 13 (bookworm)\n' \
173+
"$pkgname" "$VER_DEB" "$app" > "$pkgdir/DEBIAN/control"
174+
dpkg-deb -b "$pkgdir" "artifacts/${pkgname}_${VER_DEB}_amd64.deb"
175+
done
161176
162177
- name: Upload artifacts (Debian)
163178
uses: actions/upload-artifact@v4
@@ -170,13 +185,20 @@ jobs:
170185
runs-on: ubuntu-latest
171186
needs: [build, build_debian_bookworm]
172187
steps:
173-
- name: Download all artifacts
188+
- name: Download platform release artifacts
174189
uses: actions/download-artifact@v4
175190
with:
176-
pattern: "*-release-artifacts|Debian-release-artifacts"
191+
pattern: "*-release-artifacts"
177192
merge-multiple: true
178193
path: release-assets
179194

195+
- name: Download Debian release artifacts
196+
uses: actions/download-artifact@v4
197+
with:
198+
name: Debian-release-artifacts
199+
path: release-assets
200+
continue-on-error: true
201+
180202
- name: Show assets
181203
run: ls -la release-assets
182204

0 commit comments

Comments
 (0)