Spaces:
Paused
Paused
Mirrowel
commited on
Commit
·
54cc4c2
1
Parent(s):
2b065a1
ci(build): 🎡 migrate build workflow to use uv for Python setup and dependency management
Browse files- replace actions/setup-python with astral-sh/setup-uv and enable uv cache for requirements.txt
- use `uv` to install Python 3.12, create venv, and run `uv pip` for dependency installs; activate the venv before installs
- remove pip cache discovery and actions/cache usage for pip in favor of uv-managed venv/cache
- switch PyInstaller cache step from PowerShell to bash and normalize cache path outputs to use $GITHUB_OUTPUT
- .github/workflows/build.yml +19 -26
.github/workflows/build.yml
CHANGED
|
@@ -29,45 +29,38 @@ jobs:
|
|
| 29 |
- name: Check out repository
|
| 30 |
uses: actions/checkout@v4
|
| 31 |
|
| 32 |
-
- name: Set up
|
| 33 |
-
|
| 34 |
-
uses: actions/setup-python@v5
|
| 35 |
with:
|
| 36 |
-
|
|
|
|
| 37 |
|
| 38 |
-
- name:
|
| 39 |
-
id: pip-cache
|
| 40 |
shell: bash
|
| 41 |
run: |
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
- name: Cache pip dependencies
|
| 45 |
-
uses: actions/cache@v4
|
| 46 |
-
with:
|
| 47 |
-
path: ${{ steps.pip-cache.outputs.dir }}
|
| 48 |
-
key: ${{ runner.os }}-pip-3.12-${{ hashFiles('requirements.txt') }}
|
| 49 |
-
restore-keys: |
|
| 50 |
-
${{ runner.os }}-pip-3.12
|
| 51 |
|
| 52 |
- name: Install dependencies
|
| 53 |
shell: bash
|
| 54 |
run: |
|
| 55 |
grep -v -- '-e src/rotator_library' requirements.txt > temp_requirements.txt
|
| 56 |
-
|
| 57 |
-
pip install
|
| 58 |
-
pip install
|
|
|
|
| 59 |
|
| 60 |
- name: Get PyInstaller cache directory
|
| 61 |
id: pyinstaller-cache-dir
|
| 62 |
-
shell:
|
| 63 |
run: |
|
| 64 |
-
if
|
| 65 |
-
echo "path=$
|
| 66 |
-
|
| 67 |
-
echo "path=$
|
| 68 |
-
|
| 69 |
-
echo "path=$
|
| 70 |
-
|
| 71 |
|
| 72 |
- name: Cache PyInstaller build data
|
| 73 |
uses: actions/cache@v4
|
|
|
|
| 29 |
- name: Check out repository
|
| 30 |
uses: actions/checkout@v4
|
| 31 |
|
| 32 |
+
- name: Set up uv
|
| 33 |
+
uses: astral-sh/setup-uv@v4
|
|
|
|
| 34 |
with:
|
| 35 |
+
enable-cache: true
|
| 36 |
+
cache-dependency-glob: "requirements.txt"
|
| 37 |
|
| 38 |
+
- name: Set up Python with uv
|
|
|
|
| 39 |
shell: bash
|
| 40 |
run: |
|
| 41 |
+
uv python install 3.12
|
| 42 |
+
uv venv --python 3.12
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
- name: Install dependencies
|
| 45 |
shell: bash
|
| 46 |
run: |
|
| 47 |
grep -v -- '-e src/rotator_library' requirements.txt > temp_requirements.txt
|
| 48 |
+
source .venv/bin/activate || . .venv/Scripts/activate
|
| 49 |
+
uv pip install -r temp_requirements.txt
|
| 50 |
+
uv pip install pyinstaller
|
| 51 |
+
uv pip install -e src/rotator_library
|
| 52 |
|
| 53 |
- name: Get PyInstaller cache directory
|
| 54 |
id: pyinstaller-cache-dir
|
| 55 |
+
shell: bash
|
| 56 |
run: |
|
| 57 |
+
if [ "${{ runner.os }}" == "Windows" ]; then
|
| 58 |
+
echo "path=$USERPROFILE/AppData/Local/pyinstaller" >> $GITHUB_OUTPUT
|
| 59 |
+
elif [ "${{ runner.os }}" == "Linux" ]; then
|
| 60 |
+
echo "path=$HOME/.cache/pyinstaller" >> $GITHUB_OUTPUT
|
| 61 |
+
elif [ "${{ runner.os }}" == "macOS" ]; then
|
| 62 |
+
echo "path=$HOME/Library/Application Support/pyinstaller" >> $GITHUB_OUTPUT
|
| 63 |
+
fi
|
| 64 |
|
| 65 |
- name: Cache PyInstaller build data
|
| 66 |
uses: actions/cache@v4
|