forked from r9y9/pyopenjtalk
-
Notifications
You must be signed in to change notification settings - Fork 4
95 lines (81 loc) · 2.47 KB
/
deploy.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
# ref: https://github.com/tsukumijima/pyworld-prebuilt/blob/master/.github/workflows/build-wheels.yml
name: Deploy to PyPI
on:
push:
branches: [ master ]
workflow_dispatch:
inputs:
publish_testpypi:
type: boolean
required: true
description: 'Publish to Test PyPI'
publish_pypi:
type: boolean
required: true
description: 'Publish to PyPI (Production)'
jobs:
build_wheels:
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
name: Build Wheels on ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Setup QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Build Wheels
uses: pypa/cibuildwheel@v2.19.2
env:
CIBW_ARCHS_LINUX: auto aarch64
CIBW_ARCHS_MACOS: x86_64 universal2 arm64
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8"
CIBW_SKIP: pp* *musllinux*
- name: Upload Wheels to artifact
uses: actions/upload-artifact@v4
with:
name: cibuildwheel-wheels-${{ runner.os }}
path: wheelhouse
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibuildwheel-sdist
path: dist/*.tar.gz
publish_wheels:
runs-on: ubuntu-latest
needs: [build_wheels, build_sdist]
name: Publish Wheels
steps:
- name: Download Wheels from artifact
uses: actions/download-artifact@v4
with:
pattern: cibuildwheel-*
path: wheelhouse
merge-multiple: true
- name: Publish Wheels to Test PyPI
if: ${{ github.event.inputs.publish_testpypi == 'true' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: wheelhouse
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
- name: Publish Wheels to PyPI
if: ${{ github.event.inputs.publish_pypi == 'true' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: wheelhouse
password: ${{ secrets.PYPI_API_TOKEN }}