-
Notifications
You must be signed in to change notification settings - Fork 7
96 lines (83 loc) · 2.33 KB
/
wheel.yaml
File metadata and controls
96 lines (83 loc) · 2.33 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: wheel
on:
push:
tags:
- '*'
pull_request:
branches: [ main ]
release:
types: [published]
jobs:
wheel_build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v7
with:
activate-environment: true
version: "latest"
python-version: ${{ matrix.python }}
- name: build wheel
run: uv build
- name: upload wheel
uses: actions/upload-artifact@v7
with:
name: wheel-and-sdist
path: dist/
wheel_test:
runs-on: ${{ matrix.os }}
needs: ['wheel_build']
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- name: download wheel
uses: actions/download-artifact@v6.0.0
with:
name: wheel-and-sdist
path: dist/
- name: setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: install
run: pip install dist/demes-*.whl
- name: test
run: |
python -c "import demes"
demes --version
demes ms -N0 1 -I 2 0 0 0.1 -es 1 1 0.99 -ej 1 3 2 -ej 100 2 1 \
| demes parse -j - \
| demes parse -s - \
| demes parse --ms 1 -
pypi_upload:
runs-on: ubuntu-24.04
needs: ['wheel_test']
steps:
- name: download wheel
uses: actions/download-artifact@v6.0.0
with:
name: wheel-and-sdist
path: dist/
- name: publish to test.pypi.org
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: publish to PyPI
if: github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}