@@ -17,9 +17,6 @@ permissions:
1717 contents : read
1818
1919jobs :
20- # --------------------------------------------------
21- # Job 1: Linting and Testing (Runs on push and PR)
22- # --------------------------------------------------
2320 # --------------------------------------------------
2421 # Job 1: Linting and Testing (Runs on push and PR)
2522 # --------------------------------------------------
@@ -35,38 +32,21 @@ jobs:
3532 - name : Set up Python
3633 uses : actions/setup-python@v5
3734 with :
38- python-version : ' 3.13' # Specify your desired Python version
35+ python-version : ' 3.13'
3936
40- # Install uv
4137 - name : Install uv
4238 uses : astral-sh/setup-uv@v5
4339
44- # Add uv to the PATH
45- - name : Add uv to PATH
46- run : echo "$HOME/.cargo/bin" >> $GITHUB_PATH
47- shell : bash
48- - name : Create virtual environment
49- run : uv venv
50- - name : Activate virtual environment
51- run : |
52- echo "PATH=$PATH:$PWD/.venv/bin" >> $GITHUB_PATH
53- echo "VIRTUAL_ENV=$PWD/.venv" >> $GITHUB_ENV
5440 - name : Install dependencies with uv
5541 run : |
56- # Install packages from requirements.txt and additional tools
57- uv pip install -r core_requirements.txt
58- uv pip install -r dev_requirements.txt
42+ uv sync --group dev
5943
6044 - name : Run pre-commit hooks
6145 uses : pre-commit/action@v3.0.1
62- # pre-commit might internally use pip/virtualenv, uv installation
63- # primarily affects the main dependency installation step.
6446
6547 - name : Run tests with coverage
6648 run : |
67- uv pip install pytest-cov
68-
69- uv run pytest --cov=sqlmodel_crud_utils --cov-report=xml --cov-report=term # Generate XML and terminal reports
49+ uv run pytest --cov=sqlmodel_crud_utils --cov-report=xml --cov-report=term
7050
7151 - name : Upload coverage report
7252 uses : actions/upload-artifact@v4
@@ -91,15 +71,13 @@ jobs:
9171 - name : Set up Python
9272 uses : actions/setup-python@v5
9373 with :
94- python-version : ' 3.11 ' # Match the version used for testing
74+ python-version : ' 3.13 '
9575
96- - name : Install build dependencies
97- run : |
98- python -m pip install --upgrade pip
99- pip install build
76+ - name : Install uv
77+ uses : astral-sh/setup-uv@v5
10078
10179 - name : Build source distribution and wheel
102- run : python -m build
80+ run : uv build
10381
10482 - name : Upload build artifacts
10583 uses : actions/upload-artifact@v4
@@ -140,13 +118,9 @@ jobs:
140118 with :
141119 tag_name : ${{ steps.get_version.outputs.TAG_NAME }}
142120 name : Release ${{ steps.get_version.outputs.TAG_NAME }}
143- # body: | # Optional: Add release notes here
144- # Release notes for version ${{ steps.get_version.outputs.TAG_NAME }}
145- # - Feature A
146- # - Bugfix B
147121 draft : false
148- prerelease : false # Set to true if it's a pre-release
149- files : dist/* # Upload all files from the dist directory
122+ prerelease : false
123+ files : dist/*
150124
151125 # --------------------------------------------------
152126 # Job 4: Publish to PyPI (Runs only on push to release/*)
@@ -157,9 +131,9 @@ jobs:
157131 # Only run this job on direct pushes to release/* branches
158132 if : github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/')
159133 runs-on : ubuntu-latest
160- environment : # Optional: Define environment for PyPI publishing rules/secrets
134+ environment :
161135 name : pypi
162- url : https://pypi.org/p/sqlmodel-crud-utils # Replace with your actual PyPI package URL
136+ url : https://pypi.org/p/sqlmodel-crud-utils
163137 permissions :
164138 id-token : write # Required for trusted publishing
165139 steps :
@@ -171,7 +145,6 @@ jobs:
171145
172146 - name : Publish package to PyPI
173147 uses : pypa/gh-action-pypi-publish@release/v1
174- # No need for secrets.PYPI_API_TOKEN if using trusted publishing
175148 with :
176149 user : __token__
177150 password : ${{ secrets.PYPI_API_TOKEN }}
0 commit comments