-
Notifications
You must be signed in to change notification settings - Fork 57
83 lines (70 loc) · 2.19 KB
/
release_python_ffi.yaml
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
name: Release clients/python-ffi
on:
pull_request:
paths:
- "clients/python-ffi/**"
- ".github/workflows/release_python_ffi.yml"
branches:
- canary
push:
paths:
- "clients/python-ffi/**"
branches:
- canary
tags:
- "release/py_client_ffi/v*.*.*"
permissions:
contents: read
id-token: write
jobs:
build:
strategy:
matrix:
_:
- runs_on: ubuntu-latest
target: x86_64
name: x86_64-unknown-linux-gnu
- runs_on: ubuntu-latest
target: aarch64
name: aarch64-unknown-linux-gnu
- runs_on: macos-latest
target: x86_64
name: x86_64-apple-darwin
- runs_on: macos-latest
target: aarch64
name: aarch64-apple-darwin
- runs_on: windows-latest
target: x64
name: x86_64-pc-windows-msvc
runs-on: ${{ matrix._.runs_on }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8"
architecture: ${{ matrix._.runs_on == 'windows-latest' && 'x64' || null }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix._.target }}
command: build
args: --release --out clients/python-ffi/dist --manifest-path clients/python-ffi/Cargo.toml
sccache: "true"
manylinux: ${{ matrix._.runs_on == 'ubuntu-latest' && 'auto' || null }}
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix._.name }}
path: clients/python-ffi/dist
publish:
runs-on: ubuntu-latest
needs: [build]
if: startsWith(github.ref, 'refs/tags/release/')
environment: release
steps:
- uses: actions/download-artifact@v4
- run: mkdir dist && mv wheels-*/* dist
# authz is managed via OIDC configured at https://pypi.org/manage/project/baml-core-ffi/settings/publishing/
# it is pinned to this filename, so renaming this file is not safe!!: release_python_ffi.yaml
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1