diff --git a/.github/workflows/release-smoke.yml b/.github/workflows/release-smoke.yml index 6984ee4..ea4aad7 100644 --- a/.github/workflows/release-smoke.yml +++ b/.github/workflows/release-smoke.yml @@ -54,47 +54,7 @@ jobs: done - name: Dry-run asset verification patterns run: | - mkdir -p /tmp/release-assets V="9.9.9" - for name in \ - "FromChat-Setup-${V}-windows-x64.exe" \ - "FromChat-Setup-${V}-windows-arm64.exe" \ - "FromChat-${V}-macOS-x64.dmg" \ - "FromChat-${V}-macOS-arm64.dmg" \ - "FromChat-${V}-linux-x64.deb" \ - "FromChat-${V}-linux-arm64.deb" \ - "FromChat-${V}-linux-x64.rpm" \ - "FromChat-${V}-linux-arm64.rpm" \ - "FromChat-${V}-linux-x64.AppImage" \ - "FromChat-${V}-linux-arm64.AppImage" \ - "FromChat-${V}-android-universal.apk" - do - echo "placeholder" > "/tmp/release-assets/$name" - done - python3 - <<'PY' -import struct, pathlib, zipfile -root = pathlib.Path("/tmp/release-assets") -for name, machine in [ - ("FromChat-Setup-9.9.9-windows-x64.exe", 0x8664), - ("FromChat-Setup-9.9.9-windows-arm64.exe", 0xAA64), -]: - path = root / name - data = bytearray(0x40) - struct.pack_into("\n") -for rpm in root.glob("*.rpm"): - rpm.write_bytes(b"\xed\xab\xee\xdb" + b"\x00" * 96) -for appimage in root.glob("*.AppImage"): - appimage.write_bytes(b"\x7fELF" + b"\x00" * 16) -for dmg in root.glob("*.dmg"): - dmg.write_bytes(b"UDIF" + b"\x00" * 32) -PY + bash scripts/ci-create-smoke-fixtures.sh /tmp/release-assets "$V" sudo apt-get update && sudo apt-get install -y rpm file unzip CI_SMOKE=1 bash scripts/ci-verify-release-assets.sh "$V" /tmp/release-assets diff --git a/scripts/ci-create-smoke-fixtures.sh b/scripts/ci-create-smoke-fixtures.sh new file mode 100644 index 0000000..dd9d74f --- /dev/null +++ b/scripts/ci-create-smoke-fixtures.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +set -euo pipefail + +ASSETS_DIR="${1:?usage: ci-create-smoke-fixtures.sh }" +VERSION="${2:?usage: ci-create-smoke-fixtures.sh }" + +mkdir -p "$ASSETS_DIR" + +for name in \ + "FromChat-Setup-${VERSION}-windows-x64.exe" \ + "FromChat-Setup-${VERSION}-windows-arm64.exe" \ + "FromChat-${VERSION}-macOS-x64.dmg" \ + "FromChat-${VERSION}-macOS-arm64.dmg" \ + "FromChat-${VERSION}-linux-x64.deb" \ + "FromChat-${VERSION}-linux-arm64.deb" \ + "FromChat-${VERSION}-linux-x64.rpm" \ + "FromChat-${VERSION}-linux-arm64.rpm" \ + "FromChat-${VERSION}-linux-x64.AppImage" \ + "FromChat-${VERSION}-linux-arm64.AppImage" \ + "FromChat-${VERSION}-android-universal.apk" +do + echo "placeholder" > "$ASSETS_DIR/$name" +done + +python3 - "$ASSETS_DIR" <<'PY' +import struct +import pathlib +import sys +import zipfile + +root = pathlib.Path(sys.argv[1]) +for name, machine in [ + ("FromChat-Setup-9.9.9-windows-x64.exe", 0x8664), + ("FromChat-Setup-9.9.9-windows-arm64.exe", 0xAA64), +]: + path = root / name + data = bytearray(0x40) + struct.pack_into("\n") +for rpm in root.glob("*.rpm"): + rpm.write_bytes(b"\xed\xab\xee\xdb" + b"\x00" * 96) +for appimage in root.glob("*.AppImage"): + appimage.write_bytes(b"\x7fELF" + b"\x00" * 16) +for dmg in root.glob("*.dmg"): + dmg.write_bytes(b"UDIF" + b"\x00" * 32) +PY