From 9d620c9fb32f35be9c1d455ac4c4e378f1ebc0aa Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 13:04:01 -0500 Subject: [PATCH 01/33] switched to fpm for the linux builds and switched to use GH action for Poetry install --- .github/workflows/simple-release.yml | 303 ++++++++++++++------------- 1 file changed, 156 insertions(+), 147 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index bcd3ca2..cfa130e 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -1,7 +1,10 @@ name: Build Multi-Platform Binaries on: - workflow_dispatch: # Manual trigger only + workflow_dispatch: + +permissions: + contents: write jobs: build-windows: @@ -25,14 +28,8 @@ jobs: - name: Ensure Poetry is on PATH (Windows) shell: pwsh run: | - # Add the typical Poetry installer location to PATH for subsequent steps. - # This writes the directory to GITHUB_PATH so it is appended to PATH automatically. $poetryPath = Join-Path $env:USERPROFILE ".local\bin" - Write-Output "Adding $poetryPath to PATH via GITHUB_PATH" Write-Output $poetryPath >> $Env:GITHUB_PATH - # Confirm it's on PATH for this step (diagnostics only) - Write-Output "PATH is now: $env:PATH" - Get-Command -ErrorAction SilentlyContinue poetry | ForEach-Object { Write-Output "poetry location: $($_.Source)" } || Write-Output "poetry not found yet (will be available in subsequent steps)" - name: Install dependencies run: | @@ -56,7 +53,8 @@ jobs: - name: Install system dependencies run: | apt-get update - apt-get install -y curl git build-essential + apt-get install -y curl git build-essential ruby ruby-dev gcc make build-essential zlib1g-dev + gem install --no-document fpm - name: Checkout code uses: actions/checkout@v4 @@ -67,134 +65,6 @@ jobs: python-version: '3.12' - name: Install Poetry - run: | - curl -sSL https://install.python-poetry.org | python - - echo 'export PATH="$HOME/.local/bin:$PATH"' >> $GITHUB_ENV - - - name: Configure Poetry - run: | - export PATH="$HOME/.local/bin:$PATH" - poetry config virtualenvs.create true - poetry config virtualenvs.in-project true - - - name: Install dependencies - run: | - export PATH="$HOME/.local/bin:$PATH" - poetry env use python3.12 || true - poetry install - - - name: Build Debian executable - run: | - export PATH="$HOME/.local/bin:$PATH" - poetry run pyinstaller --onefile --icon=icon_media/robot_files_256.png --name android-file-handler src/main.py - - - name: Upload Debian artifact - uses: actions/upload-artifact@v4 - with: - name: debian-binary - path: dist/android-file-handler - - build-arch: - runs-on: ubuntu-latest - container: - image: archlinux:latest - steps: - - name: Install system dependencies - run: | - pacman -Syu --noconfirm - pacman -S --noconfirm python python-pip curl git base-devel - - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Python 3.12 - uses: actions/setup-python@v5 - with: - python-version: '3.12' - - - name: Install Poetry - run: | - curl -sSL https://install.python-poetry.org | python - - echo 'export PATH="$HOME/.local/bin:$PATH"' >> $GITHUB_ENV - - - name: Configure Poetry - run: | - export PATH="$HOME/.local/bin:$PATH" - poetry config virtualenvs.create true - poetry config virtualenvs.in-project true - - - name: Install dependencies - run: | - export PATH="$HOME/.local/bin:$PATH" - poetry install - - - name: Build Arch executable - run: | - export PATH="$HOME/.local/bin:$PATH" - poetry run pyinstaller --onefile --icon=icon_media/robot_files_256.png --name android-file-handler src/main.py - - - name: Upload Arch artifact - uses: actions/upload-artifact@v4 - with: - name: arch-binary - path: dist/android-file-handler - - build-rocky: - runs-on: ubuntu-latest - container: - image: rockylinux:9 - steps: - - name: Install system build dependencies for Python and pyenv (enable CRB for -devel packages) - run: | - # enable the CodeReady Builder (CRB) repository so -devel packages (like gdbm-devel) are available - dnf -y install dnf-plugins-core - dnf config-manager --set-enabled crb - - # Refresh metadata and install the packages required to build CPython from source - dnf -y update - dnf -y install git gcc make openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel \ - readline-devel sqlite-devel tk-devel gdbm-devel libuuid-devel patch - - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install pyenv and build Python 3.12.11 (native to Rocky) — idempotent - env: - PYENV_ROOT: ${{ github.workspace }}/.pyenv_temp - run: | - # Use $HOME/.pyenv for the pyenv installation (runtime only — this will NOT change your repo files) - export PYENV_ROOT="$HOME/.pyenv" - export PATH="$PYENV_ROOT/bin:$PATH" - - # Clone or update pyenv (idempotent) - if [ -d "$PYENV_ROOT/.git" ]; then - echo "pyenv already exists — updating" - cd "$PYENV_ROOT" - git fetch --all --prune - git reset --hard origin/master || true - cd - - else - echo "Cloning pyenv" - git clone https://github.com/pyenv/pyenv.git "$PYENV_ROOT" - fi - - # Persist pyenv environment for subsequent steps - echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV - echo "PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" >> $GITHUB_ENV - - # Initialize pyenv for this step and ensure pyenv is usable immediately - export PATH="$PYENV_ROOT/bin:$PATH" - eval "$($PYENV_ROOT/bin/pyenv init -)" - - # Install the specified Python version if not already installed (-s = skip if present) - $PYENV_ROOT/bin/pyenv install -s 3.12.11 - $PYENV_ROOT/bin/pyenv global 3.12.11 - - # Verify installed python - python --version - pip --version - - - name: Install Poetry (use action; Poetry will use the pyenv-built python) uses: snok/install-poetry@v1 with: version: latest @@ -208,23 +78,160 @@ jobs: poetry config virtualenvs.create true poetry config virtualenvs.in-project true - - name: Install dependencies + - name: Install dependencies & build executable run: | export PATH="$HOME/.local/bin:$PATH" - # ensure poetry uses the pyenv python - poetry env use 3.12.11 || true + poetry env use python3.12 || true poetry install - - - name: Build Rocky executable - run: | - export PATH="$HOME/.local/bin:$PATH" poetry run pyinstaller --onefile --icon=icon_media/robot_files_256.png --name android-file-handler src/main.py - - name: Upload Rocky artifact + - name: Package .deb (fpm) + run: | + export PATH="$HOME/.local/bin:$PATH" + VERSION="$(poetry version -s)" + mkdir -p dist + chmod +x dist/android-file-handler + fpm -s dir -t deb -n android-file-handler -v "$VERSION" --architecture amd64 --prefix /usr/local/bin -p "dist/android-file-handler_${VERSION}_amd64.deb" dist/android-file-handler + + - name: Upload Debian .deb uses: actions/upload-artifact@v4 with: - name: rocky-binary - path: dist/android-file-handler + name: debian-package + path: dist/*.deb + + build-arch: + runs-on: ubuntu-latest + container: + image: archlinux:latest + steps: + - name: Install system dependencies (Arch) + run: | + pacman -Syu --noconfirm + pacman -S --noconfirm python python-pip curl git base-devel ruby + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + version: latest + virtualenvs-create: true + virtualenvs-in-project: true + + - name: Configure Poetry + run: | + echo 'export PATH="$HOME/.local/bin:$PATH"' >> $GITHUB_ENV + export PATH="$HOME/.local/bin:$PATH" + poetry config virtualenvs.create true + poetry config virtualenvs.in-project true + + - name: Install dependencies & build executable + run: | + export PATH="$HOME/.local/bin:$PATH" + poetry install + poetry run pyinstaller --onefile --icon=icon_media/robot_files_256.png --name android-file-handler src/main.py + + - name: Install fpm (gem) and package pacman + run: | + gem install --no-document fpm + VERSION="$(poetry version -s)" + mkdir -p dist + chmod +x dist/android-file-handler + fpm -s dir -t pacman -n android-file-handler -v "$VERSION" --architecture x86_64 --prefix /usr/local/bin -p "dist/android-file-handler-${VERSION}-1-x86_64.pkg.tar.zst" dist/android-file-handler + + - name: Upload Arch package + uses: actions/upload-artifact@v4 + with: + name: arch-package + path: dist/*.pkg.tar.* + + build-rocky: + runs-on: ubuntu-latest + container: + image: rockylinux:9 + steps: + - name: Install system build dependencies for Python and pyenv (enable CRB for -devel pkgs) + run: | + dnf -y install dnf-plugins-core + dnf config-manager --set-enabled crb + dnf -y update + dnf -y install git gcc make openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel \ + readline-devel sqlite-devel tk-devel gdbm-devel libuuid-devel patch ruby ruby-devel rubygems rpm-build + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install pyenv and build Python 3.12.11 (idempotent) + env: + PYENV_ROOT: ${{ github.workspace }}/.pyenv_temp + run: | + export PYENV_ROOT="$HOME/.pyenv" + export PATH="$PYENV_ROOT/bin:$PATH" + if [ -d "$PYENV_ROOT/.git" ]; then + cd "$PYENV_ROOT" + git fetch --all --prune + git reset --hard origin/master || true + cd - + else + git clone https://github.com/pyenv/pyenv.git "$PYENV_ROOT" + fi + if [ -d "$PYENV_ROOT/plugins/python-build/.git" ]; then + cd "$PYENV_ROOT/plugins/python-build" + git fetch --all --prune + git reset --hard origin/master || true + cd - + else + git clone https://github.com/pyenv/pyenv-build.git "$PYENV_ROOT/plugins/python-build" + fi + echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV + echo "PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" >> $GITHUB_ENV + export PATH="$PYENV_ROOT/bin:$PATH" + eval "$($PYENV_ROOT/bin/pyenv init -)" + $PYENV_ROOT/bin/pyenv install -s 3.12.11 + $PYENV_ROOT/bin/pyenv global 3.12.11 + python --version + pip --version + + - name: Install Poetry (use action) + uses: snok/install-poetry@v1 + with: + version: latest + virtualenvs-create: true + virtualenvs-in-project: true + + - name: Configure Poetry + run: | + echo 'export PATH="$HOME/.local/bin:$PATH"' >> $GITHUB_ENV + export PATH="$HOME/.local/bin:$PATH" + poetry config virtualenvs.create true + poetry config virtualenvs.in-project true + + - name: Install dependencies & build executable + run: | + export PATH="$HOME/.local/bin:$PATH" + poetry env use 3.12.11 || true + poetry install + poetry run pyinstaller --onefile --icon=icon_media/robot_files_256.png --name android-file-handler src/main.py + + - name: Install fpm (gem) and package .rpm + run: | + gem install --no-document fpm + VERSION="$(poetry version -s)" + mkdir -p dist + chmod +x dist/android-file-handler + fpm -s dir -t rpm -n android-file-handler -v "$VERSION" --architecture x86_64 --prefix /usr/local/bin -p "dist/android-file-handler-${VERSION}-1.x86_64.rpm" dist/android-file-handler + + - name: Upload Rocky RPM + uses: actions/upload-artifact@v4 + with: + name: rocky-package + path: dist/*.rpm create-release: needs: [build-windows, build-debian, build-arch, build-rocky] @@ -241,7 +248,9 @@ jobs: with: files: | ./binaries/android-file-handler.exe - ./binaries/android-file-handler + ./binaries/android-file-handler_*.deb + ./binaries/android-file-handler-*.rpm + ./binaries/android-file-handler-*-x86_64.pkg.tar.* draft: false prerelease: false env: -- 2.47.3 From 4bfd9822ec9f91583a54ef92e5370e85e395478f Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 13:26:20 -0500 Subject: [PATCH 02/33] correct fpm path issues for Arch --- .github/workflows/simple-release.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index cfa130e..e317969 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -139,7 +139,20 @@ jobs: - name: Install fpm (gem) and package pacman run: | + # install fpm (gem) gem install --no-document fpm + + # compute user gem bin dir dynamically (avoids hardcoding ruby version) + GEM_BIN="$(ruby -e 'print Gem.user_dir')/bin" + + echo "User gem bin: $GEM_BIN" + + # add Poetry user bin (common) and Ruby gem bin to PATH for subsequent steps + echo "$HOME/.local/bin" >> $GITHUB_PATH + echo "$GEM_BIN" >> $GITHUB_PATH + + # make available immediately in this step too (optional) + export PATH="$HOME/.local/bin:$GEM_BIN:$PATH" VERSION="$(poetry version -s)" mkdir -p dist chmod +x dist/android-file-handler -- 2.47.3 From 7895b2dbcb026c3b123adcba0c3268e9faf71842 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 13:52:23 -0500 Subject: [PATCH 03/33] fixed Ruby path and install issues --- .github/workflows/simple-release.yml | 62 +++++++++++++++------------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index e317969..59d639a 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -137,26 +137,38 @@ jobs: poetry install poetry run pyinstaller --onefile --icon=icon_media/robot_files_256.png --name android-file-handler src/main.py - - name: Install fpm (gem) and package pacman + - name: Install fpm (system ruby) and package pacman run: | - # install fpm (gem) - gem install --no-document fpm + set -euo pipefail - # compute user gem bin dir dynamically (avoids hardcoding ruby version) - GEM_BIN="$(ruby -e 'print Gem.user_dir')/bin" + # Update package DB and install ruby and build tools + pacman -Syu --noconfirm + pacman -S --noconfirm ruby base-devel - echo "User gem bin: $GEM_BIN" + # Install fpm system-wide (Actions container runs as root) + gem install --no-document fpm - # add Poetry user bin (common) and Ruby gem bin to PATH for subsequent steps - echo "$HOME/.local/bin" >> $GITHUB_PATH - echo "$GEM_BIN" >> $GITHUB_PATH + # Sanity checks + echo "ruby version: $(ruby -v)" + echo "gem env:" + gem env - # make available immediately in this step too (optional) - export PATH="$HOME/.local/bin:$GEM_BIN:$PATH" - VERSION="$(poetry version -s)" - mkdir -p dist - chmod +x dist/android-file-handler - fpm -s dir -t pacman -n android-file-handler -v "$VERSION" --architecture x86_64 --prefix /usr/local/bin -p "dist/android-file-handler-${VERSION}-1-x86_64.pkg.tar.zst" dist/android-file-handler + # Ensure system gem bin dir is on PATH for subsequent steps (usually /usr/local/bin) + echo "/usr/local/bin" >> $GITHUB_PATH + + # Verify fpm is available + if ! command -v fpm >/dev/null 2>&1; then + echo "fpm not found on PATH; gem installation may have gone to user dir. Diagnostics:" + ruby -e "puts Gem.user_dir" + ls -la "$(ruby -e 'print Gem.user_dir')/bin" || true + exit 1 + fi + + # Package with fpm + VERSION="$(poetry version -s)" + mkdir -p dist + chmod +x dist/android-file-handler + fpm -s dir -t pacman -n android-file-handler -v "$VERSION" --architecture x86_64 --prefix /usr/local/bin -p "dist/android-file-handler-${VERSION}-1-x86_64.pkg.tar.zst" dist/android-file-handler - name: Upload Arch package uses: actions/upload-artifact@v4 @@ -175,7 +187,7 @@ jobs: dnf config-manager --set-enabled crb dnf -y update dnf -y install git gcc make openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel \ - readline-devel sqlite-devel tk-devel gdbm-devel libuuid-devel patch ruby ruby-devel rubygems rpm-build + readline-devel sqlite-devel tk-devel gdbm-devel libuuid-devel patch ruby ruby-devel rubygems rpm-build - name: Checkout code uses: actions/checkout@v4 @@ -186,21 +198,13 @@ jobs: run: | export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH" - if [ -d "$PYENV_ROOT/.git" ]; then - cd "$PYENV_ROOT" - git fetch --all --prune - git reset --hard origin/master || true - cd - - else - git clone https://github.com/pyenv/pyenv.git "$PYENV_ROOT" - fi if [ -d "$PYENV_ROOT/plugins/python-build/.git" ]; then - cd "$PYENV_ROOT/plugins/python-build" - git fetch --all --prune - git reset --hard origin/master || true - cd - + cd "$PYENV_ROOT/plugins/python-build" + git fetch --all --prune + git reset --hard origin/master || true + cd - else - git clone https://github.com/pyenv/pyenv-build.git "$PYENV_ROOT/plugins/python-build" + git clone https://github.com/pyenv/pyenv-build.git "$PYENV_ROOT/plugins/python-build" fi echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV echo "PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" >> $GITHUB_ENV -- 2.47.3 From 41ab21412ffdc641d117a46145803a2232ab5708 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 14:01:51 -0500 Subject: [PATCH 04/33] updated ruby install to system path --- .github/workflows/simple-release.yml | 35 +++++++++++++++------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 59d639a..555e2d2 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -139,36 +139,39 @@ jobs: - name: Install fpm (system ruby) and package pacman run: | + # Insert as the 'run:' body for the Arch job step that installs fpm and packages set -euo pipefail - # Update package DB and install ruby and build tools + # Update and install ruby + build tools pacman -Syu --noconfirm pacman -S --noconfirm ruby base-devel - # Install fpm system-wide (Actions container runs as root) - gem install --no-document fpm + # Install fpm to /usr/local/bin so the executable is in a system path + # Pin the version for reproducibility + gem install --no-document -v '1.16.0' fpm -n /usr/local/bin - # Sanity checks - echo "ruby version: $(ruby -v)" - echo "gem env:" - gem env - - # Ensure system gem bin dir is on PATH for subsequent steps (usually /usr/local/bin) + # Ensure /usr/local/bin is available to subsequent workflow steps echo "/usr/local/bin" >> $GITHUB_PATH - # Verify fpm is available + # Immediate sanity checks + echo "ruby: $(ruby -v)" + echo "gem env:" + gem env if ! command -v fpm >/dev/null 2>&1; then - echo "fpm not found on PATH; gem installation may have gone to user dir. Diagnostics:" - ruby -e "puts Gem.user_dir" - ls -la "$(ruby -e 'print Gem.user_dir')/bin" || true - exit 1 + echo "fpm still not found on PATH; diagnostics:" + ruby -e "puts Gem.user_dir" + ls -la "$(ruby -e 'print Gem.user_dir')/bin" || true + exit 1 fi + fpm --version - # Package with fpm + # Build package VERSION="$(poetry version -s)" mkdir -p dist chmod +x dist/android-file-handler - fpm -s dir -t pacman -n android-file-handler -v "$VERSION" --architecture x86_64 --prefix /usr/local/bin -p "dist/android-file-handler-${VERSION}-1-x86_64.pkg.tar.zst" dist/android-file-handler + fpm -s dir -t pacman -n android-file-handler -v "$VERSION" \ + --architecture x86_64 --prefix /usr/local/bin \ + -p "dist/android-file-handler-${VERSION}-1-x86_64.pkg.tar.zst" dist/android-file-handler - name: Upload Arch package uses: actions/upload-artifact@v4 -- 2.47.3 From f4333e99ee7a16a06b44682267d7d581176586ac Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 14:36:58 -0500 Subject: [PATCH 05/33] trying arch workflow again --- .github/workflows/simple-release.yml | 49 ++++++++++++---------------- 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 555e2d2..10e943b 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -137,41 +137,32 @@ jobs: poetry install poetry run pyinstaller --onefile --icon=icon_media/robot_files_256.png --name android-file-handler src/main.py - - name: Install fpm (system ruby) and package pacman + - name: Install system Ruby and fpm, then build pacman package run: | - # Insert as the 'run:' body for the Arch job step that installs fpm and packages - set -euo pipefail + set -euo pipefail - # Update and install ruby + build tools - pacman -Syu --noconfirm - pacman -S --noconfirm ruby base-devel + # Update DB and ensure full ruby stdlib is present + pacman -Syu --noconfirm + pacman -S --noconfirm ruby base-devel - # Install fpm to /usr/local/bin so the executable is in a system path - # Pin the version for reproducibility - gem install --no-document -v '1.16.0' fpm -n /usr/local/bin + # Install fpm system-wide and pin version for reproducibility + gem install --no-document -v '1.16.0' fpm --bindir /usr/local/bin --install-dir /usr/lib/ruby/gems/3.4.0 - # Ensure /usr/local/bin is available to subsequent workflow steps - echo "/usr/local/bin" >> $GITHUB_PATH + # Make sure /usr/local/bin is visible to later steps + echo "/usr/local/bin" >> $GITHUB_PATH - # Immediate sanity checks - echo "ruby: $(ruby -v)" - echo "gem env:" - gem env - if ! command -v fpm >/dev/null 2>&1; then - echo "fpm still not found on PATH; diagnostics:" - ruby -e "puts Gem.user_dir" - ls -la "$(ruby -e 'print Gem.user_dir')/bin" || true - exit 1 - fi - fpm --version + # Sanity checks + ruby -e "require 'erb'; puts 'erb OK'" + command -v fpm || { echo 'fpm not found on PATH after install'; exit 1; } + fpm --version - # Build package - VERSION="$(poetry version -s)" - mkdir -p dist - chmod +x dist/android-file-handler - fpm -s dir -t pacman -n android-file-handler -v "$VERSION" \ - --architecture x86_64 --prefix /usr/local/bin \ - -p "dist/android-file-handler-${VERSION}-1-x86_64.pkg.tar.zst" dist/android-file-handler + # Build the package + VERSION="$(poetry version -s)" + mkdir -p dist + chmod +x dist/android-file-handler + fpm -s dir -t pacman -n android-file-handler -v "$VERSION" \ + --architecture x86_64 --prefix /usr/local/bin \ + -p "dist/android-file-handler-${VERSION}-1-x86_64.pkg.tar.zst" dist/android-file-handler - name: Upload Arch package uses: actions/upload-artifact@v4 -- 2.47.3 From 378e9ec03e7fecb17db3d8508e56c29c61d31a1e Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 15:00:23 -0500 Subject: [PATCH 06/33] added Ruby erb install to fix not found error --- .github/workflows/simple-release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 10e943b..4d6875f 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -147,6 +147,7 @@ jobs: # Install fpm system-wide and pin version for reproducibility gem install --no-document -v '1.16.0' fpm --bindir /usr/local/bin --install-dir /usr/lib/ruby/gems/3.4.0 + gem install --no-document erb # Make sure /usr/local/bin is visible to later steps echo "/usr/local/bin" >> $GITHUB_PATH -- 2.47.3 From 0b1d3123ba0c1d380a8ac5fc676bd558b67c3324 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 15:13:37 -0500 Subject: [PATCH 07/33] changed to building pyenv from source --- .github/workflows/simple-release.yml | 192 +++++++++++++++++++-------- 1 file changed, 134 insertions(+), 58 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 4d6875f..de061d0 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -1,3 +1,12 @@ +# Multi-platform build + packaging workflow +# - Builds a pyinstaller executable on Windows, Debian, Arch, Rocky. +# - Packages using fpm into .deb, .rpm, and pacman (.pkg.tar.zst) files with explicit filenames. +# - Creates a GitHub Release with the produced artifacts. +# +# Notes: +# - Poetry is installed via snok/install-poetry@v1 in all jobs. +# - fpm gem is pinned to 1.16.0 in the examples; change as needed. +# - Rocky job uses tarball downloads for pyenv and python-build (non-interactive, CI-friendly). name: Build Multi-Platform Binaries on: @@ -6,6 +15,10 @@ on: permissions: contents: write +env: + # change this if you prefer a different pinned fpm version + FPM_VERSION: "1.16.0" + jobs: build-windows: runs-on: windows-latest @@ -28,6 +41,7 @@ jobs: - name: Ensure Poetry is on PATH (Windows) shell: pwsh run: | + # Add Poetry user bin to PATH for subsequent steps in this job $poetryPath = Join-Path $env:USERPROFILE ".local\bin" Write-Output $poetryPath >> $Env:GITHUB_PATH @@ -50,11 +64,13 @@ jobs: container: image: python:3.12-slim steps: - - name: Install system dependencies + - name: Install system dependencies & gem fpm run: | + set -euo pipefail apt-get update - apt-get install -y curl git build-essential ruby ruby-dev gcc make build-essential zlib1g-dev - gem install --no-document fpm + apt-get install -y --no-install-recommends curl git build-essential ruby ruby-dev gcc make zlib1g-dev ca-certificates + # install pinned fpm to the system gem dir (will be available under gem env's EXECUTABLE DIRECTORY or /usr/local/bin) + gem install --no-document -v "${FPM_VERSION}" fpm - name: Checkout code uses: actions/checkout@v4 @@ -87,27 +103,34 @@ jobs: - name: Package .deb (fpm) run: | + set -euo pipefail export PATH="$HOME/.local/bin:$PATH" VERSION="$(poetry version -s)" mkdir -p dist chmod +x dist/android-file-handler + # explicit filename into dist/ fpm -s dir -t deb -n android-file-handler -v "$VERSION" --architecture amd64 --prefix /usr/local/bin -p "dist/android-file-handler_${VERSION}_amd64.deb" dist/android-file-handler - name: Upload Debian .deb uses: actions/upload-artifact@v4 with: name: debian-package - path: dist/*.deb + path: dist/android-file-handler_*.deb build-arch: runs-on: ubuntu-latest container: image: archlinux:latest steps: - - name: Install system dependencies (Arch) + - name: Install system dependencies (Arch) and system Ruby run: | + set -euo pipefail pacman -Syu --noconfirm - pacman -S --noconfirm python python-pip curl git base-devel ruby + pacman -S --noconfirm ruby base-devel curl git tar ca-certificates + # Install fpm system-wide and pin version so fpm will be in /usr/local/bin + gem install --no-document -v "${FPM_VERSION}" fpm --bindir /usr/local/bin + # persist system bindir to subsequent steps (usually already on PATH) + echo "/usr/local/bin" >> $GITHUB_PATH - name: Checkout code uses: actions/checkout@v4 @@ -128,42 +151,22 @@ jobs: run: | echo 'export PATH="$HOME/.local/bin:$PATH"' >> $GITHUB_ENV export PATH="$HOME/.local/bin:$PATH" - poetry config virtualenvs.create true - poetry config virtualenvs.in-project true - name: Install dependencies & build executable run: | - export PATH="$HOME/.local/bin:$PATH" + export PATH="$HOME/.local/bin:/usr/local/bin:$PATH" poetry install poetry run pyinstaller --onefile --icon=icon_media/robot_files_256.png --name android-file-handler src/main.py - - name: Install system Ruby and fpm, then build pacman package + - name: Package pacman (fpm) run: | set -euo pipefail - - # Update DB and ensure full ruby stdlib is present - pacman -Syu --noconfirm - pacman -S --noconfirm ruby base-devel - - # Install fpm system-wide and pin version for reproducibility - gem install --no-document -v '1.16.0' fpm --bindir /usr/local/bin --install-dir /usr/lib/ruby/gems/3.4.0 - gem install --no-document erb - - # Make sure /usr/local/bin is visible to later steps - echo "/usr/local/bin" >> $GITHUB_PATH - - # Sanity checks - ruby -e "require 'erb'; puts 'erb OK'" - command -v fpm || { echo 'fpm not found on PATH after install'; exit 1; } - fpm --version - - # Build the package + export PATH="$HOME/.local/bin:/usr/local/bin:$PATH" VERSION="$(poetry version -s)" mkdir -p dist chmod +x dist/android-file-handler - fpm -s dir -t pacman -n android-file-handler -v "$VERSION" \ - --architecture x86_64 --prefix /usr/local/bin \ - -p "dist/android-file-handler-${VERSION}-1-x86_64.pkg.tar.zst" dist/android-file-handler + # explicit filename into dist/ + fpm -s dir -t pacman -n android-file-handler -v "$VERSION" --architecture x86_64 --prefix /usr/local/bin -p "dist/android-file-handler-${VERSION}-1-x86_64.pkg.tar.zst" dist/android-file-handler - name: Upload Arch package uses: actions/upload-artifact@v4 @@ -176,41 +179,103 @@ jobs: container: image: rockylinux:9 steps: - - name: Install system build dependencies for Python and pyenv (enable CRB for -devel pkgs) + - name: Robust dnf setup and install build deps (retry-clean-refresh) run: | - dnf -y install dnf-plugins-core - dnf config-manager --set-enabled crb - dnf -y update - dnf -y install git gcc make openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel \ - readline-devel sqlite-devel tk-devel gdbm-devel libuuid-devel patch ruby ruby-devel rubygems rpm-build + set -euo pipefail + retry() { + local max_tries=5 + local sleep_base=3 + local n=1 + until "$@"; do + if [ $n -ge $max_tries ]; then + echo "Command failed after $n attempts: $*" + return 1 + fi + echo "Command failed: $*. Retrying ($n/$max_tries) after $((sleep_base * n))s..." + sleep $((sleep_base * n)) + n=$((n + 1)) + done + return 0 + } - - name: Checkout code - uses: actions/checkout@v4 + # Ensure plugin and enable CRB + retry dnf -y install dnf-plugins-core + retry dnf config-manager --set-enabled crb || true - - name: Install pyenv and build Python 3.12.11 (idempotent) - env: - PYENV_ROOT: ${{ github.workspace }}/.pyenv_temp + # Clean caches and refresh metadata + retry dnf -y clean all + rm -rf /var/cache/dnf || true + retry dnf -y makecache --refresh + + # Install build-time deps including ruby so gem stdlib is present + retry dnf -y install -y \ + git gcc make openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel \ + readline-devel sqlite-devel tk-devel gdbm-devel libuuid-devel patch \ + ruby ruby-devel rubygems rpm-build curl tar ca-certificates + + - name: Tarball-based pyenv + python-build (non-interactive) + id: pyenv_tarball run: | - export PYENV_ROOT="$HOME/.pyenv" - export PATH="$PYENV_ROOT/bin:$PATH" - if [ -d "$PYENV_ROOT/plugins/python-build/.git" ]; then - cd "$PYENV_ROOT/plugins/python-build" - git fetch --all --prune - git reset --hard origin/master || true - cd - - else - git clone https://github.com/pyenv/pyenv-build.git "$PYENV_ROOT/plugins/python-build" - fi - echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV - echo "PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" >> $GITHUB_ENV + set -euo pipefail + retry() { + local max=5 n=1 + until "$@"; do + if [ $n -ge $max ]; then + echo "Command failed after $n attempts: $*" + return 1 + fi + echo "Command failed: $*. Retrying ($n/$max) after $((n * 2))s..." + sleep $((n * 2)) + n=$((n + 1)) + done + return 0 + } + + echo "Ensure curl/tar/ca-certificates present (dnf already installed them above)" + # Place pyenv inside workspace + export PYENV_ROOT="${GITHUB_WORKSPACE}/.pyenv" + mkdir -p "$PYENV_ROOT" + mkdir -p "$PYENV_ROOT/plugins" + + # Pin refs (replace master with tags/commits for reproducible runs) + PYENV_PYENV_REF="${PYENV_PYENV_REF:-master}" + PYENV_BUILD_REF="${PYENV_BUILD_REF:-master}" + + echo "Downloading pyenv (${PYENV_PYENV_REF}) and python-build (${PYENV_BUILD_REF}) tarballs..." + retry curl -fsSL "https://github.com/pyenv/pyenv/archive/refs/heads/${PYENV_PYENV_REF}.tar.gz" \ + | tar -xz --strip-components=1 -C "$PYENV_ROOT" + + retry curl -fsSL "https://github.com/pyenv/pyenv-build/archive/refs/heads/${PYENV_BUILD_REF}.tar.gz" \ + | tar -xz --strip-components=1 -C "$PYENV_ROOT/plugins/python-build" + + # Initialize pyenv environment for this job export PATH="$PYENV_ROOT/bin:$PATH" eval "$($PYENV_ROOT/bin/pyenv init -)" + + # Persist environment variables for subsequent steps + echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV + echo "PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" >> $GITHUB_ENV + + echo "pyenv version:" + "$PYENV_ROOT/bin/pyenv" --version || true + echo "python-build plugin at: $PYENV_ROOT/plugins/python-build" + ls -la "$PYENV_ROOT/plugins/python-build" || true + + - name: Build Python with pyenv (3.12.11) and set global + env: + PYENV_ROOT: ${{ github.workspace }}/.pyenv + run: | + set -euo pipefail + export PYENV_ROOT="${PYENV_ROOT}" + export PATH="$PYENV_ROOT/bin:$PATH" + eval "$($PYENV_ROOT/bin/pyenv init -)" + # Install python (idempotent) $PYENV_ROOT/bin/pyenv install -s 3.12.11 $PYENV_ROOT/bin/pyenv global 3.12.11 python --version pip --version - - name: Install Poetry (use action) + - name: Install Poetry uses: snok/install-poetry@v1 with: version: latest @@ -226,14 +291,20 @@ jobs: - name: Install dependencies & build executable run: | - export PATH="$HOME/.local/bin:$PATH" + set -euo pipefail + export PATH="$HOME/.local/bin:$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" poetry env use 3.12.11 || true poetry install poetry run pyinstaller --onefile --icon=icon_media/robot_files_256.png --name android-file-handler src/main.py - - name: Install fpm (gem) and package .rpm + - name: Install fpm and package .rpm run: | - gem install --no-document fpm + set -euo pipefail + # install pinned fpm and ensure binary is in system bindir + gem install --no-document -v "${FPM_VERSION}" fpm --bindir /usr/local/bin + echo "/usr/local/bin" >> $GITHUB_PATH + + # Build rpm with explicit filename VERSION="$(poetry version -s)" mkdir -p dist chmod +x dist/android-file-handler @@ -255,6 +326,11 @@ jobs: merge-multiple: true path: ./binaries + - name: List downloaded binaries (debug) + run: | + echo "Downloaded files:" + ls -la ./binaries || true + - name: Create Release uses: softprops/action-gh-release@v1 with: -- 2.47.3 From 30e4244d200a42627f1e5c7748822dbd750c9b09 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 15:23:23 -0500 Subject: [PATCH 08/33] readded Ruby ERB gem install and changed from curl to git for Rocky --- .github/workflows/simple-release.yml | 34 +++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index de061d0..3c21e09 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -128,6 +128,7 @@ jobs: pacman -Syu --noconfirm pacman -S --noconfirm ruby base-devel curl git tar ca-certificates # Install fpm system-wide and pin version so fpm will be in /usr/local/bin + gem install --no-document erb gem install --no-document -v "${FPM_VERSION}" fpm --bindir /usr/local/bin # persist system bindir to subsequent steps (usually already on PATH) echo "/usr/local/bin" >> $GITHUB_PATH @@ -211,7 +212,7 @@ jobs: retry dnf -y install -y \ git gcc make openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel \ readline-devel sqlite-devel tk-devel gdbm-devel libuuid-devel patch \ - ruby ruby-devel rubygems rpm-build curl tar ca-certificates + ruby ruby-devel rubygems rpm-build tar ca-certificates - name: Tarball-based pyenv + python-build (non-interactive) id: pyenv_tarball @@ -241,12 +242,33 @@ jobs: PYENV_PYENV_REF="${PYENV_PYENV_REF:-master}" PYENV_BUILD_REF="${PYENV_BUILD_REF:-master}" - echo "Downloading pyenv (${PYENV_PYENV_REF}) and python-build (${PYENV_BUILD_REF}) tarballs..." - retry curl -fsSL "https://github.com/pyenv/pyenv/archive/refs/heads/${PYENV_PYENV_REF}.tar.gz" \ - | tar -xz --strip-components=1 -C "$PYENV_ROOT" + echo "Cloning pyenv (${PYENV_PYENV_REF}) and python-build (${PYENV_BUILD_REF}) via git (shallow)" - retry curl -fsSL "https://github.com/pyenv/pyenv-build/archive/refs/heads/${PYENV_BUILD_REF}.tar.gz" \ - | tar -xz --strip-components=1 -C "$PYENV_ROOT/plugins/python-build" + REPO_PYENV="https://github.com/pyenv/pyenv.git" + REPO_BUILD="https://github.com/pyenv/pyenv-build.git" + + # pyenv: shallow clone the requested ref if possible, otherwise fall back to default shallow clone + if [ -d "$PYENV_ROOT/.git" ]; then + retry git -C "$PYENV_ROOT" fetch --all --prune --depth=1 || true + retry git -C "$PYENV_ROOT" reset --hard "origin/${PYENV_PYENV_REF}" || true + else + if ! retry git clone --depth 1 --branch "${PYENV_PYENV_REF}" "$REPO_PYENV" "$PYENV_ROOT"; then + echo "Branch/ref ${PYENV_PYENV_REF} not available for shallow clone; falling back to default branch" + retry git clone --depth 1 "$REPO_PYENV" "$PYENV_ROOT" + fi + fi + + # python-build plugin: place under plugins/python-build + mkdir -p "$PYENV_ROOT/plugins" + if [ -d "$PYENV_ROOT/plugins/python-build/.git" ]; then + retry git -C "$PYENV_ROOT/plugins/python-build" fetch --all --prune --depth=1 || true + retry git -C "$PYENV_ROOT/plugins/python-build" reset --hard "origin/${PYENV_BUILD_REF}" || true + else + if ! retry git clone --depth 1 --branch "${PYENV_BUILD_REF}" "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build"; then + echo "Branch/ref ${PYENV_BUILD_REF} not available for shallow clone; falling back to default branch" + retry git clone --depth 1 "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build" + fi + fi # Initialize pyenv environment for this job export PATH="$PYENV_ROOT/bin:$PATH" -- 2.47.3 From 80f5ff8888b3e76279c5425b7ccfc3c23f7240fc Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 15:31:24 -0500 Subject: [PATCH 09/33] added fallback behavior for when ~/.pyenv is not empty on Rocky --- .github/workflows/simple-release.yml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 3c21e09..61bcfe7 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -251,11 +251,19 @@ jobs: if [ -d "$PYENV_ROOT/.git" ]; then retry git -C "$PYENV_ROOT" fetch --all --prune --depth=1 || true retry git -C "$PYENV_ROOT" reset --hard "origin/${PYENV_PYENV_REF}" || true + elif [ -d "$PYENV_ROOT" ] && [ -z "$(ls -A "$PYENV_ROOT")" ]; then + # directory exists but empty -> safe to clone into + retry git clone --depth 1 --branch "${PYENV_PYENV_REF}" "$REPO_PYENV" "$PYENV_ROOT" || \ + { echo "Branch/ref ${PYENV_PYENV_REF} not available for shallow clone; falling back to default branch"; retry git clone --depth 1 "$REPO_PYENV" "$PYENV_ROOT"; } else - if ! retry git clone --depth 1 --branch "${PYENV_PYENV_REF}" "$REPO_PYENV" "$PYENV_ROOT"; then - echo "Branch/ref ${PYENV_PYENV_REF} not available for shallow clone; falling back to default branch" - retry git clone --depth 1 "$REPO_PYENV" "$PYENV_ROOT" + # directory exists and is not a git repo (or contains leftover files) -> move aside then clone + if [ -d "$PYENV_ROOT" ]; then + backup_dest="${PYENV_ROOT}.bak.$(date +%s)" + echo "Found existing non-git pyenv directory; moving aside to ${backup_dest}" + mv "$PYENV_ROOT" "$backup_dest" fi + retry git clone --depth 1 --branch "${PYENV_PYENV_REF}" "$REPO_PYENV" "$PYENV_ROOT" || \ + { echo "Branch/ref ${PYENV_PYENV_REF} not available for shallow clone; falling back to default branch"; retry git clone --depth 1 "$REPO_PYENV" "$PYENV_ROOT"; } fi # python-build plugin: place under plugins/python-build @@ -263,11 +271,17 @@ jobs: if [ -d "$PYENV_ROOT/plugins/python-build/.git" ]; then retry git -C "$PYENV_ROOT/plugins/python-build" fetch --all --prune --depth=1 || true retry git -C "$PYENV_ROOT/plugins/python-build" reset --hard "origin/${PYENV_BUILD_REF}" || true + elif [ -d "$PYENV_ROOT/plugins/python-build" ] && [ -z "$(ls -A "$PYENV_ROOT/plugins/python-build")" ]; then + retry git clone --depth 1 --branch "${PYENV_BUILD_REF}" "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build" || \ + { echo "Branch/ref ${PYENV_BUILD_REF} not available for shallow clone; falling back to default branch"; retry git clone --depth 1 "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build"; } else - if ! retry git clone --depth 1 --branch "${PYENV_BUILD_REF}" "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build"; then - echo "Branch/ref ${PYENV_BUILD_REF} not available for shallow clone; falling back to default branch" - retry git clone --depth 1 "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build" + if [ -d "$PYENV_ROOT/plugins/python-build" ]; then + pb_backup="${PYENV_ROOT}/plugins/python-build.bak.$(date +%s)" + echo "Found existing non-git python-build dir; moving aside to ${pb_backup}" + mv "$PYENV_ROOT/plugins/python-build" "$pb_backup" fi + retry git clone --depth 1 --branch "${PYENV_BUILD_REF}" "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build" || \ + { echo "Branch/ref ${PYENV_BUILD_REF} not available for shallow clone; falling back to default branch"; retry git clone --depth 1 "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build"; } fi # Initialize pyenv environment for this job -- 2.47.3 From bc06bc9200ef03eacf43fd34e9f0f9b191e7a437 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 15:57:16 -0500 Subject: [PATCH 10/33] changing auth to use ssh key --- .github/workflows/simple-release.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 61bcfe7..0410a45 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -18,6 +18,8 @@ permissions: env: # change this if you prefer a different pinned fpm version FPM_VERSION: "1.16.0" + # SSH private key for GitHub operations (populate in repository secrets) + CI_CD_GH_SSH_KEY: ${{ secrets.CI_CD_GH_SSH_KEY }} jobs: build-windows: @@ -244,8 +246,22 @@ jobs: echo "Cloning pyenv (${PYENV_PYENV_REF}) and python-build (${PYENV_BUILD_REF}) via git (shallow)" - REPO_PYENV="https://github.com/pyenv/pyenv.git" - REPO_BUILD="https://github.com/pyenv/pyenv-build.git" + # Prefer SSH clones so CI can authenticate using a private key + REPO_PYENV="git@github.com:pyenv/pyenv.git" + REPO_BUILD="git@github.com:pyenv/pyenv-build.git" + + # If a CI SSH key is provided, configure SSH for git operations + if [ -n "${CI_CD_GH_SSH_KEY:-}" ]; then + echo "Configuring SSH for GitHub using CI_CD_GH_SSH_KEY" + mkdir -p ~/.ssh + # write key and restrict permissions + printf '%s' "${CI_CD_GH_SSH_KEY}" > ~/.ssh/ci_cd_afh_adb + chmod 600 ~/.ssh/ci_cd_afh_adb + eval "$(ssh-agent -s)" + ssh-add ~/.ssh/ci_cd_afh_adb + # ensure GitHub's host key is known to avoid interactive prompt + ssh-keyscan github.com >> ~/.ssh/known_hosts + fi # pyenv: shallow clone the requested ref if possible, otherwise fall back to default shallow clone if [ -d "$PYENV_ROOT/.git" ]; then -- 2.47.3 From 439216d52c3ee507d5e000d4c44971386a1b72b8 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 16:15:06 -0500 Subject: [PATCH 11/33] adding PAT authentication approach for clone --- .github/workflows/simple-release.yml | 32 ++++++++++++++++------------ 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 0410a45..e43a00e 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -20,6 +20,8 @@ env: FPM_VERSION: "1.16.0" # SSH private key for GitHub operations (populate in repository secrets) CI_CD_GH_SSH_KEY: ${{ secrets.CI_CD_GH_SSH_KEY }} + # Personal Access Token for HTTPS git operations (populate in repository secrets) + CI_CD_PAT: ${{ secrets.CI_CD_PAT }} jobs: build-windows: @@ -246,23 +248,25 @@ jobs: echo "Cloning pyenv (${PYENV_PYENV_REF}) and python-build (${PYENV_BUILD_REF}) via git (shallow)" - # Prefer SSH clones so CI can authenticate using a private key - REPO_PYENV="git@github.com:pyenv/pyenv.git" - REPO_BUILD="git@github.com:pyenv/pyenv-build.git" + # Use HTTPS clones and a repository PAT when available + REPO_PYENV="https://github.com/pyenv/pyenv.git" + REPO_BUILD="https://github.com/pyenv/pyenv-build.git" - # If a CI SSH key is provided, configure SSH for git operations - if [ -n "${CI_CD_GH_SSH_KEY:-}" ]; then - echo "Configuring SSH for GitHub using CI_CD_GH_SSH_KEY" - mkdir -p ~/.ssh - # write key and restrict permissions - printf '%s' "${CI_CD_GH_SSH_KEY}" > ~/.ssh/ci_cd_afh_adb - chmod 600 ~/.ssh/ci_cd_afh_adb - eval "$(ssh-agent -s)" - ssh-add ~/.ssh/ci_cd_afh_adb - # ensure GitHub's host key is known to avoid interactive prompt - ssh-keyscan github.com >> ~/.ssh/known_hosts + EXTRA_HEADER="" + if [ -n "${CI_CD_PAT:-}" ]; then + echo "Configuring git to use CI_CD_PAT for HTTPS operations" + # Create Authorization header: Basic base64(:PAT) + EXTRA_HEADER="AUTHORIZATION: basic $(printf ':%s' "${CI_CD_PAT}" | base64)" fi + gitx() { + if [ -n "${EXTRA_HEADER}" ]; then + git -c http.extraHeader="${EXTRA_HEADER}" "$@" + else + git "$@" + fi + } + # pyenv: shallow clone the requested ref if possible, otherwise fall back to default shallow clone if [ -d "$PYENV_ROOT/.git" ]; then retry git -C "$PYENV_ROOT" fetch --all --prune --depth=1 || true -- 2.47.3 From f5288ade6df1008b4b347ee66a48ba9eaf80b952 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 16:20:47 -0500 Subject: [PATCH 12/33] troubleshooting GH auth --- .github/workflows/simple-release.yml | 31 +++++++++++++++++----------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index e43a00e..1027e56 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -267,14 +267,21 @@ jobs: fi } + # Masked diagnostic: confirm whether CI_CD_PAT/EXTRA_HEADER is present (do NOT print secrets) + if [ -n "${CI_CD_PAT:-}" ]; then + echo "DEBUG: CI_CD_PAT is present -> git operations will use http.extraHeader (masked)" + else + echo "DEBUG: CI_CD_PAT is NOT present -> git operations will run unauthenticated" + fi + # pyenv: shallow clone the requested ref if possible, otherwise fall back to default shallow clone if [ -d "$PYENV_ROOT/.git" ]; then - retry git -C "$PYENV_ROOT" fetch --all --prune --depth=1 || true - retry git -C "$PYENV_ROOT" reset --hard "origin/${PYENV_PYENV_REF}" || true + retry gitx -C "$PYENV_ROOT" fetch --all --prune --depth=1 || true + retry gitx -C "$PYENV_ROOT" reset --hard "origin/${PYENV_PYENV_REF}" || true elif [ -d "$PYENV_ROOT" ] && [ -z "$(ls -A "$PYENV_ROOT")" ]; then # directory exists but empty -> safe to clone into - retry git clone --depth 1 --branch "${PYENV_PYENV_REF}" "$REPO_PYENV" "$PYENV_ROOT" || \ - { echo "Branch/ref ${PYENV_PYENV_REF} not available for shallow clone; falling back to default branch"; retry git clone --depth 1 "$REPO_PYENV" "$PYENV_ROOT"; } + retry gitx clone --depth 1 --branch "${PYENV_PYENV_REF}" "$REPO_PYENV" "$PYENV_ROOT" || \ + { echo "Branch/ref ${PYENV_PYENV_REF} not available for shallow clone; falling back to default branch"; retry gitx clone --depth 1 "$REPO_PYENV" "$PYENV_ROOT"; } else # directory exists and is not a git repo (or contains leftover files) -> move aside then clone if [ -d "$PYENV_ROOT" ]; then @@ -282,26 +289,26 @@ jobs: echo "Found existing non-git pyenv directory; moving aside to ${backup_dest}" mv "$PYENV_ROOT" "$backup_dest" fi - retry git clone --depth 1 --branch "${PYENV_PYENV_REF}" "$REPO_PYENV" "$PYENV_ROOT" || \ - { echo "Branch/ref ${PYENV_PYENV_REF} not available for shallow clone; falling back to default branch"; retry git clone --depth 1 "$REPO_PYENV" "$PYENV_ROOT"; } + retry gitx clone --depth 1 --branch "${PYENV_PYENV_REF}" "$REPO_PYENV" "$PYENV_ROOT" || \ + { echo "Branch/ref ${PYENV_PYENV_REF} not available for shallow clone; falling back to default branch"; retry gitx clone --depth 1 "$REPO_PYENV" "$PYENV_ROOT"; } fi # python-build plugin: place under plugins/python-build mkdir -p "$PYENV_ROOT/plugins" if [ -d "$PYENV_ROOT/plugins/python-build/.git" ]; then - retry git -C "$PYENV_ROOT/plugins/python-build" fetch --all --prune --depth=1 || true - retry git -C "$PYENV_ROOT/plugins/python-build" reset --hard "origin/${PYENV_BUILD_REF}" || true + retry gitx -C "$PYENV_ROOT/plugins/python-build" fetch --all --prune --depth=1 || true + retry gitx -C "$PYENV_ROOT/plugins/python-build" reset --hard "origin/${PYENV_BUILD_REF}" || true elif [ -d "$PYENV_ROOT/plugins/python-build" ] && [ -z "$(ls -A "$PYENV_ROOT/plugins/python-build")" ]; then - retry git clone --depth 1 --branch "${PYENV_BUILD_REF}" "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build" || \ - { echo "Branch/ref ${PYENV_BUILD_REF} not available for shallow clone; falling back to default branch"; retry git clone --depth 1 "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build"; } + retry gitx clone --depth 1 --branch "${PYENV_BUILD_REF}" "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build" || \ + { echo "Branch/ref ${PYENV_BUILD_REF} not available for shallow clone; falling back to default branch"; retry gitx clone --depth 1 "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build"; } else if [ -d "$PYENV_ROOT/plugins/python-build" ]; then pb_backup="${PYENV_ROOT}/plugins/python-build.bak.$(date +%s)" echo "Found existing non-git python-build dir; moving aside to ${pb_backup}" mv "$PYENV_ROOT/plugins/python-build" "$pb_backup" fi - retry git clone --depth 1 --branch "${PYENV_BUILD_REF}" "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build" || \ - { echo "Branch/ref ${PYENV_BUILD_REF} not available for shallow clone; falling back to default branch"; retry git clone --depth 1 "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build"; } + retry gitx clone --depth 1 --branch "${PYENV_BUILD_REF}" "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build" || \ + { echo "Branch/ref ${PYENV_BUILD_REF} not available for shallow clone; falling back to default branch"; retry gitx clone --depth 1 "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build"; } fi # Initialize pyenv environment for this job -- 2.47.3 From 025687f9ba26b8c42123356ff87202659922a796 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 16:28:05 -0500 Subject: [PATCH 13/33] TS GH access --- .github/workflows/simple-release.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 1027e56..ecd8c35 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -18,8 +18,6 @@ permissions: env: # change this if you prefer a different pinned fpm version FPM_VERSION: "1.16.0" - # SSH private key for GitHub operations (populate in repository secrets) - CI_CD_GH_SSH_KEY: ${{ secrets.CI_CD_GH_SSH_KEY }} # Personal Access Token for HTTPS git operations (populate in repository secrets) CI_CD_PAT: ${{ secrets.CI_CD_PAT }} @@ -256,7 +254,11 @@ jobs: if [ -n "${CI_CD_PAT:-}" ]; then echo "Configuring git to use CI_CD_PAT for HTTPS operations" # Create Authorization header: Basic base64(:PAT) - EXTRA_HEADER="AUTHORIZATION: basic $(printf ':%s' "${CI_CD_PAT}" | base64)" + EXTRA_HEADER="Authorization: Basic $(printf ':%s' "${CI_CD_PAT}" | base64)" + # set globally so git (and subprocesses) honor it for the duration of the job + git config --global http.extraHeader "${EXTRA_HEADER}" + # Prevent git from trying to prompt for credentials interactively + export GIT_TERMINAL_PROMPT=0 fi gitx() { -- 2.47.3 From 40384842d0b9feed14b266870d2fe5ad7ad9a7f4 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 16:41:09 -0500 Subject: [PATCH 14/33] added GH API fallback --- .github/workflows/simple-release.yml | 29 +++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index ecd8c35..913ad71 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -262,11 +262,8 @@ jobs: fi gitx() { - if [ -n "${EXTRA_HEADER}" ]; then - git -c http.extraHeader="${EXTRA_HEADER}" "$@" - else - git "$@" - fi + # http.extraHeader is configured globally when CI_CD_PAT exists; just run git + git "$@" } # Masked diagnostic: confirm whether CI_CD_PAT/EXTRA_HEADER is present (do NOT print secrets) @@ -282,8 +279,15 @@ jobs: retry gitx -C "$PYENV_ROOT" reset --hard "origin/${PYENV_PYENV_REF}" || true elif [ -d "$PYENV_ROOT" ] && [ -z "$(ls -A "$PYENV_ROOT")" ]; then # directory exists but empty -> safe to clone into - retry gitx clone --depth 1 --branch "${PYENV_PYENV_REF}" "$REPO_PYENV" "$PYENV_ROOT" || \ - { echo "Branch/ref ${PYENV_PYENV_REF} not available for shallow clone; falling back to default branch"; retry gitx clone --depth 1 "$REPO_PYENV" "$PYENV_ROOT"; } + if ! retry gitx clone --depth 1 --branch "${PYENV_PYENV_REF}" "$REPO_PYENV" "$PYENV_ROOT"; then + echo "git clone failed; attempting GitHub API tarball fallback using PAT" + if [ -n "${CI_CD_PAT:-}" ]; then + retry curl -fSL -H "Authorization: token ${CI_CD_PAT}" "https://api.github.com/repos/pyenv/pyenv/tarball/${PYENV_PYENV_REF}" | tar -xz --strip-components=1 -C "$PYENV_ROOT" + else + echo "No CI_CD_PAT provided; cannot use tarball fallback" + exit 1 + fi + fi else # directory exists and is not a git repo (or contains leftover files) -> move aside then clone if [ -d "$PYENV_ROOT" ]; then @@ -301,8 +305,15 @@ jobs: retry gitx -C "$PYENV_ROOT/plugins/python-build" fetch --all --prune --depth=1 || true retry gitx -C "$PYENV_ROOT/plugins/python-build" reset --hard "origin/${PYENV_BUILD_REF}" || true elif [ -d "$PYENV_ROOT/plugins/python-build" ] && [ -z "$(ls -A "$PYENV_ROOT/plugins/python-build")" ]; then - retry gitx clone --depth 1 --branch "${PYENV_BUILD_REF}" "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build" || \ - { echo "Branch/ref ${PYENV_BUILD_REF} not available for shallow clone; falling back to default branch"; retry gitx clone --depth 1 "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build"; } + if ! retry gitx clone --depth 1 --branch "${PYENV_BUILD_REF}" "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build"; then + echo "git clone for python-build failed; attempting GitHub API tarball fallback using PAT" + if [ -n "${CI_CD_PAT:-}" ]; then + retry curl -fSL -H "Authorization: token ${CI_CD_PAT}" "https://api.github.com/repos/pyenv/pyenv-build/tarball/${PYENV_BUILD_REF}" | tar -xz --strip-components=1 -C "$PYENV_ROOT/plugins/python-build" + else + echo "No CI_CD_PAT provided; cannot use tarball fallback" + exit 1 + fi + fi else if [ -d "$PYENV_ROOT/plugins/python-build" ]; then pb_backup="${PYENV_ROOT}/plugins/python-build.bak.$(date +%s)" -- 2.47.3 From 9fa7628e4221f27afc31ddb41ac3cd74ae9ff702 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 16:57:11 -0500 Subject: [PATCH 15/33] Trying again --- .github/workflows/simple-release.yml | 31 +++++++++++++++++----------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 913ad71..92565c1 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -216,6 +216,13 @@ jobs: readline-devel sqlite-devel tk-devel gdbm-devel libuuid-devel patch \ ruby ruby-devel rubygems rpm-build tar ca-certificates + - name: Configure Git credentials + run: | + # Configure git to use repository PAT for HTTPS operations to avoid interactive prompts + git config --global url."https://${{ secrets.CI_CD_PAT }}@github.com/".insteadOf "https://github.com/" + + + - name: Tarball-based pyenv + python-build (non-interactive) id: pyenv_tarball run: | @@ -279,12 +286,12 @@ jobs: retry gitx -C "$PYENV_ROOT" reset --hard "origin/${PYENV_PYENV_REF}" || true elif [ -d "$PYENV_ROOT" ] && [ -z "$(ls -A "$PYENV_ROOT")" ]; then # directory exists but empty -> safe to clone into - if ! retry gitx clone --depth 1 --branch "${PYENV_PYENV_REF}" "$REPO_PYENV" "$PYENV_ROOT"; then - echo "git clone failed; attempting GitHub API tarball fallback using PAT" - if [ -n "${CI_CD_PAT:-}" ]; then - retry curl -fSL -H "Authorization: token ${CI_CD_PAT}" "https://api.github.com/repos/pyenv/pyenv/tarball/${PYENV_PYENV_REF}" | tar -xz --strip-components=1 -C "$PYENV_ROOT" - else - echo "No CI_CD_PAT provided; cannot use tarball fallback" + if [ -n "${CI_CD_PAT:-}" ]; then + echo "CI_CD_PAT present; using GitHub API tarball for pyenv" + retry curl -fSL -H "Authorization: token ${CI_CD_PAT}" "https://api.github.com/repos/pyenv/pyenv/tarball/${PYENV_PYENV_REF}" | tar -xz --strip-components=1 -C "$PYENV_ROOT" + else + if ! retry gitx clone --depth 1 --branch "${PYENV_PYENV_REF}" "$REPO_PYENV" "$PYENV_ROOT"; then + echo "git clone failed and no CI_CD_PAT; aborting" exit 1 fi fi @@ -305,12 +312,12 @@ jobs: retry gitx -C "$PYENV_ROOT/plugins/python-build" fetch --all --prune --depth=1 || true retry gitx -C "$PYENV_ROOT/plugins/python-build" reset --hard "origin/${PYENV_BUILD_REF}" || true elif [ -d "$PYENV_ROOT/plugins/python-build" ] && [ -z "$(ls -A "$PYENV_ROOT/plugins/python-build")" ]; then - if ! retry gitx clone --depth 1 --branch "${PYENV_BUILD_REF}" "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build"; then - echo "git clone for python-build failed; attempting GitHub API tarball fallback using PAT" - if [ -n "${CI_CD_PAT:-}" ]; then - retry curl -fSL -H "Authorization: token ${CI_CD_PAT}" "https://api.github.com/repos/pyenv/pyenv-build/tarball/${PYENV_BUILD_REF}" | tar -xz --strip-components=1 -C "$PYENV_ROOT/plugins/python-build" - else - echo "No CI_CD_PAT provided; cannot use tarball fallback" + if [ -n "${CI_CD_PAT:-}" ]; then + echo "CI_CD_PAT present; using GitHub API tarball for python-build" + retry curl -fSL -H "Authorization: token ${CI_CD_PAT}" "https://api.github.com/repos/pyenv/pyenv-build/tarball/${PYENV_BUILD_REF}" | tar -xz --strip-components=1 -C "$PYENV_ROOT/plugins/python-build" + else + if ! retry gitx clone --depth 1 --branch "${PYENV_BUILD_REF}" "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build"; then + echo "git clone for python-build failed and no CI_CD_PAT; aborting" exit 1 fi fi -- 2.47.3 From 41d21f23b4f07efc6f799e9fce39a452ee140ef5 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 17:04:57 -0500 Subject: [PATCH 16/33] one more time --- .github/workflows/simple-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 92565c1..b359ce4 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -219,7 +219,7 @@ jobs: - name: Configure Git credentials run: | # Configure git to use repository PAT for HTTPS operations to avoid interactive prompts - git config --global url."https://${{ secrets.CI_CD_PAT }}@github.com/".insteadOf "https://github.com/" + git config --global url."https://x-access-token:${{ secrets.CI_CD_PAT }}@github.com/".insteadOf "https://github.com/" -- 2.47.3 From dca971093ebfba46e1f82a2f50b55f0cdb0c2177 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 17:13:45 -0500 Subject: [PATCH 17/33] correcting python-build URL --- .github/workflows/simple-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index b359ce4..774a5ae 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -255,7 +255,7 @@ jobs: # Use HTTPS clones and a repository PAT when available REPO_PYENV="https://github.com/pyenv/pyenv.git" - REPO_BUILD="https://github.com/pyenv/pyenv-build.git" + REPO_BUILD="https://github.com/pyenv/python-build.git" EXTRA_HEADER="" if [ -n "${CI_CD_PAT:-}" ]; then -- 2.47.3 From 3a3b42486f801a63e726630dbd39221e188d1eb4 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 17:34:26 -0500 Subject: [PATCH 18/33] trying alternate way for pyenv installation --- .github/workflows/simple-release.yml | 106 +++------------------------ 1 file changed, 9 insertions(+), 97 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 774a5ae..13e72dc 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -227,108 +227,18 @@ jobs: id: pyenv_tarball run: | set -euo pipefail - retry() { - local max=5 n=1 - until "$@"; do - if [ $n -ge $max ]; then - echo "Command failed after $n attempts: $*" - return 1 - fi - echo "Command failed: $*. Retrying ($n/$max) after $((n * 2))s..." - sleep $((n * 2)) - n=$((n + 1)) - done - return 0 - } - echo "Ensure curl/tar/ca-certificates present (dnf already installed them above)" - # Place pyenv inside workspace export PYENV_ROOT="${GITHUB_WORKSPACE}/.pyenv" mkdir -p "$PYENV_ROOT" - mkdir -p "$PYENV_ROOT/plugins" - # Pin refs (replace master with tags/commits for reproducible runs) - PYENV_PYENV_REF="${PYENV_PYENV_REF:-master}" - PYENV_BUILD_REF="${PYENV_BUILD_REF:-master}" + echo "Downloading pyenv installer and running it" + wget -qO /tmp/pyenv_install.sh https://pyenv.run + chmod +x /tmp/pyenv_install.sh + bash /tmp/pyenv_install.sh - echo "Cloning pyenv (${PYENV_PYENV_REF}) and python-build (${PYENV_BUILD_REF}) via git (shallow)" - - # Use HTTPS clones and a repository PAT when available - REPO_PYENV="https://github.com/pyenv/pyenv.git" - REPO_BUILD="https://github.com/pyenv/python-build.git" - - EXTRA_HEADER="" - if [ -n "${CI_CD_PAT:-}" ]; then - echo "Configuring git to use CI_CD_PAT for HTTPS operations" - # Create Authorization header: Basic base64(:PAT) - EXTRA_HEADER="Authorization: Basic $(printf ':%s' "${CI_CD_PAT}" | base64)" - # set globally so git (and subprocesses) honor it for the duration of the job - git config --global http.extraHeader "${EXTRA_HEADER}" - # Prevent git from trying to prompt for credentials interactively - export GIT_TERMINAL_PROMPT=0 - fi - - gitx() { - # http.extraHeader is configured globally when CI_CD_PAT exists; just run git - git "$@" - } - - # Masked diagnostic: confirm whether CI_CD_PAT/EXTRA_HEADER is present (do NOT print secrets) - if [ -n "${CI_CD_PAT:-}" ]; then - echo "DEBUG: CI_CD_PAT is present -> git operations will use http.extraHeader (masked)" - else - echo "DEBUG: CI_CD_PAT is NOT present -> git operations will run unauthenticated" - fi - - # pyenv: shallow clone the requested ref if possible, otherwise fall back to default shallow clone - if [ -d "$PYENV_ROOT/.git" ]; then - retry gitx -C "$PYENV_ROOT" fetch --all --prune --depth=1 || true - retry gitx -C "$PYENV_ROOT" reset --hard "origin/${PYENV_PYENV_REF}" || true - elif [ -d "$PYENV_ROOT" ] && [ -z "$(ls -A "$PYENV_ROOT")" ]; then - # directory exists but empty -> safe to clone into - if [ -n "${CI_CD_PAT:-}" ]; then - echo "CI_CD_PAT present; using GitHub API tarball for pyenv" - retry curl -fSL -H "Authorization: token ${CI_CD_PAT}" "https://api.github.com/repos/pyenv/pyenv/tarball/${PYENV_PYENV_REF}" | tar -xz --strip-components=1 -C "$PYENV_ROOT" - else - if ! retry gitx clone --depth 1 --branch "${PYENV_PYENV_REF}" "$REPO_PYENV" "$PYENV_ROOT"; then - echo "git clone failed and no CI_CD_PAT; aborting" - exit 1 - fi - fi - else - # directory exists and is not a git repo (or contains leftover files) -> move aside then clone - if [ -d "$PYENV_ROOT" ]; then - backup_dest="${PYENV_ROOT}.bak.$(date +%s)" - echo "Found existing non-git pyenv directory; moving aside to ${backup_dest}" - mv "$PYENV_ROOT" "$backup_dest" - fi - retry gitx clone --depth 1 --branch "${PYENV_PYENV_REF}" "$REPO_PYENV" "$PYENV_ROOT" || \ - { echo "Branch/ref ${PYENV_PYENV_REF} not available for shallow clone; falling back to default branch"; retry gitx clone --depth 1 "$REPO_PYENV" "$PYENV_ROOT"; } - fi - - # python-build plugin: place under plugins/python-build - mkdir -p "$PYENV_ROOT/plugins" - if [ -d "$PYENV_ROOT/plugins/python-build/.git" ]; then - retry gitx -C "$PYENV_ROOT/plugins/python-build" fetch --all --prune --depth=1 || true - retry gitx -C "$PYENV_ROOT/plugins/python-build" reset --hard "origin/${PYENV_BUILD_REF}" || true - elif [ -d "$PYENV_ROOT/plugins/python-build" ] && [ -z "$(ls -A "$PYENV_ROOT/plugins/python-build")" ]; then - if [ -n "${CI_CD_PAT:-}" ]; then - echo "CI_CD_PAT present; using GitHub API tarball for python-build" - retry curl -fSL -H "Authorization: token ${CI_CD_PAT}" "https://api.github.com/repos/pyenv/pyenv-build/tarball/${PYENV_BUILD_REF}" | tar -xz --strip-components=1 -C "$PYENV_ROOT/plugins/python-build" - else - if ! retry gitx clone --depth 1 --branch "${PYENV_BUILD_REF}" "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build"; then - echo "git clone for python-build failed and no CI_CD_PAT; aborting" - exit 1 - fi - fi - else - if [ -d "$PYENV_ROOT/plugins/python-build" ]; then - pb_backup="${PYENV_ROOT}/plugins/python-build.bak.$(date +%s)" - echo "Found existing non-git python-build dir; moving aside to ${pb_backup}" - mv "$PYENV_ROOT/plugins/python-build" "$pb_backup" - fi - retry gitx clone --depth 1 --branch "${PYENV_BUILD_REF}" "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build" || \ - { echo "Branch/ref ${PYENV_BUILD_REF} not available for shallow clone; falling back to default branch"; retry gitx clone --depth 1 "$REPO_BUILD" "$PYENV_ROOT/plugins/python-build"; } + # If installer wrote to $HOME/.pyenv, move it into the workspace + if [ -d "$HOME/.pyenv" ] && [ ! -d "$PYENV_ROOT" ]; then + mv "$HOME/.pyenv" "$PYENV_ROOT" fi # Initialize pyenv environment for this job @@ -341,6 +251,8 @@ jobs: echo "pyenv version:" "$PYENV_ROOT/bin/pyenv" --version || true + # Verify pyenv can list installed/available versions (small, non-fatal smoke test) + "$PYENV_ROOT/bin/pyenv" versions --bare | head -n 5 || true echo "python-build plugin at: $PYENV_ROOT/plugins/python-build" ls -la "$PYENV_ROOT/plugins/python-build" || true -- 2.47.3 From adad7e450946320678d2368823b7cb15e1ccb131 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 17:37:14 -0500 Subject: [PATCH 19/33] trying alternate way for pyenv installation - added wget --- .github/workflows/simple-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 13e72dc..060901c 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -214,7 +214,7 @@ jobs: retry dnf -y install -y \ git gcc make openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel \ readline-devel sqlite-devel tk-devel gdbm-devel libuuid-devel patch \ - ruby ruby-devel rubygems rpm-build tar ca-certificates + ruby ruby-devel rubygems rpm-build tar ca-certificates wget - name: Configure Git credentials run: | -- 2.47.3 From af86f52dc591a9691dfd5e2fcb6e0f4504ce1a0d Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 17:43:37 -0500 Subject: [PATCH 20/33] trying to remove blocking directory --- .github/workflows/simple-release.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 060901c..2b1a686 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -229,9 +229,22 @@ jobs: set -euo pipefail export PYENV_ROOT="${GITHUB_WORKSPACE}/.pyenv" + + # Remove any leftover pyenv directories that block installation + if [ -d "$PYENV_ROOT" ]; then + echo "Removing existing workspace pyenv: $PYENV_ROOT" + rm -rf "$PYENV_ROOT" + fi + + if [ -d "$HOME/.pyenv" ]; then + echo "Removing existing home pyenv: $HOME/.pyenv" + rm -rf "$HOME/.pyenv" + fi + mkdir -p "$PYENV_ROOT" echo "Downloading pyenv installer and running it" + wget -qO /tmp/pyenv_install.sh https://pyenv.run chmod +x /tmp/pyenv_install.sh bash /tmp/pyenv_install.sh -- 2.47.3 From 734f9cb9b1ca5618e4a9cfa51fba46f4bcc66555 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 17:49:28 -0500 Subject: [PATCH 21/33] trying to remove blocking directory again --- .github/workflows/simple-release.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 2b1a686..7666f49 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -229,17 +229,9 @@ jobs: set -euo pipefail export PYENV_ROOT="${GITHUB_WORKSPACE}/.pyenv" - - # Remove any leftover pyenv directories that block installation - if [ -d "$PYENV_ROOT" ]; then - echo "Removing existing workspace pyenv: $PYENV_ROOT" - rm -rf "$PYENV_ROOT" - fi - - if [ -d "$HOME/.pyenv" ]; then - echo "Removing existing home pyenv: $HOME/.pyenv" - rm -rf "$HOME/.pyenv" - fi + + echo "Removing existing home pyenv: $HOME/.pyenv" + rm -rf ~/.pyenv" mkdir -p "$PYENV_ROOT" -- 2.47.3 From edf03f7efb2c1b6cf17d088af4601632503029aa Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 17:51:53 -0500 Subject: [PATCH 22/33] fixed syntax error --- .github/workflows/simple-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 7666f49..43308d0 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -231,7 +231,7 @@ jobs: export PYENV_ROOT="${GITHUB_WORKSPACE}/.pyenv" echo "Removing existing home pyenv: $HOME/.pyenv" - rm -rf ~/.pyenv" + rm -rf ~/.pyenv mkdir -p "$PYENV_ROOT" -- 2.47.3 From dcddf312241dc2d447bcaca6a403a0b9e73c4b65 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 18:01:42 -0500 Subject: [PATCH 23/33] removed unecessary git config step --- .github/workflows/simple-release.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 43308d0..51852c3 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -216,13 +216,6 @@ jobs: readline-devel sqlite-devel tk-devel gdbm-devel libuuid-devel patch \ ruby ruby-devel rubygems rpm-build tar ca-certificates wget - - name: Configure Git credentials - run: | - # Configure git to use repository PAT for HTTPS operations to avoid interactive prompts - git config --global url."https://x-access-token:${{ secrets.CI_CD_PAT }}@github.com/".insteadOf "https://github.com/" - - - - name: Tarball-based pyenv + python-build (non-interactive) id: pyenv_tarball run: | -- 2.47.3 From 0e884a5c13562754b857496e6ee85325f23b7001 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 18:05:37 -0500 Subject: [PATCH 24/33] trying to remove path from prior step --- .github/workflows/simple-release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 51852c3..7188243 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -221,11 +221,11 @@ jobs: run: | set -euo pipefail - export PYENV_ROOT="${GITHUB_WORKSPACE}/.pyenv" echo "Removing existing home pyenv: $HOME/.pyenv" - rm -rf ~/.pyenv - + rm -rf /__w/android_file_handler_adb/android_file_handler_adb/.pyenv + + export PYENV_ROOT="${GITHUB_WORKSPACE}/.pyenv" mkdir -p "$PYENV_ROOT" echo "Downloading pyenv installer and running it" -- 2.47.3 From 6994d6a16e3f55f91e21a9890a2fd0c09da9900c Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 18:10:08 -0500 Subject: [PATCH 25/33] work please --- .github/workflows/simple-release.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 7188243..da392fd 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -216,14 +216,17 @@ jobs: readline-devel sqlite-devel tk-devel gdbm-devel libuuid-devel patch \ ruby ruby-devel rubygems rpm-build tar ca-certificates wget + - name: Clean up pyenv + run: | + echo "Removing existing home pyenv" + rm -rf /__w/android_file_handler_adb/android_file_handler_adb/.pyenv + - name: Tarball-based pyenv + python-build (non-interactive) id: pyenv_tarball run: | set -euo pipefail - echo "Removing existing home pyenv: $HOME/.pyenv" - rm -rf /__w/android_file_handler_adb/android_file_handler_adb/.pyenv export PYENV_ROOT="${GITHUB_WORKSPACE}/.pyenv" mkdir -p "$PYENV_ROOT" -- 2.47.3 From eebbe8fae35c76306169991d62d80dc977fd99c7 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 18:14:21 -0500 Subject: [PATCH 26/33] work please 1 --- .github/workflows/simple-release.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index da392fd..5400655 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -218,9 +218,10 @@ jobs: - name: Clean up pyenv run: | - echo "Removing existing home pyenv" - rm -rf /__w/android_file_handler_adb/android_file_handler_adb/.pyenv - + echo "Removing existing pyenv installations" + rm -rf "${GITHUB_WORKSPACE}/.pyenv" + rm -rf "${HOME}/.pyenv" + - name: Tarball-based pyenv + python-build (non-interactive) id: pyenv_tarball run: | -- 2.47.3 From 61fd01be92c5bc5f2b1a7460d924bbe36dcb82f8 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 18:20:29 -0500 Subject: [PATCH 27/33] work please 2 --- .github/workflows/simple-release.yml | 37 +++++++++------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 5400655..949d039 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -218,45 +218,32 @@ jobs: - name: Clean up pyenv run: | - echo "Removing existing pyenv installations" - rm -rf "${GITHUB_WORKSPACE}/.pyenv" - rm -rf "${HOME}/.pyenv" - + echo "Removing existing pyenv installations" + rm -rf "${GITHUB_WORKSPACE}/.pyenv" + rm -rf "${HOME}/.pyenv" + - name: Tarball-based pyenv + python-build (non-interactive) - id: pyenv_tarball + env: + PYENV_ROOT: ${{ github.workspace }}/.pyenv # Set this BEFORE running installer run: | set -euo pipefail - - - export PYENV_ROOT="${GITHUB_WORKSPACE}/.pyenv" + echo "PYENV_ROOT is set to: $PYENV_ROOT" mkdir -p "$PYENV_ROOT" - + echo "Downloading pyenv installer and running it" - - wget -qO /tmp/pyenv_install.sh https://pyenv.run - chmod +x /tmp/pyenv_install.sh - bash /tmp/pyenv_install.sh - - # If installer wrote to $HOME/.pyenv, move it into the workspace - if [ -d "$HOME/.pyenv" ] && [ ! -d "$PYENV_ROOT" ]; then - mv "$HOME/.pyenv" "$PYENV_ROOT" - fi - + wget -qO- https://pyenv.run | bash + # Initialize pyenv environment for this job export PATH="$PYENV_ROOT/bin:$PATH" eval "$($PYENV_ROOT/bin/pyenv init -)" - + # Persist environment variables for subsequent steps echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV echo "PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" >> $GITHUB_ENV - + echo "pyenv version:" "$PYENV_ROOT/bin/pyenv" --version || true - # Verify pyenv can list installed/available versions (small, non-fatal smoke test) - "$PYENV_ROOT/bin/pyenv" versions --bare | head -n 5 || true - echo "python-build plugin at: $PYENV_ROOT/plugins/python-build" - ls -la "$PYENV_ROOT/plugins/python-build" || true - name: Build Python with pyenv (3.12.11) and set global env: -- 2.47.3 From bf985a502d79b5e23823007c8f6b44e8bb796de2 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 18:25:29 -0500 Subject: [PATCH 28/33] commenting out Rocky workflow for the moment --- .github/workflows/simple-release.yml | 260 +++++++++++++-------------- 1 file changed, 130 insertions(+), 130 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 949d039..cbec090 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -177,153 +177,153 @@ jobs: name: arch-package path: dist/*.pkg.tar.* - build-rocky: - runs-on: ubuntu-latest - container: - image: rockylinux:9 - steps: - - name: Robust dnf setup and install build deps (retry-clean-refresh) - run: | - set -euo pipefail - retry() { - local max_tries=5 - local sleep_base=3 - local n=1 - until "$@"; do - if [ $n -ge $max_tries ]; then - echo "Command failed after $n attempts: $*" - return 1 - fi - echo "Command failed: $*. Retrying ($n/$max_tries) after $((sleep_base * n))s..." - sleep $((sleep_base * n)) - n=$((n + 1)) - done - return 0 - } + # build-rocky: + # runs-on: ubuntu-latest + # container: + # image: rockylinux:9 + # steps: + # - name: Robust dnf setup and install build deps (retry-clean-refresh) + # run: | + # set -euo pipefail + # retry() { + # local max_tries=5 + # local sleep_base=3 + # local n=1 + # until "$@"; do + # if [ $n -ge $max_tries ]; then + # echo "Command failed after $n attempts: $*" + # return 1 + # fi + # echo "Command failed: $*. Retrying ($n/$max_tries) after $((sleep_base * n))s..." + # sleep $((sleep_base * n)) + # n=$((n + 1)) + # done + # return 0 + # } - # Ensure plugin and enable CRB - retry dnf -y install dnf-plugins-core - retry dnf config-manager --set-enabled crb || true + # # Ensure plugin and enable CRB + # retry dnf -y install dnf-plugins-core + # retry dnf config-manager --set-enabled crb || true - # Clean caches and refresh metadata - retry dnf -y clean all - rm -rf /var/cache/dnf || true - retry dnf -y makecache --refresh + # # Clean caches and refresh metadata + # retry dnf -y clean all + # rm -rf /var/cache/dnf || true + # retry dnf -y makecache --refresh - # Install build-time deps including ruby so gem stdlib is present - retry dnf -y install -y \ - git gcc make openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel \ - readline-devel sqlite-devel tk-devel gdbm-devel libuuid-devel patch \ - ruby ruby-devel rubygems rpm-build tar ca-certificates wget + # # Install build-time deps including ruby so gem stdlib is present + # retry dnf -y install -y \ + # git gcc make openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel \ + # readline-devel sqlite-devel tk-devel gdbm-devel libuuid-devel patch \ + # ruby ruby-devel rubygems rpm-build tar ca-certificates wget - - name: Clean up pyenv - run: | - echo "Removing existing pyenv installations" - rm -rf "${GITHUB_WORKSPACE}/.pyenv" - rm -rf "${HOME}/.pyenv" + # - name: Clean up pyenv + # run: | + # echo "Removing existing pyenv installations" + # rm -rf "${GITHUB_WORKSPACE}/.pyenv" + # rm -rf "${HOME}/.pyenv" - - name: Tarball-based pyenv + python-build (non-interactive) - env: - PYENV_ROOT: ${{ github.workspace }}/.pyenv # Set this BEFORE running installer - run: | - set -euo pipefail + # - name: Tarball-based pyenv + python-build (non-interactive) + # env: + # PYENV_ROOT: ${{ github.workspace }}/.pyenv # Set this BEFORE running installer + # run: | + # set -euo pipefail - echo "PYENV_ROOT is set to: $PYENV_ROOT" - mkdir -p "$PYENV_ROOT" + # echo "PYENV_ROOT is set to: $PYENV_ROOT" + # mkdir -p "$PYENV_ROOT" - echo "Downloading pyenv installer and running it" - wget -qO- https://pyenv.run | bash + # echo "Downloading pyenv installer and running it" + # wget -qO- https://pyenv.run | bash - # Initialize pyenv environment for this job - export PATH="$PYENV_ROOT/bin:$PATH" - eval "$($PYENV_ROOT/bin/pyenv init -)" + # # Initialize pyenv environment for this job + # export PATH="$PYENV_ROOT/bin:$PATH" + # eval "$($PYENV_ROOT/bin/pyenv init -)" - # Persist environment variables for subsequent steps - echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV - echo "PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" >> $GITHUB_ENV + # # Persist environment variables for subsequent steps + # echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV + # echo "PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" >> $GITHUB_ENV - echo "pyenv version:" - "$PYENV_ROOT/bin/pyenv" --version || true + # echo "pyenv version:" + # "$PYENV_ROOT/bin/pyenv" --version || true - - name: Build Python with pyenv (3.12.11) and set global - env: - PYENV_ROOT: ${{ github.workspace }}/.pyenv - run: | - set -euo pipefail - export PYENV_ROOT="${PYENV_ROOT}" - export PATH="$PYENV_ROOT/bin:$PATH" - eval "$($PYENV_ROOT/bin/pyenv init -)" - # Install python (idempotent) - $PYENV_ROOT/bin/pyenv install -s 3.12.11 - $PYENV_ROOT/bin/pyenv global 3.12.11 - python --version - pip --version + # - name: Build Python with pyenv (3.12.11) and set global + # env: + # PYENV_ROOT: ${{ github.workspace }}/.pyenv + # run: | + # set -euo pipefail + # export PYENV_ROOT="${PYENV_ROOT}" + # export PATH="$PYENV_ROOT/bin:$PATH" + # eval "$($PYENV_ROOT/bin/pyenv init -)" + # # Install python (idempotent) + # $PYENV_ROOT/bin/pyenv install -s 3.12.11 + # $PYENV_ROOT/bin/pyenv global 3.12.11 + # python --version + # pip --version - - name: Install Poetry - uses: snok/install-poetry@v1 - with: - version: latest - virtualenvs-create: true - virtualenvs-in-project: true + # - name: Install Poetry + # uses: snok/install-poetry@v1 + # with: + # version: latest + # virtualenvs-create: true + # virtualenvs-in-project: true - - name: Configure Poetry - run: | - echo 'export PATH="$HOME/.local/bin:$PATH"' >> $GITHUB_ENV - export PATH="$HOME/.local/bin:$PATH" - poetry config virtualenvs.create true - poetry config virtualenvs.in-project true + # - name: Configure Poetry + # run: | + # echo 'export PATH="$HOME/.local/bin:$PATH"' >> $GITHUB_ENV + # export PATH="$HOME/.local/bin:$PATH" + # poetry config virtualenvs.create true + # poetry config virtualenvs.in-project true - - name: Install dependencies & build executable - run: | - set -euo pipefail - export PATH="$HOME/.local/bin:$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" - poetry env use 3.12.11 || true - poetry install - poetry run pyinstaller --onefile --icon=icon_media/robot_files_256.png --name android-file-handler src/main.py + # - name: Install dependencies & build executable + # run: | + # set -euo pipefail + # export PATH="$HOME/.local/bin:$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" + # poetry env use 3.12.11 || true + # poetry install + # poetry run pyinstaller --onefile --icon=icon_media/robot_files_256.png --name android-file-handler src/main.py - - name: Install fpm and package .rpm - run: | - set -euo pipefail - # install pinned fpm and ensure binary is in system bindir - gem install --no-document -v "${FPM_VERSION}" fpm --bindir /usr/local/bin - echo "/usr/local/bin" >> $GITHUB_PATH + # - name: Install fpm and package .rpm + # run: | + # set -euo pipefail + # # install pinned fpm and ensure binary is in system bindir + # gem install --no-document -v "${FPM_VERSION}" fpm --bindir /usr/local/bin + # echo "/usr/local/bin" >> $GITHUB_PATH - # Build rpm with explicit filename - VERSION="$(poetry version -s)" - mkdir -p dist - chmod +x dist/android-file-handler - fpm -s dir -t rpm -n android-file-handler -v "$VERSION" --architecture x86_64 --prefix /usr/local/bin -p "dist/android-file-handler-${VERSION}-1.x86_64.rpm" dist/android-file-handler + # # Build rpm with explicit filename + # VERSION="$(poetry version -s)" + # mkdir -p dist + # chmod +x dist/android-file-handler + # fpm -s dir -t rpm -n android-file-handler -v "$VERSION" --architecture x86_64 --prefix /usr/local/bin -p "dist/android-file-handler-${VERSION}-1.x86_64.rpm" dist/android-file-handler - - name: Upload Rocky RPM - uses: actions/upload-artifact@v4 - with: - name: rocky-package - path: dist/*.rpm + # - name: Upload Rocky RPM + # uses: actions/upload-artifact@v4 + # with: + # name: rocky-package + # path: dist/*.rpm - create-release: - needs: [build-windows, build-debian, build-arch, build-rocky] - runs-on: ubuntu-latest - steps: - - name: Download all artifacts - uses: actions/download-artifact@v4 - with: - merge-multiple: true - path: ./binaries + # create-release: + # needs: [build-windows, build-debian, build-arch, build-rocky] + # runs-on: ubuntu-latest + # steps: + # - name: Download all artifacts + # uses: actions/download-artifact@v4 + # with: + # merge-multiple: true + # path: ./binaries - - name: List downloaded binaries (debug) - run: | - echo "Downloaded files:" - ls -la ./binaries || true + # - name: List downloaded binaries (debug) + # run: | + # echo "Downloaded files:" + # ls -la ./binaries || true - - name: Create Release - uses: softprops/action-gh-release@v1 - with: - files: | - ./binaries/android-file-handler.exe - ./binaries/android-file-handler_*.deb - ./binaries/android-file-handler-*.rpm - ./binaries/android-file-handler-*-x86_64.pkg.tar.* - draft: false - prerelease: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + # - name: Create Release + # uses: softprops/action-gh-release@v1 + # with: + # files: | + # ./binaries/android-file-handler.exe + # ./binaries/android-file-handler_*.deb + # ./binaries/android-file-handler-*.rpm + # ./binaries/android-file-handler-*-x86_64.pkg.tar.* + # draft: false + # prerelease: false + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file -- 2.47.3 From d8a7096e9059f0dccb3f1a627edbbe741b81c89c Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 18:27:35 -0500 Subject: [PATCH 29/33] uncommented releases --- .github/workflows/simple-release.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index cbec090..b9c535b 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -315,15 +315,15 @@ jobs: # echo "Downloaded files:" # ls -la ./binaries || true - # - name: Create Release - # uses: softprops/action-gh-release@v1 - # with: - # files: | - # ./binaries/android-file-handler.exe - # ./binaries/android-file-handler_*.deb - # ./binaries/android-file-handler-*.rpm - # ./binaries/android-file-handler-*-x86_64.pkg.tar.* - # draft: false - # prerelease: false - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + files: | + ./binaries/android-file-handler.exe + ./binaries/android-file-handler_*.deb + ./binaries/android-file-handler-*.rpm + ./binaries/android-file-handler-*-x86_64.pkg.tar.* + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file -- 2.47.3 From f1b69d6fb51dae93a2163f1501a54b60ea7c5b50 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 18:31:30 -0500 Subject: [PATCH 30/33] fixed release step --- .github/workflows/simple-release.yml | 65 ++++++++++++++-------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index b9c535b..c3fecd5 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -170,13 +170,42 @@ jobs: chmod +x dist/android-file-handler # explicit filename into dist/ fpm -s dir -t pacman -n android-file-handler -v "$VERSION" --architecture x86_64 --prefix /usr/local/bin -p "dist/android-file-handler-${VERSION}-1-x86_64.pkg.tar.zst" dist/android-file-handler + + - name: Upload Arch package + uses: actions/upload-artifact@v4 + with: + name: arch-package + path: dist/*.pkg.tar.* - - name: Upload Arch package - uses: actions/upload-artifact@v4 + + + create-release: + needs: [build-windows, build-debian, build-arch, build-rocky] + runs-on: ubuntu-latest + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 with: - name: arch-package - path: dist/*.pkg.tar.* + merge-multiple: true + path: ./binaries + - name: List downloaded binaries (debug) + run: | + echo "Downloaded files:" + ls -la ./binaries || true + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + files: | + ./binaries/android-file-handler.exe + ./binaries/android-file-handler_*.deb + ./binaries/android-file-handler-*.rpm + ./binaries/android-file-handler-*-x86_64.pkg.tar.* + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # build-rocky: # runs-on: ubuntu-latest # container: @@ -299,31 +328,3 @@ jobs: # with: # name: rocky-package # path: dist/*.rpm - - # create-release: - # needs: [build-windows, build-debian, build-arch, build-rocky] - # runs-on: ubuntu-latest - # steps: - # - name: Download all artifacts - # uses: actions/download-artifact@v4 - # with: - # merge-multiple: true - # path: ./binaries - - # - name: List downloaded binaries (debug) - # run: | - # echo "Downloaded files:" - # ls -la ./binaries || true - - - name: Create Release - uses: softprops/action-gh-release@v1 - with: - files: | - ./binaries/android-file-handler.exe - ./binaries/android-file-handler_*.deb - ./binaries/android-file-handler-*.rpm - ./binaries/android-file-handler-*-x86_64.pkg.tar.* - draft: false - prerelease: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file -- 2.47.3 From d8c4282cdff1c7157dda2b807b9bfda00a6e2fa0 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 18:32:52 -0500 Subject: [PATCH 31/33] fixed release step 1 --- .github/workflows/simple-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index c3fecd5..00b87a5 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -180,7 +180,7 @@ jobs: create-release: - needs: [build-windows, build-debian, build-arch, build-rocky] + needs: [build-windows, build-debian, build-arch] runs-on: ubuntu-latest steps: - name: Download all artifacts @@ -205,7 +205,7 @@ jobs: prerelease: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + # build-rocky: # runs-on: ubuntu-latest # container: -- 2.47.3 From 55b41d8a69c259ed0a2b752e4443bfd233dad805 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 18:41:36 -0500 Subject: [PATCH 32/33] fixed formatting --- .github/workflows/simple-release.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 00b87a5..6917fc7 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -170,12 +170,12 @@ jobs: chmod +x dist/android-file-handler # explicit filename into dist/ fpm -s dir -t pacman -n android-file-handler -v "$VERSION" --architecture x86_64 --prefix /usr/local/bin -p "dist/android-file-handler-${VERSION}-1-x86_64.pkg.tar.zst" dist/android-file-handler - - - name: Upload Arch package - uses: actions/upload-artifact@v4 - with: - name: arch-package - path: dist/*.pkg.tar.* + + - name: Upload Arch package + uses: actions/upload-artifact@v4 + with: + name: arch-package + path: dist/*.pkg.tar.* -- 2.47.3 From f0353d9e924d83d13b9c0b3ad5a7c9db5cad8f01 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 25 Aug 2025 18:50:28 -0500 Subject: [PATCH 33/33] added tags and version name to release step --- .github/workflows/simple-release.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 6917fc7..b46473f 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -183,6 +183,16 @@ jobs: needs: [build-windows, build-debian, build-arch] runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Poetry + uses: snok/install-poetry@v1 + + - name: Get version + id: version + run: echo "version=$(poetry version -s)" >> $GITHUB_OUTPUT + - name: Download all artifacts uses: actions/download-artifact@v4 with: @@ -196,6 +206,8 @@ jobs: - name: Create Release uses: softprops/action-gh-release@v1 with: + tag_name: v${{ steps.version.outputs.version }} + name: Release v${{ steps.version.outputs.version }} files: | ./binaries/android-file-handler.exe ./binaries/android-file-handler_*.deb -- 2.47.3