-
Notifications
You must be signed in to change notification settings - Fork 161
86 lines (80 loc) · 2.8 KB
/
github-actions.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
name: gattlib
on: [push]
jobs:
build-debug:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sudo apt install libbluetooth-dev
- run: dpkg -l | grep python3 | grep "\-dev"
- run: mkdir build && pushd build && cmake -DCMAKE_BUILD_TYPE=Debug .. && make
build-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sudo apt install libbluetooth-dev doxygen
- run: mkdir build && pushd build && cmake -DCMAKE_BUILD_TYPE=Release -DGATTLIB_BUILD_DOCS=ON .. && make
build-release-force-dbus:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sudo apt install libbluetooth-dev
- run: mkdir build && pushd build && cmake -DGATTLIB_FORCE_DBUS=TRUE -DCMAKE_BUILD_TYPE=Release .. && make
generate-python-source-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: ./ci/generate-python-package.sh
- name: Archive Python packages
uses: actions/upload-artifact@v4
with:
name: python-source-package
path: dist/*.tar.gz
generate-python-binary-packages:
runs-on: quay.io/pypa/manylinux_2_28_x86_64
steps:
- uses: actions/checkout@v4
- name: Generate Binary package with git version
if: startsWith(github.ref, 'refs/tags/')
run: ./ci/generate-python-mainlinux-package.sh
- name: Generate Binary package with FAKE version
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
run: ./ci/generate-python-mainlinux-package.sh
env:
GATTLIB_PY_VERSION: '0.0.1'
- name: Archive Python packages
uses: actions/upload-artifact@v4
with:
name: python-binary-packages
path: dist/*
# publish-python-packages:
# needs:
# - generate-python-binary-packages
# runs-on: ubuntu-latest
# steps:
# - uses: actions/download-artifact@master
# - run: ls *
publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- generate-python-binary-packages
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/gattlib-py # Replace <package-name> with your PyPI project name
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- uses: actions/download-artifact@master
- run: |
ls *
mkdir dist/
mv python-3.10-binary-package/*.tar.gz dist/
mv python-*-binary-package/*.whl dist/
ls dist/*
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/