-
Notifications
You must be signed in to change notification settings - Fork 59
97 lines (86 loc) · 2.83 KB
/
wheels.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
name: wheel-build-and-deploy
on:
push:
branches:
- make-wheel
- make-wheel-test
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest]
# os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
# Used to host cibuildwheel
- uses: actions/setup-python@v5
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.22.0
- name: Build wheels on ubuntu
if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: |
git tag v`grep __version__ phono3py/version.py|awk -F'"' '{print($2)}'`
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: "cp39-* pp* *_i686 *musllinux*"
CIBW_BUILD_VERBOSITY: 1
- name: Build wheels on macos
if: ${{ startsWith(matrix.os, 'macos') }}
run: |
git tag v`grep __version__ phono3py/version.py|awk -F'"' '{print($2)}'`
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: "cp39-* pp*"
# CIBW_ARCHS_MACOS: "x86_64 arm64"
CIBW_BUILD_VERBOSITY: 1
- name: Build wheels on windows
if: ${{ startsWith(matrix.os, 'windows') }}
run: |
$version = Select-String -Path "phono3py\version.py" -Pattern '__version__' | ForEach-Object {
($_ -split '"')[1]
}
git tag "v$version"
Write-Output "The value of version is: $version"
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: "cp39-* pp*"
CIBW_BUILD_VERBOSITY: 1
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
upload_pypi_test:
name: Upload to PyPI (test)
needs: [build_wheels,]
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/make-wheel-test' }}
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-wheels-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
skip-existing: true
upload_pypi:
name: Upload to PyPI
needs: [build_wheels,]
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/make-wheel' }}
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-wheels-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip-existing: true