From fd68caa519bc2fd0f334a5fd6bb877af4a8ba568 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Tue, 20 Oct 2026 11:15:03 -0400 Subject: [PATCH] fix(release): pick the app's own Linux tarball by exact name (#35) * fix(release): pick the app's own Linux tarball by exact name The Arch and Flatpak jobs globbed *-linux-.tar.gz. PDFCraft also ships pdfcraft-cli--linux-.tar.gz, so Arch saw two tarballs and failed, and Flatpak aarch64 took the CLI tarball (no bin/pdfcraft). Select --linux-.tar.gz instead. Co-Authored-By: Claude Opus 5.5 * fix(release): pass tarball name parts through step env Review (CodeRabbit, CWE-78): app-name is a free-form reusable-workflow input, and interpolating it into run: puts caller text into the shell source. The Flatpak and Arch steps now read APP_NAME, RELEASE_VERSION and ARCH from env. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Brandon Thomas Co-authored-by: Claude Opus 5.5 --- .github/workflows/release.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b94555b..6c5652e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -552,8 +552,13 @@ jobs: sudo apt-get install -y --no-install-recommends flatpak flatpak-builder librsvg2-common sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 - name: Build the Flatpak bundle + env: + APP_NAME: ${{ inputs.app-name }} + RELEASE_VERSION: ${{ needs.version.outputs.version }} + ARCH: ${{ matrix.arch }} run: | - tarball=$(find dist/linux -name "*-linux-${{ matrix.arch }}.tar.gz" -print -quit 2>/dev/null) + # The app's own tarball by exact name: a CLI tarball (pdfcraft-cli-…) sits beside it. + tarball="dist/linux/${APP_NAME}-${RELEASE_VERSION}-linux-${ARCH}.tar.gz" packaging/linux/flatpak-bundle.sh "$tarball" - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: @@ -578,14 +583,18 @@ jobs: path: dist/linux - name: Find the release tarball id: tarball + env: + APP_NAME: ${{ inputs.app-name }} + RELEASE_VERSION: ${{ needs.version.outputs.version }} + ARCH: ${{ matrix.arch }} run: | - shopt -s nullglob - tarballs=(dist/linux/*-linux-${{ matrix.arch }}.tar.gz) - if [ "${#tarballs[@]}" -ne 1 ]; then - echo "::error::expected one tarball in release-linux-${{ matrix.arch }}, found ${#tarballs[@]}" + # The app's own tarball by exact name: a CLI tarball (pdfcraft-cli-…) sits beside it. + tarball="dist/linux/${APP_NAME}-${RELEASE_VERSION}-linux-${ARCH}.tar.gz" + if [ ! -f "$tarball" ]; then + echo "::error::$tarball is not in release-linux-${ARCH}" exit 1 fi - echo "path=${tarballs[0]}" >>"$GITHUB_OUTPUT" + echo "path=$tarball" >>"$GITHUB_OUTPUT" - uses: storytold/craft-common-actions/actions/arch-package@main with: tarball: ${{ steps.tarball.outputs.path }}