Skip to content

Commit 9099910

Browse files
[#1356] Workflow to publish nightly wheels
1 parent 4f64aba commit 9099910

2 files changed

Lines changed: 152 additions & 0 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# ISC License
2+
#
3+
# Copyright (c) 2026, Autonomous Vehicle Systems Lab, University of Colorado at Boulder
4+
#
5+
# Permission to use, copy, modify, and/or distribute this software for any
6+
# purpose with or without fee is hereby granted, provided that the above
7+
# copyright notice and this permission notice appear in all copies.
8+
#
9+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16+
#
17+
18+
import argparse
19+
from pathlib import Path
20+
21+
22+
def _package_index(wheels: list[Path]) -> str:
23+
links = "\n".join(f' <a href="{w.name}">{w.name}</a><br/>' for w in wheels)
24+
return (
25+
"<!DOCTYPE html>\n"
26+
"<html><head><title>Links for basilisk</title></head><body>\n"
27+
"<h1>Links for basilisk</h1>\n"
28+
f"{links}\n"
29+
"</body></html>\n"
30+
)
31+
32+
33+
def _root_index() -> str:
34+
return (
35+
"<!DOCTYPE html>\n"
36+
"<html><head><title>Simple Index</title></head><body>\n"
37+
"<h1>Simple Index</h1>\n"
38+
' <a href="basilisk/">basilisk</a><br/>\n'
39+
"</body></html>\n"
40+
)
41+
42+
43+
def main() -> None:
44+
parser = argparse.ArgumentParser()
45+
parser.add_argument("--wheels-dir", required=True, type=Path)
46+
parser.add_argument("--output-dir", required=True, type=Path)
47+
args = parser.parse_args()
48+
49+
wheels = sorted(args.wheels_dir.glob("*.whl"))
50+
if not wheels:
51+
raise SystemExit(f"No wheels found in {args.wheels_dir}")
52+
53+
pkg_dir = args.output_dir / "basilisk"
54+
pkg_dir.mkdir(parents=True, exist_ok=True)
55+
56+
(pkg_dir / "index.html").write_text(_package_index(wheels))
57+
(args.output_dir / "index.html").write_text(_root_index())
58+
59+
for whl in wheels:
60+
(pkg_dir / whl.name).write_bytes(whl.read_bytes())
61+
62+
print(f"Index generated with {len(wheels)} wheel(s) in {args.output_dir}")
63+
64+
65+
if __name__ == "__main__":
66+
main()
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Nightly Wheels
2+
3+
on:
4+
schedule:
5+
- cron: "0 6 * * *" # Every day at 6:00 UTC
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-wheels:
10+
name: Build Wheels (${{ matrix.os }})
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os:
16+
- macos-latest
17+
- ubuntu-latest
18+
- ubuntu-22.04-arm
19+
- windows-latest
20+
21+
steps:
22+
- name: Checkout develop
23+
uses: actions/checkout@v5
24+
with:
25+
ref: develop
26+
27+
- name: Set CA bundle (macos-13 only)
28+
if: ${{ matrix.os == 'macos-13' }}
29+
shell: bash
30+
run: |
31+
python -m pip install -U certifi
32+
CA="$(python -c 'import certifi; print(certifi.where())')"
33+
{
34+
echo "REQUESTS_CA_BUNDLE=$CA"
35+
echo "PIP_CERT=$CA"
36+
echo "SSL_CERT_FILE=$CA"
37+
echo "CURL_CA_BUNDLE=$CA"
38+
echo "CMAKE_TLS_CAINFO=$CA"
39+
} >> "$GITHUB_ENV"
40+
41+
- name: Setup system dependencies
42+
uses: ./.github/actions/setup
43+
44+
- name: Build wheels
45+
uses: pypa/cibuildwheel@v3.1.4
46+
env:
47+
CONAN_ARGS: "--opNav True --mujoco True --mujocoReplay True"
48+
CIBW_TEST_SKIP: "*"
49+
50+
- name: Upload wheels
51+
uses: actions/upload-artifact@v6
52+
with:
53+
name: nightly-wheels-${{ matrix.os }}
54+
path: ./wheelhouse/*.whl
55+
56+
publish-index:
57+
name: Publish Nightly Index
58+
needs: build-wheels
59+
runs-on: ubuntu-latest
60+
permissions:
61+
contents: write
62+
63+
steps:
64+
- name: Download all wheels
65+
uses: actions/download-artifact@v4
66+
with:
67+
pattern: nightly-wheels-*
68+
merge-multiple: true
69+
path: wheels
70+
71+
- name: Checkout scripts
72+
uses: actions/checkout@v5
73+
with:
74+
ref: develop
75+
sparse-checkout: .github/scripts
76+
77+
- name: Generate simple index
78+
run: python .github/scripts/generate_nightly_index.py --wheels-dir wheels --output-dir nightly
79+
80+
- name: Deploy nightly index to GitHub Pages
81+
uses: peaceiris/actions-gh-pages@v3
82+
with:
83+
github_token: ${{ secrets.GITHUB_TOKEN }}
84+
publish_dir: ./nightly
85+
destination_dir: nightly
86+
keep_files: false

0 commit comments

Comments
 (0)