-
Notifications
You must be signed in to change notification settings - Fork 21
155 lines (133 loc) · 3.86 KB
/
Copy pathbuild.yml
File metadata and controls
155 lines (133 loc) · 3.86 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Build
on:
push:
branches:
- master
tags:
- '*'
pull_request:
workflow_dispatch:
inputs:
publish:
required: true
type: boolean
jobs:
build-non-windows-wheel:
if: false
strategy:
matrix:
include:
- arch: linux_x86_64
runs-on: ubuntu-latest
- arch: linux_aarch64
runs-on: ubuntu-24.04-arm
- arch: macosx_x86_64
runs-on: macos-15-intel
- arch: macosx_arm64
runs-on: macos-15
fail-fast: false
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v6
- uses: pypa/cibuildwheel@v3.4.1
with:
output-dir: dist
extras: uv
- name: Fix tag
run: |
cd dist
for whl in *.whl; do
pipx run wheel tags --remove --python-tag py3 --abi-tag none $whl
done
- uses: actions/upload-artifact@v7
with:
name: vs-placebo-${{ matrix.arch }}
path: dist
build-windows-wheel:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: >-
base-devel
mingw-w64-ucrt-x86_64-git
mingw-w64-ucrt-x86_64-jq
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-python-build
mingw-w64-ucrt-x86_64-pkgconf
mingw-w64-ucrt-x86_64-vapoursynth
mingw-w64-ucrt-x86_64-meson
mingw-w64-ucrt-x86_64-ninja
mingw-w64-ucrt-x86_64-spirv-tools
mingw-w64-ucrt-x86_64-spirv-cross
mingw-w64-ucrt-x86_64-vulkan-headers
mingw-w64-ucrt-x86_64-vulkan-loader
mingw-w64-ucrt-x86_64-libdovi
mingw-w64-ucrt-x86_64-lcms2
mingw-w64-ucrt-x86_64-shaderc
mingw-w64-ucrt-x86_64-uv
- name: Fix Vulkan pkg-config
run: |
sed -i "s/-lvulkan-1/-lvulkan-1.dll/" "$(pkgconf vulkan --path)"
- name: Build vs-placebo
run: |
: # FIXME: uv does not want to work with subprojects
python -m build --wheel -Csetup-args="--default-library=static" \
-Csetup-args="-Dprefer_static=true" \
-Csetup-args="-Dlibplacebo:demos=false" \
-Csetup-args="-Dlibplacebo:glslang=enabled"
- name: Fix tag
run: |
cd dist
for whl in *.whl; do
uvx wheel tags --remove --python-tag py3 --abi-tag none --platform-tag win_amd64 $whl
done
- name: Build sdist
run: python -m build --sdist
- uses: actions/upload-artifact@v7
with:
name: vs-placebo-sdist
path: dist/*.tar.gz
- uses: actions/upload-artifact@v7
with:
name: vs-placebo-win_amd64
path: dist/*.whl
publish:
if: ${{ inputs.publish || startsWith(github.ref, 'refs/tags/') }}
needs: [build-non-windows-wheel, build-windows-wheel]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/vs-placebo
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v8
with:
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
publish-to-testpy:
needs: [build-non-windows-wheel, build-windows-wheel]
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://pypi.org/p/vs-placebo
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v8
with:
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/