-
Notifications
You must be signed in to change notification settings - Fork 286
200 lines (168 loc) · 5.81 KB
/
publish_dartpy.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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
name: Publish dartpy
on:
push:
branches:
- "**"
schedule:
- cron: "0 10 * * 0,3"
# This workflow will install Python dependencies, run tests and lint with a
# variety of Python versions. For more information see:
# - https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
# - https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml
jobs:
check_format:
name: Check format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black -U
pip install isort -U
- name: Check format
run: |
black --check --diff .
- name: Check import
run: |
isort --check --diff .
build_wheels:
name: ${{ matrix.os }}-${{ matrix.build }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
build: ["cp37-manylinux_x86_64"]
toolchain_file: [""]
experimental: [false]
release_only: [true]
include:
- os: ubuntu-latest
build: "cp38-manylinux_x86_64"
toolchain_file: ""
experimental: false
release_only: true
- os: ubuntu-latest
build: "cp39-manylinux_x86_64"
toolchain_file: ""
experimental: false
release_only: true
- os: ubuntu-latest
build: "cp310-manylinux_x86_64"
toolchain_file: ""
experimental: false
release_only: true
- os: ubuntu-latest
build: "cp311-manylinux_x86_64"
toolchain_file: ""
experimental: false
release_only: false
- os: macos-latest
build: "cp38-macosx_x86_64"
toolchain_file: ""
experimental: false
release_only: true
- os: macos-latest
build: "cp39-macosx_x86_64"
toolchain_file: ""
experimental: false
release_only: true
- os: macos-latest
build: "cp310-macosx_x86_64"
toolchain_file: ""
experimental: false
release_only: true
- os: macos-latest
build: "cp311-macosx_x86_64"
toolchain_file: ""
experimental: false
release_only: false
- os: windows-latest
build: "cp38-win_amd64"
toolchain_file: C:/.dartsim/vcpkg/scripts/buildsystems/vcpkg.cmake
experimental: false
release_only: true
- os: windows-latest
build: "cp39-win_amd64"
toolchain_file: C:/.dartsim/vcpkg/scripts/buildsystems/vcpkg.cmake
experimental: false
release_only: true
- os: windows-latest
build: "cp310-win_amd64"
toolchain_file: C:/.dartsim/vcpkg/scripts/buildsystems/vcpkg.cmake
experimental: false
release_only: true
- os: windows-latest
build: "cp311-win_amd64"
toolchain_file: C:/.dartsim/vcpkg/scripts/buildsystems/vcpkg.cmake
experimental: false
release_only: false
- os: windows-latest
build: "cp311-win_arm64"
toolchain_file: C:/.dartsim/vcpkg/scripts/buildsystems/vcpkg.cmake
experimental: true
release_only: false
env:
CIBW_BUILD: ${{ matrix.build }}
steps:
- uses: actions/checkout@v4
- uses: johnwason/vcpkg-action@v6
with:
pkgs: assimp ccd eigen3 fcl fmt spdlog bullet3 coin-or-ipopt freeglut glfw3 nlopt ode opengl osg pagmo2 pybind11 tinyxml2 urdfdom
triplet: x64-windows
revision: "2024.02.14"
github-binarycache: true
token: ${{ github.token }}
- name: Build wheels
if: ${{ matrix.release_only == false || github.ref == 'refs/heads/main' }}
uses: pypa/[email protected]
env:
# Common
DART_IN_CI: ON
# macOS
MACOSX_DEPLOYMENT_TARGET: 10.15
# Windows
CMAKE_TOOLCHAIN_FILE: ${{ matrix.toolchain_file }}
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
# TODO: Disabled because installing from source doesn't work when the deps are not
# installed in the system
# build_sdist:
# name: Build source distribution
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Build SDist
# run: pipx run build --sdist
# - uses: actions/upload-artifact@v4
# with:
# path: dist/*.tar.gz
upload_pypi:
# needs: [build_wheels, build_sdist]
needs: [build_wheels]
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# upload to PyPI on every tag starting with 'release-'
# if: github.event_name == 'push' && startsWith(github.ref, 'release-')
# alternatively, to publish when a GitHub Release is created, use the following rule:
# if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
with:
# unpacks default artifact into dist/
# if `name: artifact` is omitted, the action will create extra parent dir
name: artifact
path: dist
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
# To test: repository_url: https://test.pypi.org/legacy/
skip_existing: true