Skip to content

Commit 9c587e9

Browse files
committed
Prepare to publish
1 parent 93bdfee commit 9c587e9

File tree

3 files changed

+49
-26
lines changed

3 files changed

+49
-26
lines changed

.github/workflows/dist.yml

Lines changed: 44 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
tags:
1010
- '*'
1111

12+
concurrency:
13+
group: ${{ github.ref }}
14+
cancel-in-progress: true
15+
1216
jobs:
1317
check:
1418
runs-on: ubuntu-latest
@@ -49,13 +53,38 @@ jobs:
4953
pip --disable-pip-version-check install -e .
5054
pip --disable-pip-version-check install -r docs/requirements.txt
5155
cd docs && make clean html SPHINXOPTS="-W --keep-going"
52-
56+
57+
#
58+
# Build a wheel
59+
#
60+
61+
build:
62+
runs-on: ubuntu-22.04
63+
steps:
64+
- uses: actions/checkout@v3
65+
with:
66+
submodules: recursive
67+
fetch-depth: 0
68+
69+
- uses: actions/setup-python@v4
70+
with:
71+
python-version: 3.8
72+
73+
- run: pipx run build
74+
75+
- name: Upload build artifacts
76+
uses: actions/upload-artifact@v3
77+
with:
78+
name: dist
79+
path: dist
80+
5381
test:
82+
needs: [build]
5483
runs-on: ${{ matrix.os }}
5584
strategy:
5685
matrix:
5786
os: [windows-latest, macos-latest, ubuntu-20.04]
58-
python_version: [3.6, 3.7, 3.8, 3.9, "3.10"]
87+
python_version: [3.6, 3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
5988
architecture: [x86, x64]
6089
exclude:
6190
- os: macos-latest
@@ -74,14 +103,14 @@ jobs:
74103
python-version: ${{ matrix.python_version }}
75104
architecture: ${{ matrix.architecture }}
76105

77-
- name: Install build dependencies
78-
run: python -m pip --disable-pip-version-check install wheel
79-
80-
- name: Build wheel
81-
run: python setup.py bdist_wheel
106+
- name: Download build artifacts
107+
uses: actions/download-artifact@v3
108+
with:
109+
name: dist
110+
path: dist
82111

83112
- name: Install test dependencies
84-
run: python -m pip --disable-pip-version-check install pytest pcpp
113+
run: python -m pip --disable-pip-version-check install -r tests/requirements.txt
85114

86115
- name: Test wheel
87116
shell: bash
@@ -94,23 +123,16 @@ jobs:
94123
publish:
95124
runs-on: ubuntu-latest
96125
needs: [check, check-mypy, check-doc, test]
126+
permissions:
127+
id-token: write
97128
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
98129

99130
steps:
100-
- uses: actions/checkout@v3
131+
- name: Download build artifacts
132+
uses: actions/download-artifact@v3
101133
with:
102-
submodules: recursive
103-
fetch-depth: 0
104-
105-
- uses: actions/setup-python@v4
106-
with:
107-
python-version: 3.8
108-
- run: pip --disable-pip-version-check install wheel
134+
name: dist
135+
path: dist
109136

110-
- name: Build packages
111-
run: python setup.py sdist bdist_wheel
112137
- name: Publish to PyPI
113-
uses: pypa/gh-action-pypi-publish@master
114-
with:
115-
user: __token__
116-
password: ${{ secrets.PYPI_PASSWORD }}
138+
uses: pypa/gh-action-pypi-publish@release/v1

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
cxxheaderparser
22
===============
33

4-
**Note**: This is still a work in progress, but should be stable ~in a few weeks~
5-
once I port robotpy-build over to use it. Someday I'll do that, probably!
6-
74
A pure python C++ header parser that parses C++ headers in a mildly naive
85
manner that allows it to handle many C++ constructs, including many modern
96
(C++11 and beyond) features.
@@ -54,7 +51,9 @@ Install
5451

5552
Requires Python 3.6+, no non-stdlib dependencies if using Python 3.7+.
5653

57-
TODO: distribute on pip
54+
```
55+
pip install cxxheaderparser
56+
```
5857

5958
Usage
6059
-----

tests/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pytest
2+
pcpp~=1.30

0 commit comments

Comments
 (0)