Skip to content

Commit f1c325d

Browse files
committed
Add workflow step to up create sdist for PyPI
Updated recipes with url that should be used once sdist uploaded to PyPI
1 parent 83319be commit f1c325d

File tree

3 files changed

+40
-5
lines changed

3 files changed

+40
-5
lines changed

.github/workflows/main.yml

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,30 @@ jobs:
8686
- run: |
8787
pytest -sv tests
8888
89+
build_sdist:
90+
name: Build sdist
91+
runs-on: ubuntu-latest
92+
steps:
93+
- name: Checkout sources
94+
uses: actions/checkout@v5
95+
with:
96+
submodules: true
97+
98+
- name: Install Python
99+
uses: actions/setup-python@v6
100+
with:
101+
python-version: "3.11"
102+
103+
- name: Install pypa/build
104+
run: python -m pip install build
105+
- name: Build a binary wheel and a source tarball
106+
run: python -m build --sdist
107+
- name: Upload artifacts
108+
uses: actions/upload-artifact@v4
109+
with:
110+
name: sdist
111+
path: dist/*.tar.gz
112+
89113
build_wheels:
90114
name: Build wheels on ${{matrix.arch}} for ${{ matrix.os }}
91115
runs-on: ${{ matrix.os }}
@@ -144,22 +168,29 @@ jobs:
144168
path: ./wheelhouse/*.whl
145169

146170
upload_wheels:
147-
name: Upload wheels to PyPI
148-
needs: build_wheels
171+
name: Upload wheels & sdist to PyPI
172+
needs: [build_sdist, build_wheels]
149173
runs-on: ubuntu-latest
150174
environment: pypi
151175
permissions:
152176
id-token: write
153177

154178
# Upload to PyPI on every tag starting with 'v'
155-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
179+
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
156180

157181
steps:
158182
- uses: actions/download-artifact@v4
159183
with:
160184
path: dist
161185
pattern: wheels-for-*
162186
merge-multiple: true
187+
- uses: actions/download-artifact@v4
188+
with:
189+
path: dist
190+
pattern: sdist
191+
merge-multiple: true
163192

164-
- name: Publish package distributions to PyPI
165-
uses: pypa/gh-action-pypi-publish@release/v1
193+
- name: Check downloaded artifacts
194+
run: ls dist
195+
# - name: Publish package distributions to PyPI
196+
# uses: pypa/gh-action-pypi-publish@release/v1

conda.recipe/recipe.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ package:
77
version: ${{ version }}
88

99
source:
10+
# url: https://pypi.io/packages/source/${{ name }}/${{ name }}/${{ name }}-v${{ version }}.tar.gz
11+
# sha256:
1012
path: ../
1113

1214
build:

recipe/meta.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ package:
99
version: {{ version }}
1010

1111
source:
12+
# url: https://pypi.io/packages/source/${{ name }}/${{ name }}/${{ name }}-v${{ version }}.tar.gz
13+
# sha256:
1214
path: ../
1315

1416
build:

0 commit comments

Comments
 (0)