-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (110 loc) · 3.1 KB
/
uniffi-bindgen.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
on:
push:
branches:
- main
tags:
- 'uniffi-bindgen-*'
paths:
- .github/workflows/uniffi-bindgen.yml
- uniffi-bindgen/**
pull_request:
paths:
- .github/workflows/uniffi-bindgen.yml
- uniffi-bindgen/**
workflow_dispatch:
name: uniffi-bindgen
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
build-sdist:
name: Build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: PyO3/maturin-action@v1
with:
command: sdist
working-directory: uniffi-bindgen
args: -o dist
- name: Upload sdist artifacts
uses: actions/upload-artifact@v3
with:
name: wheels
path: uniffi-bindgen/dist
build-wheel:
name: Build on ${{ matrix.platform.os }} for ${{ matrix.platform.target }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- os: ubuntu-latest
target: x86_64
- os: ubuntu-latest
target: i686
- os: ubuntu-latest
target: aarch64
- os: macos-latest
target: x86_64
- os: macos-latest
target: aarch64
- os: windows-latest
target: x86_64
- os: windows-latest
target: aarch64
- os: windows-latest
target: i686
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: PyO3/maturin-action@v1
with:
working-directory: uniffi-bindgen
target: ${{ matrix.platform.target }}
manylinux: auto
args: -b bin --release -o dist
sccache: 'true'
- name: Upload wheel artifacts
uses: actions/upload-artifact@v3
with:
name: wheels
path: uniffi-bindgen/dist
release-pypi:
permissions:
# Used to sign the release's artifacts with sigstore-python.
id-token: write
# Used to upload release artifacts.
contents: write
name: Publish to PyPI
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: [build-wheel, build-sdist]
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Publish
env:
MATURIN_PASSWORD: ${{ secrets.MATURIN_PASSWORD }}
run: |
set -ex
pip install maturin
maturin upload -u __token__ --skip-existing *
- name: Sigstore Sign
uses: sigstore/[email protected]
with:
inputs: ./*.whl
upload-signing-artifacts: true
- name: Release signing artifacts
uses: softprops/action-gh-release@v1
with:
files: |
*.whl
*.sig
*.crt
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
generate_release_notes: true