diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index 817a9ca8..62c1208c 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -108,7 +108,7 @@ jobs: - name: Install system dependencies run: | - sudo apt-get install -y python3.13 python3.13-venv python3-pip + sudo apt-get install -y python3.13 python3.13-venv python3-pip git curl wget - name: Pre-seed virtualenv with local wheel before dpkg install run: | @@ -178,8 +178,6 @@ jobs: - name: Determine release tag id: tag run: | - # github.event.release.tag_name is set for release events but empty - # for workflow_dispatch. Fall back to the version from pyproject.toml. TAG="${{ github.event.release.tag_name }}" if [ -z "$TAG" ]; then TAG="v$(grep '^version = ' pyproject.toml | awk -F'\"' '{print $2}')" @@ -197,4 +195,10 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + # Verify the release exists before uploading (workflow_dispatch may not have one) + if ! gh release view "${{ steps.tag.outputs.tag }}" >/dev/null 2>&1; then + echo "[!] No GitHub Release found for tag ${{ steps.tag.outputs.tag }}, skipping upload." + echo " Create a release first or trigger via the release event." + exit 0 + fi gh release upload "${{ steps.tag.outputs.tag }}" *.deb --clobber diff --git a/pkg/debian/install.sh b/pkg/debian/install.sh index 44d58c4e..1c72758e 100755 --- a/pkg/debian/install.sh +++ b/pkg/debian/install.sh @@ -13,8 +13,10 @@ if command -v python3.13 >/dev/null 2>&1; then PYTHON="python3.13" elif command -v python3 >/dev/null 2>&1; then PYTHON="python3" - PY_VER="$("$PYTHON" -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')" - if [ "$(echo "$PY_VER 3.13" | awk '{print ($1 >= $2)}')" != "1" ]; then + PY_MAJOR="$("$PYTHON" -c 'import sys; print(sys.version_info.major)')" + PY_MINOR="$("$PYTHON" -c 'import sys; print(sys.version_info.minor)')" + if [ "$PY_MAJOR" -lt 3 ] || { [ "$PY_MAJOR" -eq 3 ] && [ "$PY_MINOR" -lt 13 ]; }; then + PY_VER="${PY_MAJOR}.${PY_MINOR}" echo "[!] Error: ArchiveBox requires Python >= 3.13, but found Python $PY_VER" echo " Install python3.13: sudo apt install python3.13 python3.13-venv" exit 1 diff --git a/pkg/debian/nfpm.yaml b/pkg/debian/nfpm.yaml index 83cb0074..fa3df26c 100644 --- a/pkg/debian/nfpm.yaml +++ b/pkg/debian/nfpm.yaml @@ -28,6 +28,14 @@ depends: # All other runtime deps (node, chrome, yt-dlp, etc.) are installed on-demand # by `archivebox install` and should NOT be declared as package dependencies. +recommends: + # Common utilities used by archivebox extractors. Declared as recommends + # (not depends) so dpkg doesn't hard-fail if they're missing, but apt + # installs them by default so users have a working baseline out of the box. + - git + - curl + - wget + contents: # Wrapper script for /usr/bin/archivebox - src: pkg/debian/archivebox