Skip to content

Commit 2bbe646

Browse files
authored
Merge pull request #26 from cake-lab/yiqinzhao/2025-mqp-release
v0.4.0 release
2 parents 090995a + 5f97dcc commit 2bbe646

File tree

1,783 files changed

+289926
-39177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,783 files changed

+289926
-39177
lines changed

.github/workflows/ci.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
pull_request:
9+
branches:
10+
- main
11+
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
15+
# security: restrict permissions for CI jobs.
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
server-ci:
21+
name: Server CI
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Install Python
27+
id: install_python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: "3.12"
31+
32+
- name: Install Poetry
33+
uses: abatilo/actions-poetry@v2
34+
with:
35+
poetry-version: "1.8.4"
36+
37+
- name: Setup a local virtual environment (if no poetry.toml file)
38+
working-directory: ./python
39+
run: |
40+
poetry config virtualenvs.create true --local
41+
poetry config virtualenvs.in-project true --local
42+
43+
- name: Restore cached virtualenv
44+
uses: actions/cache/restore@v4
45+
with:
46+
path: ./python/.venv
47+
key: venv-${{ runner.os }}-${{
48+
steps.install_python.outputs.python-version }}-${{
49+
hashFiles('./python/poetry.lock') }}
50+
51+
- name: Install dependencies (used by later workflows)
52+
working-directory: ./python
53+
run: |
54+
poetry install
55+
echo "$(poetry env info --path)/bin" >> $GITHUB_PATH
56+
echo "VIRTUAL_ENV=$(poetry env info --path)/bin" >> $GITHUB_ENV
57+
58+
- name: Saved cached virtualenv
59+
uses: actions/cache/save@v4
60+
with:
61+
path: ./python/.venv
62+
key: venv-${{ runner.os }}-${{
63+
steps.install_python.outputs.python-version }}-${{
64+
hashFiles('./python/poetry.lock') }}
65+
66+
- name: Lint with ruff
67+
working-directory: ./python
68+
run: ruff check --output-format=github
69+
70+
# - name: Typecheck with pyright
71+
# working-directory: ./python
72+
# run: pyright arflow
73+
#
74+
# - name: Test with pytest
75+
# working-directory: ./python
76+
# timeout-minutes: 5 # pytest sometimes hangs for (yet) unknown reasons
77+
# run: |
78+
# pytest

.github/workflows/main.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/pre-release.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Pre-release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
release:
16+
name: Release package
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Install Python
22+
id: install_python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: "3.12"
26+
27+
- name: Install Poetry
28+
uses: abatilo/actions-poetry@v2
29+
with:
30+
poetry-version: "1.8.4"
31+
32+
- name: Setup a local virtual environment (if no poetry.toml file)
33+
working-directory: ./python
34+
run: |
35+
poetry config virtualenvs.create true --local
36+
poetry config virtualenvs.in-project true --local
37+
38+
- name: Restore cached virtualenv
39+
uses: actions/cache/restore@v4
40+
with:
41+
path: ./python/.venv
42+
key:
43+
venv-${{ runner.os }}-${{
44+
steps.install_python.outputs.python-version }}-${{
45+
hashFiles('./python/poetry.lock') }}
46+
47+
- name: Install dependencies (skipped if cache hit, fallback to install)
48+
working-directory: ./python
49+
run: |
50+
poetry install
51+
echo "$(poetry env info --path)/bin" >> $GITHUB_PATH
52+
echo "VIRTUAL_ENV=$(poetry env info --path)/bin" >> $GITHUB_ENV
53+
54+
- name: Saved cached virtualenv
55+
uses: actions/cache/save@v4
56+
with:
57+
path: ./python/.venv
58+
key:
59+
venv-${{ runner.os }}-${{
60+
steps.install_python.outputs.python-version }}-${{
61+
hashFiles('./python/poetry.lock') }}
62+
63+
- name: Configure Test PyPI with Poetry
64+
working-directory: ./python
65+
run: |
66+
poetry config repositories.testpypi https://test.pypi.org/legacy/
67+
poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_API_TOKEN }}
68+
69+
- name: Build and publish the package
70+
working-directory: ./python
71+
run: poetry publish --build -r testpypi

.github/workflows/publish-docs.yml

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
name: Publish docs
2+
3+
on:
4+
# Allows you to run this workflow manually from the Actions tab
5+
workflow_dispatch:
6+
workflow_call:
7+
8+
permissions:
9+
pages: write
10+
id-token: write
11+
12+
jobs:
13+
build-protos-docs:
14+
name: Build protos docs
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install Buf CLI
20+
uses: bufbuild/[email protected] # must match mise.toml
21+
with:
22+
github_token: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Install protoc
25+
uses: arduino/setup-protoc@v1
26+
27+
- name: Build protos docs
28+
run: buf generate
29+
30+
- uses: actions/upload-artifact@v4
31+
with:
32+
name: protos-docs
33+
path: ./website/docs/protos
34+
35+
build-client-docs:
36+
name: Build client docs
37+
runs-on: windows-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
- name: Dotnet Setup
42+
uses: actions/setup-dotnet@v3
43+
with:
44+
dotnet-version: 8.x
45+
46+
- name: Update docfx
47+
run: dotnet tool update -g docfx
48+
49+
- name: Run script to build the documentation
50+
working-directory: ./unity/Documentation
51+
run: ./scripts/build.cmd
52+
53+
- uses: actions/upload-artifact@v4
54+
with:
55+
name: client-docs
56+
path: ./website/docs/client
57+
58+
build-server-docs:
59+
name: Build server docs
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v4
63+
64+
- name: Install Python
65+
id: install_python
66+
uses: actions/setup-python@v5
67+
with:
68+
python-version: "3.12"
69+
70+
- name: Install Poetry
71+
uses: abatilo/actions-poetry@v2
72+
with:
73+
poetry-version: "1.8.4"
74+
75+
- name: Setup a local virtual environment (if no poetry.toml file)
76+
working-directory: ./python
77+
run: |
78+
poetry config virtualenvs.create true --local
79+
poetry config virtualenvs.in-project true --local
80+
81+
- name: Restore cached virtualenv
82+
uses: actions/cache/restore@v4
83+
with:
84+
path: ./python/.venv
85+
key:
86+
venv-${{ runner.os }}-${{
87+
steps.install_python.outputs.python-version }}-${{
88+
hashFiles('./python/poetry.lock') }}
89+
90+
- name: Install docs dependencies
91+
working-directory: ./python
92+
run: |
93+
poetry install --with docs
94+
echo "$(poetry env info --path)/bin" >> $GITHUB_PATH
95+
echo "VIRTUAL_ENV=$(poetry env info --path)/bin" >> $GITHUB_ENV
96+
97+
- name: Build the documentation
98+
working-directory: ./python
99+
run: python tools/make_docs_cli.py
100+
101+
- uses: actions/upload-artifact@v4
102+
with:
103+
name: server-docs
104+
path: ./website/docs/server
105+
106+
upload-website:
107+
name: Upload website
108+
needs: [build-protos-docs, build-client-docs, build-server-docs]
109+
runs-on: ubuntu-latest
110+
steps:
111+
- uses: actions/checkout@v4
112+
113+
- uses: actions/download-artifact@v4
114+
with:
115+
name: protos-docs
116+
path: ./website/docs/protos
117+
118+
- uses: actions/download-artifact@v4
119+
with:
120+
name: client-docs
121+
path: ./website/docs/client
122+
123+
- uses: actions/download-artifact@v4
124+
with:
125+
name: server-docs
126+
path: ./website/docs/server
127+
128+
- uses: actions/upload-pages-artifact@v3
129+
with:
130+
path: ./website
131+
132+
# Single deploy job since we're just deploying
133+
deploy-website:
134+
name: Deploy website
135+
needs: upload-website
136+
runs-on: ubuntu-latest
137+
permissions:
138+
pages: write
139+
id-token: write
140+
environment:
141+
name: github-pages
142+
url: ${{ steps.deployment.outputs.page_url }}
143+
steps:
144+
- name: Deploy to GitHub Pages
145+
id: deployment
146+
uses: actions/deploy-pages@v4

.github/workflows/release.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
release:
16+
name: Release package
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Install Python
22+
id: install_python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: "3.12"
26+
27+
- name: Install Poetry
28+
uses: abatilo/actions-poetry@v2
29+
with:
30+
poetry-version: "1.8.4"
31+
32+
- name: Setup a local virtual environment (if no poetry.toml file)
33+
working-directory: ./python
34+
run: |
35+
poetry config virtualenvs.create true --local
36+
poetry config virtualenvs.in-project true --local
37+
38+
- name: Restore cached virtualenv
39+
uses: actions/cache/restore@v4
40+
with:
41+
path: ./python/.venv
42+
key:
43+
venv-${{ runner.os }}-${{
44+
steps.install_python.outputs.python-version }}-${{
45+
hashFiles('./python/poetry.lock') }}
46+
47+
- name: Install dependencies (skipped if cache hit, fallback to install)
48+
working-directory: ./python
49+
run: |
50+
poetry install
51+
echo "$(poetry env info --path)/bin" >> $GITHUB_PATH
52+
echo "VIRTUAL_ENV=$(poetry env info --path)/bin" >> $GITHUB_ENV
53+
54+
- name: Saved cached virtualenv
55+
uses: actions/cache/save@v4
56+
with:
57+
path: ./python/.venv
58+
key:
59+
venv-${{ runner.os }}-${{
60+
steps.install_python.outputs.python-version }}-${{
61+
hashFiles('./python/poetry.lock') }}
62+
63+
- name: Use PyPI API token
64+
working-directory: ./python
65+
run: poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
66+
67+
- name: Build and publish the package
68+
working-directory: ./python
69+
run: poetry publish --build
70+
71+
- name: Upload Python package to GitHub
72+
uses: actions/upload-artifact@v4
73+
with:
74+
path: ./python/dist/
75+
if-no-files-found: error
76+
77+
publish-docs:
78+
name: Publish documentation
79+
permissions:
80+
pages: write
81+
id-token: write
82+
uses: ./.github/workflows/publish-docs.yml

0 commit comments

Comments
 (0)