From 4d483cf4df99de78d42926d767104c4df5081fda Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 20 May 2026 10:52:57 +0200 Subject: workflows: rework the publish workflow For some reason, when using workflow_run: trigger, it gets triggered on any listed workflow, not on all of them as I would expect. --- .github/workflows/basic.yml | 8 +---- .github/workflows/boost_download.yml | 8 +---- .github/workflows/boost_toolsets.yml | 8 +---- .github/workflows/ci.yml | 63 ++++++++++++++++++++++++++++++++++ .github/workflows/example_toolsets.yml | 8 +---- .github/workflows/msvc_versions.yml | 8 +---- .github/workflows/publish.yml | 43 ----------------------- 7 files changed, 68 insertions(+), 78 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/publish.yml (limited to '.github/workflows') diff --git a/.github/workflows/basic.yml b/.github/workflows/basic.yml index 8a8dd04..7c7cf65 100644 --- a/.github/workflows/basic.yml +++ b/.github/workflows/basic.yml @@ -1,13 +1,7 @@ name: Basic usage on: - push: - paths-ignore: - - 'docs/**' - - 'README.md' - schedule: - # Weekly, at 01:30 AM on Friday (somewhat randomly chosen). - - cron: '30 01 * * 5' + workflow_call: workflow_dispatch: jobs: diff --git a/.github/workflows/boost_download.yml b/.github/workflows/boost_download.yml index 7df4ca7..5e7d31f 100644 --- a/.github/workflows/boost_download.yml +++ b/.github/workflows/boost_download.yml @@ -1,13 +1,7 @@ name: Boost (download) on: - push: - paths-ignore: - - 'docs/**' - - 'README.md' - schedule: - # Weekly, at 01:30 AM on Friday (somewhat randomly chosen). - - cron: '30 01 * * 5' + workflow_call: workflow_dispatch: jobs: diff --git a/.github/workflows/boost_toolsets.yml b/.github/workflows/boost_toolsets.yml index 49df22f..57577b4 100644 --- a/.github/workflows/boost_toolsets.yml +++ b/.github/workflows/boost_toolsets.yml @@ -1,13 +1,7 @@ name: Boost (toolsets) on: - push: - paths-ignore: - - 'docs/**' - - 'README.md' - schedule: - # Weekly, at 01:30 AM on Friday (somewhat randomly chosen). - - cron: '30 01 * * 5' + workflow_call: workflow_dispatch: jobs: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..28c9ea5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,63 @@ +name: CI + +on: + push: + paths-ignore: + - 'docs/**' + - 'README.md' + schedule: + # Weekly, at 01:30 AM on Friday (somewhat randomly chosen). + - cron: '30 01 * * 5' + workflow_dispatch: + +jobs: + basic: + uses: ./.github/workflows/basic.yml + + boost_download: + uses: ./.github/workflows/boost_download.yml + + boost_toolsets: + uses: ./.github/workflows/boost_toolsets.yml + + example_toolsets: + uses: ./.github/workflows/example_toolsets.yml + + msvc_versions: + uses: ./.github/workflows/msvc_versions.yml + + # Build a Python package and upload to PyPI. + publish: + runs-on: ubuntu-latest + needs: + - basic + - boost_toolsets + - example_toolsets + 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/example_toolsets.yml b/.github/workflows/example_toolsets.yml index 18a55d1..0fdbe05 100644 --- a/.github/workflows/example_toolsets.yml +++ b/.github/workflows/example_toolsets.yml @@ -1,13 +1,7 @@ name: Examples (toolsets) on: - push: - paths-ignore: - - 'docs/**' - - 'README.md' - schedule: - # Weekly, at 01:30 AM on Friday (somewhat randomly chosen). - - cron: '30 01 * * 5' + workflow_call: workflow_dispatch: jobs: diff --git a/.github/workflows/msvc_versions.yml b/.github/workflows/msvc_versions.yml index 9b28f83..7bd28f0 100644 --- a/.github/workflows/msvc_versions.yml +++ b/.github/workflows/msvc_versions.yml @@ -1,13 +1,7 @@ name: Visual Studio versions on: - push: - paths-ignore: - - 'docs/**' - - 'README.md' - schedule: - # Weekly, at 01:30 AM on Friday (somewhat randomly chosen). - - cron: '30 01 * * 5' + workflow_call: workflow_dispatch: jobs: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 6d1c560..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,43 +0,0 @@ -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 }}' -- cgit v1.3