-
Notifications
You must be signed in to change notification settings - Fork 1
118 lines (116 loc) · 3.31 KB
/
build.yml
File metadata and controls
118 lines (116 loc) · 3.31 KB
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
name: Build
on:
push:
branches-ignore: [ "*" ]
tags: [ "*" ]
jobs:
sdist:
name: source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install Linux dependencies
run: |
sudo apt-get install libsdl2-dev
- name: Build source dist
run: |
python -m pip install -U pip build
python -m build -s
- name: Validate version in filename
run: |
# stop the build if the generated filename doesn't match the tag being built
ls dist/python-dos-like-${{ github.ref_name }}.tar.gz
- name: Upload source dist
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/*.tar.gz
manylinux:
name: manylinux wheels
strategy:
fail-fast: false
matrix:
python-tag: ["cp39", "cp310"]
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux_2_28_x86_64
env:
python: /opt/python/${{ matrix.python-tag }}-${{ matrix.python-tag }}/bin/python
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install Linux dependencies
run: |
yum -y install SDL2-devel glew-devel
- name: Install Python dependencies
run: |
$python -m pip install -U pip wheel
$python -m pip install -e '.[dev]'
- name: Build package
run: |
$python -m build -w
- name: Repair package
run: |
auditwheel repair dist/*.whl
- name: Upload package
uses: actions/upload-artifact@v3
with:
name: dist
path: wheelhouse/*.whl
wheel:
name: other wheels
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10"]
os: ["macos-latest", "windows-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install macOS dependencies
if: matrix.os == 'macos-latest'
run: |
brew install sdl2 glew
- name: Install Python dependencies
run: |
python -m pip install -U pip wheel
python -m pip install -e '.[dev]'
- name: Build package
run: |
python -m build -w
- name: Upload package
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/*.whl
release:
needs: ["sdist", "manylinux", "wheel"]
strategy:
fail-fast: false
matrix:
environment: [ "testing", "production" ]
environment: ${{ matrix.environment }}
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Publish to ${{ matrix.environment }} PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
repository_url: ${{ secrets.PYPI_URL }}