Use Python for dependency cutoff date calculation
Some checks failed
Quarantined Dependency Upgrade / upgrade-dependencies (push) Has been cancelled
Build and test GAM / build (false, build, 1, Build Intel Ubuntu Jammy, ubuntu-22.04) (push) Has been cancelled
Build and test GAM / build (false, build, 10, Build x86_64 macOS 15, macos-15-intel) (push) Has been cancelled
Build and test GAM / build (false, build, 11, Build x86_64 macOS 26, macos-26-intel) (push) Has been cancelled
Build and test GAM / build (false, build, 12, Build Arm MacOS 26, macos-26) (push) Has been cancelled
Build and test GAM / build (false, build, 13, Build Intel Windows, windows-2025-vs2026) (push) Has been cancelled
Build and test GAM / build (false, build, 14, Build Arm Windows, windows-11-arm) (push) Has been cancelled
Build and test GAM / build (false, build, 2, Build Intel Ubuntu Noble, ubuntu-24.04) (push) Has been cancelled
Build and test GAM / build (false, build, 3, Build Arm Ubuntu Noble, ubuntu-24.04-arm) (push) Has been cancelled
Build and test GAM / build (false, build, 4, Build Arm Ubuntu Jammy, ubuntu-22.04-arm) (push) Has been cancelled
Build and test GAM / build (false, build, 5, Build Intel StaticX Legacy, ubuntu-22.04, yes) (push) Has been cancelled
Build and test GAM / build (false, build, 6, Build Arm StaticX Legacy, ubuntu-22.04-arm, yes) (push) Has been cancelled
Build and test GAM / build (false, build, 8, Build Arm MacOS 14, macos-14) (push) Has been cancelled
Build and test GAM / build (false, build, 9, Build Arm MacOS 15, macos-15) (push) Has been cancelled
Build and test GAM / build (false, test, 15, Test Python 3.10, ubuntu-24.04, 3.10) (push) Has been cancelled
Build and test GAM / build (false, test, 16, Test Python 3.11, ubuntu-24.04, 3.11) (push) Has been cancelled
Build and test GAM / build (false, test, 17, Test Python 3.12, ubuntu-24.04, 3.12) (push) Has been cancelled
Build and test GAM / build (false, test, 18, Test Python 3.13, ubuntu-24.04, 3.13) (push) Has been cancelled
Build and test GAM / build (false, test, 19, Test Python 3.15-dev, ubuntu-24.04, 3.15-dev) (push) Has been cancelled
Build and test GAM / build (true, test, 20, Test Python 3.14 freethread, ubuntu-24.04, 3.14) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Build and test GAM / publish (push) Has been cancelled
Check for Google Root CA Updates / check-certs (push) Has been cancelled

Replaced hardcoded date calculation with a Python script to determine the cutoff date for dependencies. This change improves compatibility across different operating systems.
This commit is contained in:
Jay Lee
2026-05-08 16:15:35 -04:00
committed by GitHub
parent 9e6122769a
commit 523bd45fa0

View File

@@ -200,6 +200,9 @@ jobs:
echo "arch=${RUNNER_ARCH}" >> $GITHUB_ENV
;;
esac
# calculate with python because date on MacOS is just stupid
DEPS_CUTOFF=$(python3 -c "from datetime import datetime, timedelta, timezone; print((datetime.now(timezone.utc) - timedelta(days=14)).strftime('%Y-%m-%dT00:00:00Z'))")
echo "DEPS_CUTOFF=${DEPS_CUTOFF}" >> $GITHUB_ENV
echo "JID=${JID}" >> $GITHUB_ENV
echo "freethreaded=${freethreaded}" >> $GITHUB_ENV
if "$freethreaded"; then
@@ -513,11 +516,10 @@ jobs:
"$PYTHON" get-pip.py
"$PYTHON" -m venv .venv
"$PYTHON" -m pip install uv
CUTOFF=$(date -d '14 days ago' +%Y-%m-%dT00:00:00Z)
if [[ "$RUNNER_OS" == "Windows" ]]; then
# pyscard seems to build outside venv but not in it.
# build it so it's cached.
"$PYTHON" -m uv pip install --upgrade pyscard --exclude-newer "$CUTOFF"
"$PYTHON" -m uv pip install --upgrade pyscard --exclude-newer "$DEPS_CUTOFF"
export PYTHON="${GITHUB_WORKSPACE}/.venv/scripts/python.exe"
else
export PYTHON="${GITHUB_WORKSPACE}/.venv/bin/python3"
@@ -561,8 +563,7 @@ jobs:
run: |
# Install latest version of PyInstaller *that's 2 weeks old*
# Calculate the exact timestamp for 14 days ago
CUTOFF=$(date -d '14 days ago' +%Y-%m-%dT00:00:00Z)
"$PYTHON" -m uv pip install --upgrade pyinstaller --exclude-newer "$CUTOFF"
"$PYTHON" -m uv pip install --upgrade pyinstaller --exclude-newer "$DEPS_CUTOFF"
- name: Build GAM with PyInstaller
if: matrix.goal != 'test'
@@ -628,10 +629,9 @@ jobs:
sudo apt-get -qq --yes update
# arm64 needs to build a wheel and needs scons to build
sudo apt-get -qq --yes install scons
CUTOFF=$(date -d '14 days ago' +%Y-%m-%dT00:00:00Z)
"$PYTHON" -m uv pip install --upgrade patchelf-wrapper --exclude-newer "$CUTOFF"
"$PYTHON" -m uv pip install --upgrade typing_extensions --exclude-newer "$CUTOFF"
"$PYTHON" -m uv pip install --upgrade staticx --exclude-newer "$CUTOFF"
"$PYTHON" -m uv pip install --upgrade patchelf-wrapper --exclude-newer "$DEPS_CUTOFF"
"$PYTHON" -m uv pip install --upgrade typing_extensions --exclude-newer "$DEPS_CUTOFF"
"$PYTHON" -m uv pip install --upgrade staticx --exclude-newer "$DEPS_CUTOFF"
- name: Make StaticX GAM build
if: matrix.staticx == 'yes'