Skip to content

Commit c0b13f5

Browse files
authored
Merge pull request #222 from ToFuProject/Issue221_Deploy
[#221] New publishing github actions
2 parents a15b3bb + a3161f0 commit c0b13f5

File tree

2 files changed

+43
-5
lines changed

2 files changed

+43
-5
lines changed

.github/workflows/python-publish.yml renamed to .github/workflows/python-publish-sdist.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ jobs:
2626
- uses: astral-sh/setup-uv@v5
2727
with:
2828
python-version: '3.11'
29-
- run: uv build
29+
- run: uv build --sdist
3030
# Check that basic features work and we didn't miss to include crucial files
31-
- name: import test (wheel)
32-
run: uv run --isolated --no-project -p 3.11 --with dist/*.whl datastock/tests/prepublish.py
33-
- name: import test (source distribution)
31+
- name: import test (sdist)
3432
run: uv run --isolated --no-project -p 3.11 --with dist/*.tar.gz datastock/tests/prepublish.py
35-
- run: uv publish -t ${{ secrets.PYPI_API_TOKEN }}
33+
- name: publish
34+
run: uv publish -t ${{ secrets.PYPI_API_TOKEN }}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package wheels
10+
11+
on:
12+
push:
13+
tags:
14+
- '*'
15+
branches:
16+
- main
17+
release:
18+
types: [created]
19+
20+
jobs:
21+
pypi:
22+
name: Publish wheel to Pypi
23+
strategy:
24+
fail-fast: true
25+
matrix:
26+
os: [ubuntu-latest, windows-latest, macos-latest]
27+
python-version: ["3.8", "3.9", "3.10", "3.11"]
28+
runs-on: ${{ matrix.os }}
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: astral-sh/setup-uv@v5
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
- run: uv build --wheel
35+
# Check that basic features work and we didn't miss to include crucial files
36+
- name: import test (wheel)
37+
run: uv run --isolated --no-project -p ${{ matrix.python-version }} --with dist/*.whl datastock/tests/prepublish.py
38+
- name: publish
39+
run: uv publish -t ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)