From 52ea7a0aa676d4d9c7139921ed18cd124b241cb1 Mon Sep 17 00:00:00 2001 From: Bela Stoyan Date: Thu, 23 May 2024 14:51:52 +0200 Subject: [PATCH] cleanup build.yml --- .github/workflows/build.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b2edd9..414ea76 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,10 +1,14 @@ name: Build on: - push: - branches: [main] pull_request: -permissions: - contents: write + push: + branches: + - "main" + tags: + - "v*" + release: + types: + - published jobs: build: @@ -25,12 +29,11 @@ jobs: release: name: Publish package - if: github.event_name == 'push' && github.ref_name == 'main' + if: github.event_name == 'release' && github.event.action == 'published' needs: [build] runs-on: ubuntu-latest permissions: id-token: write - contents: write environment: pypi steps: - uses: actions/download-artifact@v4 @@ -43,4 +46,3 @@ jobs: repository-url: https://test.pypi.org/legacy/ - name: Publish package on PyPi uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 - - uses: actions/checkout@v4