-
Notifications
You must be signed in to change notification settings - Fork 27
171 lines (171 loc) · 5.83 KB
/
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: Build and publish
on:
release:
types: [published]
jobs:
deploy-windows:
runs-on: windows-2019
strategy:
matrix:
python-major-version: [3]
python-minor-version: [6, 7, 8, 9, 10, 11, 12]
env:
python-version: ${{ format('{0}.{1}', matrix.python-major-version, matrix.python-minor-version) }}
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install Poetry
run: |
python -m pip install --upgrade pip
python -m pip install poetry
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.python-version }}
cache: "poetry"
cache-dependency-path: "pyproject.toml"
- name: Upgrade Poetry
if: ${{ matrix.python-minor-version >= 10 }}
run: |
pip install --upgrade poetry
- name: Install dependencies
run: |
poetry install --no-root
- name: Build 3_10
if: ${{ matrix.python-minor-version == 10 }}
run: |
poetry build -v
poetry install --only-root
- name: Build
if: ${{ matrix.python-minor-version != 10 }}
run: |
poetry build -v -f wheel
poetry install --only-root
- name: Check
run: poetry run python -c "import cshogi"
- name: Publish
if: github.event_name == 'release' && github.event.action == 'published'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: poetry run twine upload dist/*
deploy-manylinux2010:
runs-on: ubuntu-20.04
env:
CC: g++
CXX: g++
strategy:
matrix:
python-version: ["cp36-cp36m", "cp37-cp37m", "cp38-cp38", "cp39-cp39"]
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install Poetry
run: |
python -m pip install --upgrade pip
python -m pip install poetry
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "poetry"
cache-dependency-path: "pyproject.toml"
- name: Install dependencies
run: |
poetry install --no-root
- name: Build
run: |
poetry build -f sdist
tar zvxf ./dist/*.tar.gz -C ./dist
cp $(find ./dist -name setup.py) .
export PYTHON_BIN="/opt/python/${{ matrix.python-version }}/bin"
docker run --rm -v $(pwd):/work \
-w /work quay.io/pypa/manylinux2010_x86_64 \
/bin/sh -c "\
$PYTHON_BIN/pip install numpy==1.19.5 Cython && \
$PYTHON_BIN/python setup.py bdist_wheel && \
cd dist && auditwheel repair *.whl"
- name: Publish
if: github.event_name == 'release' && github.event.action == 'published'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: poetry run twine upload dist/wheelhouse/*
deploy-manylinux_2_24:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["cp310-cp310", "cp311-cp311"]
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install Poetry
run: |
python -m pip install --upgrade pip
python -m pip install poetry
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "poetry"
cache-dependency-path: "pyproject.toml"
- name: Install dependencies
run: |
poetry install --no-root
- name: Build
run: |
poetry build -f sdist
tar zvxf ./dist/*.tar.gz -C ./dist
cp $(find ./dist -name setup.py) .
export PYTHON_BIN="/opt/python/${{ matrix.python-version }}/bin"
docker run --rm -v $(pwd):/work \
-w /work quay.io/pypa/manylinux_2_24_x86_64 \
/bin/sh -c "\
$PYTHON_BIN/pip install numpy Cython && \
$PYTHON_BIN/python setup.py bdist_wheel && \
cd dist && auditwheel repair *.whl"
- name: Publish
if: github.event_name == 'release' && github.event.action == 'published'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: poetry run twine upload dist/wheelhouse/*
deploy-manylinux_2_28:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["cp312-cp312"]
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install Poetry
run: |
python -m pip install --upgrade pip
python -m pip install poetry
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "poetry"
cache-dependency-path: "pyproject.toml"
- name: Install dependencies
run: |
poetry install --no-root
- name: Build
run: |
poetry build -f sdist
tar zvxf ./dist/*.tar.gz -C ./dist
cp $(find ./dist -name setup.py) .
export PYTHON_BIN="/opt/python/${{ matrix.python-version }}/bin"
docker run --rm -v $(pwd):/work \
-w /work quay.io/pypa/manylinux_2_28_x86_64 \
/bin/sh -c "\
$PYTHON_BIN/pip install numpy Cython && \
$PYTHON_BIN/python setup.py bdist_wheel && \
cd dist && auditwheel repair *.whl"
- name: Publish
if: github.event_name == 'release' && github.event.action == 'published'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: poetry run twine upload dist/wheelhouse/*