-
Notifications
You must be signed in to change notification settings - Fork 8
executable file
·89 lines (72 loc) · 2.16 KB
/
release.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
name: Release
on:
release:
types: [published]
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
os: [ubuntu-22.04]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Set CIBW_PLATFORM environment variable
run: |
if ${{ startsWith(matrix.os, 'ubuntu') }}; then
export CIBW_PLATFORM=linux
elif ${{ startsWith(matrix.os, 'windows') }}; then
export CIBW_PLATFORM=windows
else
export CIBW_PLATFORM=mac
fi
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse-${{ matrix.os }}
- uses: actions/upload-artifact@v3
with:
name: wheelhouse-${{ matrix.os }}
path: ./wheelhouse-${{ matrix.os }}/*.whl
build_sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Build sdist
run: |
python -m pip install -U pip build
python -m build --sdist
- uses: actions/upload-artifact@v3
with:
name: wheelhouse-sdist
path: ./dist/*
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
# By omitting the name we are downloading all the artifacts
path: ./dist/
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ./dist/wheelhouse-*
- name: Upload Python packages for release notes
uses: softprops/action-gh-release@v1
with:
files: |
dist/wheelhouse-*/*