From 08372d972ca328c65412378ed7086a9ec1338511 Mon Sep 17 00:00:00 2001 From: Toby Date: Sun, 3 Sep 2023 15:09:55 -0700 Subject: [PATCH] ci: hyperbole should import requests only when needed --- .github/workflows/master.yml | 1 - .github/workflows/release.yml | 2 +- hyperbole.py | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 322ca9b..76d4564 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -29,7 +29,6 @@ jobs: - name: Run build script run: | - pip install requests export HY_APP_PLATFORMS=$(sed 's/\r$//' platforms.txt | awk '!/^#/ && !/^$/' | paste -sd ",") python hyperbole.py build -r diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 42855a7..45f0e81 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,6 @@ jobs: - name: Run build script run: | - pip install requests export HY_APP_PLATFORMS=$(sed 's/\r$//' platforms.txt | awk '!/^#/ && !/^$/' | paste -sd ",") python hyperbole.py build -r @@ -46,4 +45,5 @@ jobs: - name: Publish to API run: | export HY_API_POST_KEY=${{ secrets.HY2_API_POST_KEY }} + pip install requests python hyperbole.py publish diff --git a/hyperbole.py b/hyperbole.py index 5ab47d2..5846127 100755 --- a/hyperbole.py +++ b/hyperbole.py @@ -8,7 +8,6 @@ import sys import subprocess import datetime import shutil -import requests # Hyperbole is the official build script for Hysteria. # Available environment variables for controlling the build: @@ -348,6 +347,8 @@ def cmd_test(module=None): def cmd_publish(urgent=False): + import requests + if not check_build_env(): return