Skip to content

Commit 551396d

Browse files
committedMar 14, 2025··
Merge branch 'develop'
2 parents 10d62ac + d9b47e2 commit 551396d

File tree

4 files changed

+103
-5
lines changed

4 files changed

+103
-5
lines changed
 

‎.github/workflows/tests.yml

+95-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
on:
22
push:
33
branches:
4-
- main
54
- master
65
- develop
76
pull_request:
@@ -242,3 +241,98 @@ jobs:
242241
run: |
243242
export PATH=~/castxml/bin:$PATH
244243
pytest tests
244+
245+
build:
246+
name: Build distribution 📦
247+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
248+
needs: tests
249+
runs-on: ubuntu-latest
250+
251+
steps:
252+
- uses: actions/checkout@v4
253+
with:
254+
persist-credentials: false
255+
- name: Set up Python
256+
uses: actions/setup-python@v5
257+
with:
258+
python-version: "3.x"
259+
260+
- name: Install pypa/build
261+
run: >-
262+
python3 -m
263+
pip install
264+
build
265+
--user
266+
- name: Build a binary wheel and a source tarball
267+
run: python3 -m build
268+
- name: Store the distribution packages
269+
uses: actions/upload-artifact@v4
270+
with:
271+
name: python-package-distributions
272+
path: dist/
273+
274+
publish-to-pypi:
275+
name: >-
276+
Publish Python 🐍 distribution 📦 to PyPI
277+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
278+
needs:
279+
- build
280+
runs-on: ubuntu-latest
281+
environment:
282+
name: pypi
283+
url: https://pypi.org/p/<package-name> # Replace <package-name> with your PyPI project name
284+
permissions:
285+
id-token: write # IMPORTANT: mandatory for trusted publishing
286+
287+
steps:
288+
- name: Download all the dists
289+
uses: actions/download-artifact@v4
290+
with:
291+
name: python-package-distributions
292+
path: dist/
293+
- name: Publish distribution 📦 to PyPI
294+
uses: pypa/gh-action-pypi-publish@release/v1
295+
296+
github-release:
297+
name: >-
298+
Sign the Python 🐍 distribution 📦 with Sigstore
299+
and upload them to GitHub Release
300+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
301+
needs:
302+
- publish-to-pypi
303+
runs-on: ubuntu-latest
304+
305+
permissions:
306+
contents: write # IMPORTANT: mandatory for making GitHub Releases
307+
id-token: write # IMPORTANT: mandatory for sigstore
308+
309+
steps:
310+
- name: Download all the dists
311+
uses: actions/download-artifact@v4
312+
with:
313+
name: python-package-distributions
314+
path: dist/
315+
- name: Sign the dists with Sigstore
316+
uses: sigstore/gh-action-sigstore-python@v3.0.0
317+
with:
318+
inputs: >-
319+
./dist/*.tar.gz
320+
./dist/*.whl
321+
- name: Create GitHub Release
322+
env:
323+
GITHUB_TOKEN: ${{ github.token }}
324+
run: >-
325+
gh release create
326+
"$GITHUB_REF_NAME"
327+
--repo "$GITHUB_REPOSITORY"
328+
--notes ""
329+
- name: Upload artifact signatures to GitHub Release
330+
env:
331+
GITHUB_TOKEN: ${{ github.token }}
332+
# Upload to GitHub Release using the `gh` CLI.
333+
# `dist/` contains the built packages, and the
334+
# sigstore-produced signatures and certificates.
335+
run: >-
336+
gh release upload
337+
"$GITHUB_REF_NAME" dist/**
338+
--repo "$GITHUB_REPOSITORY"

‎CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changes
22
=======
33

4+
Version 3.0.1
5+
-------------
6+
7+
1. Build and sign wheels using Github Actions CI, see https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
8+
This is a way better way to distribute our wheels as it prevents supply chain attacks.
9+
410
Version 3.0.0
511
-------------
612

‎README.rst

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
pygccxml
22
========
33

4-
.. image:: https://codecov.io/gh/iMichka/pygccxml/branch/develop/graph/badge.svg
5-
:target: https://codecov.io/gh/iMichka/pygccxml
6-
:alt: Code coverage status
74
.. image:: https://readthedocs.org/projects/pygccxml/badge/?version=develop
85
:target: http://pygccxml.readthedocs.io/en/develop/?badge=develop
96
:alt: Documentation status

‎pyproject.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ authors = [
1010
{name = "Insight Software Consortium", email = "castxml@public.kitware.com"},
1111
{name = "Roman Yakovenko", email = "romanyakovenko@gmail.com"},
1212
]
13+
readme = "README.rst"
1314
license = {file = "LICENSE.rst"}
1415
keywords = [
1516
"C++",
@@ -18,7 +19,7 @@ keywords = [
1819
"CastXML",
1920
"gccxml",
2021
]
21-
version = "3.0.0"
22+
version = "3.0.1"
2223

2324
classifiers = [
2425
"Development Status :: 5 - Production/Stable",

0 commit comments

Comments
 (0)
Please sign in to comment.