-
Notifications
You must be signed in to change notification settings - Fork 221
144 lines (142 loc) · 4.79 KB
/
pypi-publish.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Build and upload python wheels
on:
release:
types: [published]
jobs:
linux:
timeout-minutes: 60
name: Python Linux 3.${{ matrix.python-minor-version }} ${{ matrix.config.platform }} manylinux${{ matrix.config.manylinux }}
strategy:
matrix:
python-minor-version: [ "9" ]
config:
- platform: x86_64
manylinux: "2_17"
extra_args: ""
- platform: x86_64
manylinux: "2_28"
extra_args: "--features fp16kernels"
- platform: aarch64
manylinux: "2_24"
extra_args: ""
# We don't build fp16 kernels for aarch64, because it uses
# cross compilation image, which doesn't have a new enough compiler.
runs-on: "ubuntu-22.04"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.${{ matrix.python-minor-version }}
- name: Handle tag
id: handle_tag
run: |
# If the tag ends with -beta.N, we need to call setup_version.py
# and export repo as "fury" instead of "pypi"
if [[ ${{ github.ref }} == refs/tags/*-beta.* ]]; then
TAG=$(echo ${{ github.ref }} | sed 's/refs\/tags\///')
pip install packaging
python ci/setup_version.py $TAG
echo "repo=fury" >> $GITHUB_OUTPUT
else
echo "repo=pypi" >> $GITHUB_OUTPUT
fi
- uses: ./.github/workflows/build_linux_wheel
with:
python-minor-version: ${{ matrix.python-minor-version }}
args: "--release --strip ${{ matrix.config.extra_args }}"
arm-build: ${{ matrix.config.platform == 'aarch64' }}
manylinux: ${{ matrix.config.manylinux }}
- uses: ./.github/workflows/upload_wheel
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
fury_token: ${{ secrets.FURY_TOKEN }}
repo: ${{ steps.handle_tag.outputs.repo }}
mac:
timeout-minutes: 60
runs-on: ${{ matrix.config.runner }}
strategy:
matrix:
python-minor-version: ["9"]
config:
- target: x86_64-apple-darwin
runner: macos-13
- target: aarch64-apple-darwin
runner: macos-14
env:
MACOSX_DEPLOYMENT_TARGET: 10.15
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
fetch-depth: 0
lfs: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Handle tag
id: handle_tag
run: |
# If the tag ends with -beta.N, we need to call setup_version.py
# and export repo as "fury" instead of "pypi"
if [[ ${{ github.ref }} == refs/tags/*-beta.* ]]; then
TAG=$(echo ${{ github.ref }} | sed 's/refs\/tags\///')
pip install packaging
python ci/setup_version.py $TAG
echo "repo=fury" >> $GITHUB_OUTPUT
else
echo "repo=pypi" >> $GITHUB_OUTPUT
fi
- uses: ./.github/workflows/build_mac_wheel
with:
python-minor-version: ${{ matrix.python-minor-version }}
args: "--release --strip --target ${{ matrix.config.target }} --features fp16kernels"
- uses: ./.github/workflows/upload_wheel
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
fury_token: ${{ secrets.FURY_TOKEN }}
repo: ${{ steps.handle_tag.outputs.repo }}
windows:
timeout-minutes: 60
runs-on: windows-latest
strategy:
matrix:
python-minor-version: ["9"]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
fetch-depth: 0
lfs: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.${{ matrix.python-minor-version }}
- name: Handle tag
id: handle_tag
shell: bash
run: |
# If the tag ends with -beta.N, we need to call setup_version.py
# and export repo as "fury" instead of "pypi"
if [[ ${{ github.ref }} == refs/tags/*-beta.* ]]; then
TAG=$(echo ${{ github.ref }} | sed 's/refs\/tags\///')
pip install packaging
python ci/setup_version.py $TAG
echo "repo=fury" >> $GITHUB_OUTPUT
else
echo "repo=pypi" >> $GITHUB_OUTPUT
fi
- uses: ./.github/workflows/build_windows_wheel
with:
python-minor-version: ${{ matrix.python-minor-version }}
args: "--release --strip"
vcpkg_token: ${{ secrets.VCPKG_GITHUB_PACKAGES }}
- uses: ./.github/workflows/upload_wheel
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
fury_token: ${{ secrets.FURY_TOKEN }}
repo: ${{ steps.handle_tag.outputs.repo }}