Skip to content

Commit e514b70

Browse files
authored
Merge pull request #257 from CastXML/build-release
ci: build releases in pypi
2 parents 8902812 + 0fe0d8b commit e514b70

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/tests.yml

+32
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ on:
33
branches:
44
- master
55
- develop
6+
release:
7+
types: [created]
68
pull_request:
9+
workflow_dispatch:
710

811
jobs:
912
tests:
@@ -241,3 +244,32 @@ jobs:
241244
run: |
242245
export PATH=~/castxml/bin:$PATH
243246
pytest tests
247+
248+
build-release:
249+
name: Build distribution 📦
250+
if: (github.event_name == 'release' && github.event.action == 'created') || (github.event_name == 'workflow_dispatch')
251+
needs: tests
252+
runs-on: ubuntu-latest
253+
254+
steps:
255+
- uses: actions/checkout@v4
256+
with:
257+
persist-credentials: false
258+
- name: Set up Python
259+
uses: actions/setup-python@v5
260+
with:
261+
python-version: "3.x"
262+
263+
- name: Install pypa/build
264+
run: >-
265+
python3 -m
266+
pip install
267+
build
268+
--user
269+
- name: Build a binary wheel and a source tarball
270+
run: python3 -m build
271+
- name: Store the distribution packages
272+
uses: actions/upload-artifact@v4
273+
with:
274+
name: python-package-distributions
275+
path: dist/

0 commit comments

Comments
 (0)