-
-
Notifications
You must be signed in to change notification settings - Fork 840
132 lines (107 loc) · 3.46 KB
/
build.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
name: build
on: [workflow_call, workflow_dispatch]
jobs:
build-winmac:
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-pc-windows-msvc
os: windows-2022
arch: x64
- target: i686-pc-windows-msvc
os: windows-2022
arch: x86
- target: x86_64-apple-darwin
os: macos-12
arch: x64
- target: aarch64-apple-darwin
os: macos-12
arch: x64
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Install Nightly Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: rustfmt
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
architecture: ${{ matrix.arch }}
- name: Install Python packages
run: pip install -r python/requirements.txt
- name: Build wheels
run: make TARGET=${{ matrix.target }}
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: pyxel-wheels
path: dist/*
build-linux:
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
image: messense/manylinux2014-cross:x86_64
- target: i686-unknown-linux-gnu
image: messense/manylinux2014-cross:i686
- target: aarch64-unknown-linux-gnu
image: messense/manylinux2014-cross:aarch64
- target: armv7-unknown-linux-gnueabihf
image: messense/manylinux2014-cross:armv7l
runs-on: ubuntu-22.04
container: ${{ matrix.image }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Install Nightly Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: rustfmt
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install Python packages
run: pip install -r python/requirements.txt
- name: Build and install SDL2
run: |
SDL2_VERSION=2.0.10
export CC=$TARGET_CC
export AR=$TARGET_AR
export RANLIB=$TARGET_RANLIB
curl -sqLO https://github.com/libsdl-org/SDL/releases/download/release-${SDL2_VERSION}/SDL2-${SDL2_VERSION}.tar.gz
tar xzf SDL2-${SDL2_VERSION}.tar.gz
cd SDL2-${SDL2_VERSION}
CFLAGS="-O3 -fPIC" ./configure \
--build=x86_64-unknown-linux-gnu \
--host=${{ matrix.target }} \
--prefix=/usr/${{ matrix.target }}
make -j4
make install
cd ..
rm -rf SDL2-${SDL2_VERSION}
- name: Build wheels
run: |
export BINDGENFLAGS="-I/usr/${{ matrix.target }}/include/SDL2 -I/usr/${{ matrix.target }}/${{ matrix.target }}/sysroot/usr/include"
export RUSTFLAGS="-L/usr/${{ matrix.target }}/lib"
make TARGET=${{ matrix.target }}
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: pyxel-wheels
path: dist/*