-
Notifications
You must be signed in to change notification settings - Fork 751
77 lines (71 loc) · 1.77 KB
/
bindings.python.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
name: Bindings Python
on:
pull_request:
branches:
- main
paths-ignore:
- "docs/**"
- "website/**"
- "**.md"
- "docker/**"
- "scripts/setup/**"
- ".devcontainer/**"
workflow_call:
inputs:
tag:
description: The tag to release
required: true
type: string
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
env:
RUNNER_PROVIDER: github
jobs:
build_linux:
name: build-${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/build_bindings_python
with:
target: ${{ matrix.target }}
version: ${{ inputs.tag }}
build_macos:
name: build-${{ matrix.target }}
if: github.event_name != 'pull_request'
runs-on: macos-11
strategy:
matrix:
target:
- x86_64-apple-darwin
- aarch64-apple-darwin
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/build_bindings_python
with:
target: ${{ matrix.target }}
version: ${{ inputs.tag }}
release:
# publish release only the version endsWith 0
# if: endsWith(inputs.tag, '0')
if: inputs.tag
name: Publish to PyPI
needs: [build_linux, build_macos]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_password }}
skip-existing: true