-
Notifications
You must be signed in to change notification settings - Fork 3
100 lines (88 loc) · 2.44 KB
/
prerelease.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
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
97
98
99
100
name: Pre-release TypedUnits
on:
push:
branches:
- main
permissions:
contents: read
jobs:
create_version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Create version
run: |
mkdir version
echo "$(python _version.py).dev$(date '+%Y%m%d%H%M%S')" > version/version.txt
cat version/version.txt
- uses: actions/upload-artifact@master
with:
name: version-file
path: version
build_wheels:
runs-on: ${{ matrix.os }}
needs: [create_version]
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
arch: x86_64
- os: windows-latest
arch: auto
- os: macos-latest
arch: auto
- os: macos-13
arch: auto
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build cibuildwheel
- uses: actions/download-artifact@master
with:
name: version-file
path: version
- name: Build package
env:
CIBW_BUILD: "cp310* cp311* cp312*"
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_SKIP: "*musllinux*"
run: |
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
name: python-wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
release-wheels:
name: Publish all wheels
needs: [build_wheels]
runs-on: ubuntu-latest
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
pattern: python-wheels-*
merge-multiple: true
path: wheelhouse/
- name: Publish package to testpypi
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
repository_url: https://test.pypi.org/legacy/
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
packages_dir: wheelhouse/
- name: Publish package to pypi
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: wheelhouse/