-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (46 loc) · 1.9 KB
/
Copy pathUVBuild.yml
File metadata and controls
54 lines (46 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: ⚡Build (UV)
on:
workflow_dispatch:
workflow_call:
jobs:
build:
name: ⚡ Build (UV)
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
pull-requests: write
steps:
- name: 📥 Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for git history checks if needed
- name: 🐍 Set up Python & UV
uses: actions/setup-python@v5
with:
python-version: '3.14' # Or make this an input/matrix variable
# cache: 'uv' # Cache UV dependencies - Removed, not supported yet
- name: ⬇️ Install uv
run: pip install uv
- name: 🛠️ Install dependencies
run: uv sync --all-extras # Install main and optional/dev dependencies
- name: 🛠️ Build package
run: uv build
- name: 🪪 Identify
# Keep this section if you need to commit changes like requirements updates
if: github.event_name == 'pull_request'
run: |
git config --global user.email "action@github.com"
git config --global user.name "${GITHUB_ACTOR}"
- name: 🛠️ Update requirements (Optional, if still needed)
# UV uses uv.lock primarily. Exporting requirements.txt might be optional.
# If you still need requirements.txt for some reason:
if: github.event_name == 'pull_request'
run: |
uv lock # Ensure lock file is up-to-date
mkdir -p .requirements # Create directory if it doesn't exist
uv export --format requirements.txt --output-file .requirements/requirements.txt
# Consider if you want to export extras: --all-extras or --extras <group>
git add pyproject.toml uv.lock .requirements/requirements.txt
# Commit if there are changes
git diff --staged --quiet || git commit -m "⬆️ Update Dependencies (uv)"