From afdda24d0af30d8234a8925c20804fcf16faa63c Mon Sep 17 00:00:00 2001 From: Jagan Prem Date: Fri, 8 Dec 2023 01:42:21 -0800 Subject: [PATCH 1/7] Remove condition on build workflow --- .github/workflows/build.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e14c59f..89feb24 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,10 +5,6 @@ on: branches: - master pull_request: - # don't rebuild when only modifying other workflows - paths: - - '!.github/workflows/**' - - '.github/workflows/build.yml' jobs: build-wheels: @@ -74,7 +70,7 @@ jobs: check: name: All wheels built successfully - if: success() || failure() + if: always() needs: - build-wheels runs-on: ubuntu-latest @@ -87,7 +83,9 @@ jobs: publish: name: Publish package distributions to PyPI runs-on: ubuntu-latest - needs: [build-wheels, build-sdist] + needs: + - build-wheels + - build-sdist permissions: id-token: write if: github.event_name == 'release' && github.event.action == 'published' From 3887d2bccf864a4652d057580e75a94959f7e635 Mon Sep 17 00:00:00 2001 From: Jagan Prem Date: Fri, 8 Dec 2023 01:44:00 -0800 Subject: [PATCH 2/7] Disable concurrency for build workflow --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 89feb24..b3ffd03 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,10 @@ on: - master pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: build-wheels: name: Build wheels for ${{ matrix.pyver }} on ${{ matrix.platform.os }} ${{ matrix.platform.arch }} From 447ef96e7433e881ae8d553a486abc54dbd11131 Mon Sep 17 00:00:00 2001 From: Jagan Prem Date: Fri, 8 Dec 2023 01:51:00 -0800 Subject: [PATCH 3/7] Change step names --- .github/workflows/build.yml | 8 ++++---- .github/workflows/pypi.test.yml | 6 +++--- .github/workflows/version.yml | 9 ++++++--- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b3ffd03..cf23c59 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,7 +63,8 @@ jobs: - uses: actions/setup-python@v4 - - run: | + - name: Build source distribution + run: | python -m pip install --upgrade pip pip install build python -m build --sdist @@ -85,7 +86,7 @@ jobs: jobs: ${{ toJSON(needs) }} publish: - name: Publish package distributions to PyPI + name: Publish package runs-on: ubuntu-latest needs: - build-wheels @@ -95,8 +96,7 @@ jobs: if: github.event_name == 'release' && github.event.action == 'published' steps: - - name: Download artifact - id: download-artifact + - id: download-artifact uses: actions/download-artifact@v3 with: name: artifact diff --git a/.github/workflows/pypi.test.yml b/.github/workflows/pypi.test.yml index 943f618..abb6771 100644 --- a/.github/workflows/pypi.test.yml +++ b/.github/workflows/pypi.test.yml @@ -4,13 +4,13 @@ on: workflow_dispatch jobs: pypi-publish: - name: Upload release to PyPI + name: Publish package to TestPyPI runs-on: ubuntu-latest permissions: id-token: write steps: - - name: Download artifact + - name: Download build artifact id: download-artifact uses: dawidd6/action-download-artifact@v2 with: @@ -19,7 +19,7 @@ jobs: path: dist name: artifact - - name: Publish package distributions to PyPI + - name: Publish package distributions to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index 0073576..e7b6114 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -18,7 +18,8 @@ jobs: with: submodules: recursive - - id: new-version + - name: Retrieve new version number + id: new-version run: | echo "version=$(python setup.py --version)" >> "$GITHUB_OUTPUT" @@ -27,11 +28,13 @@ jobs: submodules: recursive ref: ${{ github.base_ref }} - - id: target-version + - name: Retrieve target branch version number + id: target-version run: | echo "version=$(python setup.py --version)" >> "$GITHUB_OUTPUT" - - env: + - name: Compare version numbers + env: NEW_VERSION: ${{ steps.new-version.outputs.version }} TARGET_VERSION: ${{ steps.target-version.outputs.version }} run: | From df698b51477a255413692a36f977911b17df0cf5 Mon Sep 17 00:00:00 2001 From: Jagan Prem Date: Fri, 8 Dec 2023 01:51:14 -0800 Subject: [PATCH 4/7] Update version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b09a6ef..1df3989 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "vibrio" -version = "0.1.2" +version = "0.1.3" readme = "README.md" requires-python = ">=3.9" license = { file = "LICENSE" } From d01d1b44d79319c3bb8a977d8eccdd901d81411c Mon Sep 17 00:00:00 2001 From: Jagan Prem Date: Fri, 8 Dec 2023 01:57:21 -0800 Subject: [PATCH 5/7] Simplify matrix check --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cf23c59..4bb8daf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -81,9 +81,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: re-actors/alls-green@release/v1 - with: - jobs: ${{ toJSON(needs) }} + - name: Check build matrix status + if: failure() + run: exit 1 publish: name: Publish package From b84f91195ba8459bb041f2cb8a70bd26fa150a4a Mon Sep 17 00:00:00 2001 From: Jagan Prem Date: Fri, 8 Dec 2023 02:00:21 -0800 Subject: [PATCH 6/7] Fix python version for sdist --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4bb8daf..5cbae49 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,10 +62,11 @@ jobs: submodules: recursive - uses: actions/setup-python@v4 + with: + python-version: '3.10' - name: Build source distribution run: | - python -m pip install --upgrade pip pip install build python -m build --sdist From aa2aa791c570b40f1767cd3cd525099b718e3e61 Mon Sep 17 00:00:00 2001 From: Jagan Prem Date: Fri, 8 Dec 2023 02:02:33 -0800 Subject: [PATCH 7/7] Fail check on cancellation --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5cbae49..26b19e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -83,7 +83,7 @@ jobs: steps: - name: Check build matrix status - if: failure() + if: failure() || cancelled() run: exit 1 publish: