-
Notifications
You must be signed in to change notification settings - Fork 1
137 lines (137 loc) · 4.61 KB
/
release.yaml
File metadata and controls
137 lines (137 loc) · 4.61 KB
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
name: Release
on:
release:
types: [published]
permissions:
contents: read
jobs:
build-lib:
name: Build and Test C++ Library
permissions:
actions: write
contents: read
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-15-intel, macos-latest, windows-latest, windows-11-arm]
uses: ./.github/workflows/lib.yaml
with:
runner: ${{ matrix.os }}
run-tests: true
python-test:
name: Build and Test Python Bindings
needs: build-lib
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-15-intel, macos-latest, windows-latest, windows-11-arm]
uses: ./.github/workflows/python.yaml
with:
runner: ${{ matrix.os }}
build_wheel: true
nox-session: test_simple
python-versions-sessions:
name: Get Nox Sessions
runs-on: ubuntu-latest
outputs:
sessions: ${{ steps.get-sessions.outputs.sessions }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: wntrblm/nox@97e345e6a26bb2c5aacff9cc4327bd4ac1b00ce6 # 2026.04.10
- id: get-sessions
working-directory: lang/python/test
run: |
echo sessions=$(nox --json -l | jq -c '
[.[].session | select(startswith("test_versions"))]
') | tee --append $GITHUB_OUTPUT
python-versions:
name: Test Python and NumPy Version Compatibility
needs: [build-lib, python-versions-sessions]
strategy:
fail-fast: false
matrix:
session: ${{ fromJson(needs.python-versions-sessions.outputs.sessions) }}
uses: ./.github/workflows/python.yaml
with:
runner: ubuntu-latest
nox-session: ${{ matrix.session }}
python-coverage:
name: Test Python Coverage
needs: build-lib
uses: ./.github/workflows/python.yaml
with:
runner: ubuntu-latest
nox-session: coverage
docs:
name: Build Documentation
permissions:
contents: write
needs: build-lib
uses: ./.github/workflows/docs.yaml
with:
version: stable
upload_binaries:
name: Upload Release Binaries
needs: [build-lib, python-test, python-versions, python-coverage, docs]
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-15-intel, macos-latest, windows-latest, windows-11-arm]
steps:
- name: Set PLATFORM_TAG
run: |
declare -A platform_map=(
[ubuntu-latest]=linux_x86_64
[ubuntu-24.04-arm]=linux_arm64
[macos-15-intel]=macos_x86_64
[macos-latest]=macos_arm64
[windows-latest]=win_x86_64
[windows-11-arm]=win_arm64
)
echo "PLATFORM_TAG=${platform_map[${{ matrix.os }}]}" >> $GITHUB_ENV
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: lib-${{ matrix.os }}
path: lib-${{ matrix.os }}
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: python-${{ matrix.os }}
path: python-${{ matrix.os }}
- name: Upload $${{ matrix.os }} Binaries to ${{ github.ref_name }}
env:
GH_TOKEN: ${{ github.token }}
run: |
LIB_NAME="libmvsr-${GITHUB_REF_NAME:1}-$PLATFORM_TAG.zip"
zip -r $LIB_NAME lib-${{ matrix.os }}
gh release upload $GITHUB_REF_NAME $LIB_NAME --repo $GITHUB_REPOSITORY
WHEEL_NAME="python-${{ matrix.os }}/$(ls python-${{ matrix.os }})"
gh release upload $GITHUB_REF_NAME $WHEEL_NAME --repo $GITHUB_REPOSITORY
echo "WHEEL_NAME=$WHEEL_NAME" >> $GITHUB_ENV
- uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
with:
packages-dir: python-${{ matrix.os }}
upload_sdist:
name: Upload Python Source Distribution
needs: [upload_binaries]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
enable-cache: false
- name: Upload sdist
working-directory: lang/python
run: uv build --sdist
- uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
with:
packages-dir: lang/python/dist