mirror of
https://github.com/morpheus65535/bazarr
synced 2025-02-22 22:10:42 +00:00
feat(ci): Build and release python sdist and wheel using uv
Signed-off-by: txtsd <code@ihavea.quest>
This commit is contained in:
parent
141c13b34d
commit
40f7832bf7
8 changed files with 51 additions and 32 deletions
3
.github/files_to_copy
vendored
3
.github/files_to_copy
vendored
|
@ -1,8 +1,5 @@
|
|||
bazarr
|
||||
custom_libs
|
||||
frontend/build
|
||||
libs
|
||||
bazarr.py
|
||||
requirements.txt
|
||||
postgres-requirements.txt
|
||||
migrations
|
||||
|
|
5
.github/scripts/create_asset.sh
vendored
5
.github/scripts/create_asset.sh
vendored
|
@ -25,4 +25,7 @@ cp VERSION $to_dist
|
|||
pushd __builds__/bazarr
|
||||
zip -r ../bazarr.zip . -b "$(mktemp -d)"
|
||||
popd
|
||||
rm -rf $to_dist
|
||||
rm -rf $to_dist
|
||||
|
||||
uv build
|
||||
cp --parents dist/bazarr-* __builds__
|
||||
|
|
43
.github/workflows/ci.yml
vendored
43
.github/workflows/ci.yml
vendored
|
@ -6,11 +6,11 @@ on:
|
|||
paths:
|
||||
- frontend/**
|
||||
- bazarr/**
|
||||
- libs/**
|
||||
- migrations/**
|
||||
- bazarr.py
|
||||
- requirements.txt
|
||||
- dev-requirements.txt
|
||||
- pyproject.toml
|
||||
- uv.lock
|
||||
- .python-version
|
||||
- .github/workflows/ci.yml
|
||||
pull_request:
|
||||
branches: [development]
|
||||
|
@ -75,10 +75,33 @@ jobs:
|
|||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python 3.8
|
||||
uses: actions/setup-python@v5
|
||||
- name: Cache node_modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
python-version: "3.8"
|
||||
path: "${{ env.UI_DIRECTORY }}/node_modules"
|
||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: ${{ runner.os }}-modules-
|
||||
|
||||
- name: Setup NodeJS
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: "${{ env.UI_DIRECTORY }}/.nvmrc"
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v3
|
||||
with:
|
||||
version: "0.4.25" # Best practice: pin uv version
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "uv.lock"
|
||||
|
||||
- name: Set up Python
|
||||
run: uv python install python3.8
|
||||
|
||||
- name: Install the project
|
||||
run: uv sync --all-extras --dev
|
||||
|
||||
- name: Remove non-development frontend build
|
||||
run: rm -rf "${{ env.UI_DIRECTORY }}/build"
|
||||
|
||||
- name: Install UI
|
||||
uses: actions/download-artifact@v4
|
||||
|
@ -86,12 +109,9 @@ jobs:
|
|||
name: ${{ env.UI_ARTIFACT_NAME }}
|
||||
path: "${{ env.UI_DIRECTORY }}/build"
|
||||
|
||||
- name: Install Python dependencies
|
||||
run: pip install -r requirements.txt
|
||||
|
||||
- name: Unit Tests
|
||||
run: |
|
||||
python3 bazarr.py --no-update &
|
||||
uv run -- bazarr.py --no-update &
|
||||
PID=$!
|
||||
sleep 15
|
||||
if kill -s 0 $PID
|
||||
|
@ -103,3 +123,6 @@ jobs:
|
|||
echo "**** Bazarr launch failed ****"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Minimize uv cache
|
||||
run: uv cache prune --ci
|
||||
|
|
13
.github/workflows/release_dev_to_master.yaml
vendored
13
.github/workflows/release_dev_to_master.yaml
vendored
|
@ -42,6 +42,19 @@ jobs:
|
|||
with:
|
||||
node-version-file: "${{ env.UI_DIRECTORY }}/.nvmrc"
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v3
|
||||
with:
|
||||
version: "0.4.25" # Best practice: pin uv version
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "uv.lock"
|
||||
|
||||
- name: Set up Python
|
||||
run: uv python install python3.8
|
||||
|
||||
- name: Install the project
|
||||
run: uv sync --all-extras --dev
|
||||
|
||||
- name: Install Global Tools
|
||||
run: npm install -g release-it auto-changelog
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"github": {
|
||||
"release": true,
|
||||
"releaseName": "v${version}",
|
||||
"assets": ["__builds__/*.zip"]
|
||||
"assets": ["__builds__/*.zip", "__builds__/*.tar.gz", "__builds__/*.whl"]
|
||||
},
|
||||
"npm": {
|
||||
"publish": false,
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
sympy
|
||||
vcrpy>=1.6.1
|
||||
pytest
|
||||
pytest-pep8
|
||||
pytest-flakes
|
||||
pytest-cov
|
||||
pytest-vcr
|
||||
pytest-mock
|
||||
requests-mock
|
||||
setuptools
|
|
@ -1 +0,0 @@
|
|||
psycopg2-binary>=2.9.5
|
|
@ -1,6 +0,0 @@
|
|||
setuptools
|
||||
lxml>=4.3.0, <5.0.0
|
||||
numpy>=1.12.0
|
||||
webrtcvad-wheels>=2.0.10
|
||||
Pillow>=9.0.0 --only-binary=Pillow
|
||||
pywin32; platform_system == "Windows"
|
Loading…
Reference in a new issue