Skip to content

Commit 0c7810f

Browse files
committed
[#devel] fixing publishing yml
1 parent d2034b4 commit 0c7810f

File tree

3 files changed

+59
-38
lines changed

3 files changed

+59
-38
lines changed
Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish pip bdist to PyPI - linux
1+
name: uv publish bdist to PyPI
22

33
on:
44
release:
@@ -11,24 +11,44 @@ on:
1111

1212
jobs:
1313
pypi:
14-
name: Publish sdist to Pypi
15-
runs-on: ubuntu-latest
14+
name: Publish bdist to Pypi
1615

1716
strategy:
1817
fail-fast: false
1918
matrix:
20-
os: [ubuntu-latest, windows-latest, macOS-latest]
21-
python-version: ['3.8', '3.9', '3.10', '3.11']
22-
exclude:
23-
- python-version: ['3.11']
24-
os: windows-latest
19+
os: [ubuntu-latest] # windows-latest, macOS-latest]
20+
python-version: ['3.9', '3.10', '3.11']
21+
#exclude:
22+
#- python-version: ['3.11']
23+
#os: windows-latest
2524

25+
runs-on: ${{ matrix.os }}
2626

2727
steps:
28-
- name: Set up Python ${{ matrix.python-version }}
29-
uses: actions/checkout@v4
30-
- uses: astral-sh/setup-uv@v5
28+
29+
# git checkout
30+
- name: git checkout
31+
uses: actions/checkout@v5
3132
with:
32-
python-version: ${{ matrix.python-version }}
33-
- run: uv build
34-
- run: uv publish -t ${{ secrets.PYPI_API_TOKEN }}
33+
# https://github.com/marketplace/actions/checkout#usage
34+
fetch-depth: 0 # to fetch all history from all branches
35+
fetch-tags: true
36+
37+
# Install uv
38+
- name: Install uv
39+
uses: astral-sh/setup-uv@v5
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
43+
# Build dist
44+
- name: Build the project
45+
run: |
46+
rm dist/*
47+
uv build
48+
rm dist/*.tar.gz
49+
50+
- name: Publish bdist to PyPI
51+
env:
52+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
53+
run: |
54+
uv publish
Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish pip sdist to PyPI
1+
name: uv publish sdist to PyPI
22

33
on:
44
release:
@@ -15,28 +15,29 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- uses: actions/checkout@v2
19-
- name: Set up Python
20-
uses: actions/setup-python@v2
18+
19+
# git checkout
20+
- name: git checkout
21+
uses: actions/checkout@v5
2122
with:
22-
python-version: '3.9'
23-
- name: Display python version
24-
run: |
25-
python -c "import sys; print(sys.version)"
26-
- name: Install dependencies
27-
run: |
28-
pip install --upgrade pip
29-
pip install setuptools wheel twine
30-
pip install -r requirements.txt
31-
- name: check ref and event
32-
run: |
33-
echo ${{github.ref}}
34-
- name: Build sdist
23+
# https://github.com/marketplace/actions/checkout#usage
24+
fetch-depth: 0 # to fetch all history from all branches
25+
fetch-tags: true
26+
27+
# Install uv
28+
- name: Install uv
29+
uses: astral-sh/setup-uv@v5
30+
with:
31+
python-version: 3.11
32+
33+
# Build dist
34+
- name: Build the project
3535
run: |
36-
python setup.py sdist
37-
- name: Publish source to PyPI
36+
uv build
37+
rm dist/*whl
38+
39+
- name: Publish sdist to PyPI
3840
env:
39-
TWINE_USERNAME: __token__
40-
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
41+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
4142
run: |
42-
twine upload dist/*.tar.gz
43+
uv publish

.github/workflows/test-complete-matrix.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ on:
1313
jobs:
1414
build:
1515

16-
runs-on: ${{ matrix.os }}
17-
1816
strategy:
1917
matrix:
2018
os: [ubuntu-latest]
@@ -25,6 +23,8 @@ jobs:
2523
- python-version: ['3.11']
2624
os: windows-latest
2725

26+
runs-on: ${{ matrix.os }}
27+
2828
steps:
2929

3030
# Install latex

0 commit comments

Comments
 (0)