summaryrefslogtreecommitdiffstatshomepage
path: root/.github
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-05-20 10:30:44 +0200
committerEgor Tensin <egor@tensin.name>2026-05-20 10:30:44 +0200
commit0b3b7e676ce35080bd6a9a094bd6363bc39de612 (patch)
tree475479bc89500553314c30bc1284b49a97a244ba /.github
parentformat .pylintrc (diff)
downloadcmake-common-0b3b7e676ce35080bd6a9a094bd6363bc39de612.tar.gz
cmake-common-0b3b7e676ce35080bd6a9a094bd6363bc39de612.zip
workflows: split out the PyPI publishing workflow
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/basic.yml34
-rw-r--r--.github/workflows/publish.yml43
2 files changed, 43 insertions, 34 deletions
diff --git a/.github/workflows/basic.yml b/.github/workflows/basic.yml
index 8e315b3..8a8dd04 100644
--- a/.github/workflows/basic.yml
+++ b/.github/workflows/basic.yml
@@ -104,37 +104,3 @@ jobs:
project-build --boost boost/ --install install/ -- test/examples/boost/ build/
- name: Run example project
run: ./test/examples/boost/run.ps1 ./install/bin/foo
-
- # Build a Python package and upload to PyPI.
- publish:
- # TODO: figure out how to add a dependency on the *toolsets workflows.
- needs: [lint, os, python-versions]
- runs-on: ubuntu-latest
- name: Publish
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
- - name: Set up Python
- uses: actions/setup-python@v6
- with:
- python-version: '3.x'
- - name: Verify package can be installed
- run: pip install -q .
- - name: Install package builder
- run: pip install -q --upgrade build
- - name: Build package
- run: python -m build
- - name: Publish as artifact
- uses: actions/upload-artifact@v7
- with:
- name: dist
- path: dist
- if-no-files-found: error
- - name: Publish to PyPI
- if: startsWith(github.ref, 'refs/tags/')
- uses: pypa/gh-action-pypi-publish@release/v1
- with:
- user: __token__
- password: '${{ secrets.PYPI_API_TOKEN }}'
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
new file mode 100644
index 0000000..6d1c560
--- /dev/null
+++ b/.github/workflows/publish.yml
@@ -0,0 +1,43 @@
+name: Publish
+
+on:
+ workflow_run:
+ workflows:
+ - Basic
+ - Boost (toolsets)
+ - Examples (toolsets)
+ types: [completed]
+
+jobs:
+ # Build a Python package and upload to PyPI.
+ publish:
+ runs-on: ubuntu-latest
+ if: github.event.workflow_run.conclusion == 'success'
+ name: Publish
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Set up Python
+ uses: actions/setup-python@v6
+ with:
+ python-version: '3.x'
+ - name: Verify package can be installed
+ run: pip install -q .
+ - name: Install package builder
+ run: pip install -q --upgrade build
+ - name: Build package
+ run: python -m build
+ - name: Publish as artifact
+ uses: actions/upload-artifact@v7
+ with:
+ name: dist
+ path: dist
+ if-no-files-found: error
+ - name: Publish to PyPI
+ if: startsWith(github.ref, 'refs/tags/')
+ uses: pypa/gh-action-pypi-publish@release/v1
+ with:
+ user: __token__
+ password: '${{ secrets.PYPI_API_TOKEN }}'