-
Notifications
You must be signed in to change notification settings - Fork 45
35 lines (31 loc) · 973 Bytes
/
publish.yml
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
name: Python Package
on:
release:
types: [published]
jobs:
deploy:
name: Deploy Package
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.5.x"
enable-cache: true
- name: Verify version matches in code and release
run: |
VER=$(uv run python -c 'import bcpandas; print(bcpandas.__version__)')
CLEAN_RELEASE_VAR=${RELEASE_VAR#v}
if [[ $VER != $CLEAN_RELEASE_VAR ]]; then
echo "version $VER does not match released version $CLEAN_RELEASE_VAR, needs a bump!" && exit 1
fi
env:
RELEASE_VAR: ${{ github.event.release.tag_name }}
- name: Build and publish
run: |
uv build
uv publish \
--username "${{ secrets.PYPI_USERNAME }}" \
--password "${{ secrets.PYPI_PASSWORD }}"