forked from msis/python-moos
-
Notifications
You must be signed in to change notification settings - Fork 2
156 lines (130 loc) · 4.06 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
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
name: Wheels
on:
push:
tags:
- "**"
jobs:
build_sdist:
name: Build SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install deps
run: python -m pip install twine build
- name: Build SDist
run: python -m build -s
- name: Check metadata
run: twine check dist/*
- uses: actions/upload-artifact@v2
with:
name: sdist
path: dist/*.tar.gz
build_wheels:
name: Wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest] # windows-latest,
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Checkout MOOS source
uses: actions/checkout@v2
with:
repository: 'russkel/core-moos'
path: '${{ github.workspace }}/core-moos'
- name: 'Run CMake'
uses: lukka/run-cmake@v3
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: '${{ github.workspace }}/core-moos/CMakeLists.txt'
buildDirectory: '${{ github.workspace }}/core-moos/build'
cmakeBuildType: 'Release'
buildWithCMake: true
cmakeAppendedArgs: '-DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON'
- name: Install MOOS
run: |
cd ${{ github.workspace }}/core-moos/build
cmake --install . --prefix ${{ github.workspace }}/.local/
echo "PATH=$PATH:${{ github.workspace }}/.local/bin" >> $GITHUB_ENV
- name: Create setup.cfg
if: matrix.os == 'macos-latest'
run: |
echo "[build_ext]" >> setup.cfg
echo "include_dirs=${{ github.workspace }}/.local/include" >> setup.cfg
echo "library_dirs=${{ github.workspace }}/.local/lib" >> setup.cfg
cat setup.cfg
# linux cibuildwheel uses a docker image - it maps workspace to /project
- name: Create setup.cfg
if: matrix.os == 'ubuntu-latest'
run: |
echo "[build_ext]" >> setup.cfg
echo "include_dirs=/project/.local/include" >> setup.cfg
echo "library_dirs=/project/moosbuild/lib" >> setup.cfg
cat setup.cfg
- name: Build wheel
if: matrix.os == 'ubuntu-latest'
uses: pypa/[email protected]
env:
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_I686_IMAGE: manylinux2014
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
CIBW_ARCHS_LINUX: "auto aarch64"
CIBW_BEFORE_ALL: |
mkdir moosbuild;
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON /project/core-moos/;
make;
make install;
CIBW_SKIP: pp*
CIBW_TEST_SKIP: "*"
- name: Build MacOS Wheels
uses: pypa/[email protected]
if: matrix.os == 'macos-latest'
env:
CIBW_SKIP: pp*
CIBW_TEST_SKIP: "*"
- name: Show files
run: ls -lh wheelhouse
shell: bash
- name: Verify clean directory
run: git diff --exit-code
shell: bash
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: wheelhouse/*.whl
release:
needs: ['build_wheels', 'build_sdist']
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
path: dist
- uses: actions/download-artifact@v3
with:
name: sdist
path: dist
- uses: olegtarasov/[email protected]
id: tagName
- name: Create Release
id: create_release
uses: "marvinpinto/[email protected]"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
draft: true
prerelease: false
title: pymoos ${{ steps.tagName.outputs.tag }}
files: |
dist/*.whl
dist/*.tar.gz