-
Notifications
You must be signed in to change notification settings - Fork 39
182 lines (180 loc) · 5.61 KB
/
dist.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
name: Dist
on:
push:
branches: [ release, next ]
# Notes on the Wheels:
# macos-13 is an intel runner, which cibw wants for x86 builds... But intel mac is busted.
# https://github.com/e-dant/watcher/actions/runs/9929111640/job/27426247416#step:3:293
# We don't support Windows (but we want to) because meson-python doesn't allow us
# to install shared libraries in wheels for Windows. More info and whatnot here:
# https://github.com/mesonbuild/meson-python/discussions/629
# Other refs, for the action file:
# - https://cibuildwheel.pypa.io/en/stable/setup
# - https://github.com/scikit-image/scikit-image/blob/main/.github/workflows/wheels_recipe.yml
jobs:
linux-dist:
runs-on: ${{matrix.os}}
strategy:
matrix:
os:
- ubuntu-latest
triple:
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
- armv7-unknown-linux-gnueabihf
- armv7-unknown-linux-musleabihf
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- shell: bash
run: tool/cross --target-${{matrix.triple}}
- uses: actions/upload-artifact@v4
with:
name: ${{matrix.triple}}.tar
path: out/${{matrix.triple}}.tar
- uses: actions/upload-artifact@v4
with:
name: ${{matrix.triple}}.tar.sha256sum
path: out/${{matrix.triple}}.tar.sha256sum
apple-dist:
runs-on: ${{matrix.os}}
strategy:
matrix:
os:
- macos-latest
triple:
- aarch64-apple-darwin
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- shell: bash
run: tool/cross --target-${{matrix.triple}}
- uses: actions/upload-artifact@v4
with:
name: ${{matrix.triple}}.tar
path: out/${{matrix.triple}}.tar
- uses: actions/upload-artifact@v4
with:
name: ${{matrix.triple}}.tar.sha256sum
path: out/${{matrix.triple}}.tar.sha256sum
windows-dist:
runs-on: ${{matrix.os}}
strategy:
matrix:
os:
- windows-latest
triple:
- x86_64-pc-windows-msvc
- aarch64-pc-windows-msvc
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- shell: bash
run: tool/cross --target-${{matrix.triple}}
- uses: actions/upload-artifact@v4
with:
name: ${{matrix.triple}}.tar
path: out/${{matrix.triple}}.tar
- uses: actions/upload-artifact@v4
with:
name: ${{matrix.triple}}.tar.sha256sum
path: out/${{matrix.triple}}.tar.sha256sum
wheels-linux:
name: (x86_64|aarch64)-unknown-linux-(gnu|musl)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- uses: pypa/[email protected]
with:
package-dir: .
output-dir: wheelhouse
config-file: pyproject.toml
- run: python3 tool/shasum.py wheelhouse show
- run: python3 tool/shasum.py wheelhouse mk
- uses: actions/upload-artifact@v4
with:
name: wheels-linux
path: wheelhouse/*
wheels-apple:
name: aarch64-apple-darwin
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: pypa/[email protected]
env:
MACOSX_DEPLOYMENT_TARGET: 11
with:
package-dir: .
output-dir: wheelhouse
config-file: pyproject.toml
- run: python3 tool/shasum.py wheelhouse show
- run: python3 tool/shasum.py wheelhouse mk
- uses: actions/upload-artifact@v4
with:
name: wheels-apple
path: wheelhouse/*
create-gh-release:
if: ${{ github.ref == 'refs/heads/release' }}
runs-on: ubuntu-latest
needs:
- linux-dist
- apple-dist
- windows-dist
- wheels-apple
- wheels-linux
steps:
- uses: actions/checkout@v4
- run: |
tool/fetch-release-artifacts --no-zip
gh release create "$(cat .version)" --notes "$(tool/show-changelog-for-version)"
gh release upload "$(cat .version)" out/dist/*
env:
GITHUB_TOKEN: ${{ github.token }}
# Ref: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows
publish-wheels-pypi:
if: ${{ github.ref == 'refs/heads/release' }}
runs-on: ubuntu-latest
needs:
- wheels-apple
- wheels-linux
environment:
name: dist
url: https://pypi.org/p/wtr-watcher
permissions: write-all
steps:
- uses: actions/checkout@v4
with:
token: ${{ github.token }}
- run: |
tool/fetch-release-artifacts --no-zip
mkdir dist
find out/dist -name '*.whl' | while read f
do cp "$f" dist ; echo "$f"
done
env:
GH_TOKEN: ${{ github.token }}
- uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
publish-crates-io:
# Refs:
# - https://github.com/azriel91/peace/blob/main/.github/workflows/publish.yml
# - https://users.rust-lang.org/t/does-anyone-use-github-actions-to-run-cargo-publish/92374
if: ${{ github.ref == 'refs/heads/release' }}
environment:
name: publish-crates-io
url: https://crates.io/crates/wtr-watcher
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}