action: sign every image format, not only .img.xz

The Sign step globbed build/output/images/*.img*.xz. That is the classic
compressed raw image and nothing else, so a build using image-output-iso (.iso)
or image-output-qcow2 (uncompressed .img.qcow2) matched nothing, gpg was handed
the literal pattern and the job died:

  gpg: can't open 'build/output/images/*.img*.xz': No such file or directory
  gpg: signing failed: No such file or directory

That is every cell of the SDK build, which uses exactly those two extensions.

Collect the artifacts with find (*.img*.xz, *.iso, *.qcow2), sign each one
separately - --detach-sign takes a single input, and this way each artifact gets
its own .asc - and fail with a directory listing when there is nothing to sign,
instead of letting gpg report a missing file that was never a file.

The passphrase moves to env rather than being interpolated into the script.

Signed-off-by: Igor Pecovnik <igor@armbian.com>
This commit is contained in:
Igor Pecovnik
2026-08-22 13:12:42 +02:00
committed by Igor
parent 05236f0cb3
commit 84c1b38d53
+25 -3
View File
@@ -246,10 +246,32 @@ runs:
- name: Sign - name: Sign
shell: bash shell: bash
if: ${{ inputs.armbian_pgp_password != '' }} if: ${{ inputs.armbian_pgp_password != '' }}
env:
ARMBIAN_PGP_PASSWORD: ${{ inputs.armbian_pgp_password }}
run: | run: |
printf '%s' "${{ inputs.armbian_pgp_password }}" | \ set -euo pipefail
gpg --passphrase-fd 0 --armor --detach-sign --pinentry-mode loopback --batch --yes \
build/output/images/*.img*.xz # Sign whatever the build actually produced. The glob used to be
# *.img*.xz, which is only the classic compressed raw image: an
# image-output-iso build emits a .iso and image-output-qcow2 emits an
# uncompressed .img.qcow2, so the glob matched nothing, gpg received the
# literal pattern and the job died with "can't open ... No such file".
mapfile -t images < <(find build/output/images -maxdepth 1 -type f \
\( -name '*.img*.xz' -o -name '*.iso' -o -name '*.qcow2' \) | sort)
if [[ ${#images[@]} -eq 0 ]]; then
echo "::error::Sign: no image artifacts found in build/output/images"
ls -la build/output/images || true
exit 1
fi
# One gpg call per file: --detach-sign takes a single input, and this
# way each artifact gets its own .asc.
for image in "${images[@]}"; do
echo "Signing $(basename "${image}")"
printf '%s' "${ARMBIAN_PGP_PASSWORD}" | \
gpg --passphrase-fd 0 --armor --detach-sign --pinentry-mode loopback --batch --yes "${image}"
done
- name: "Generate release assets manifest" - name: "Generate release assets manifest"
shell: bash shell: bash