Skip to content

Commit

Permalink
cleanup build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbe7a committed May 23, 2024
1 parent d9d734f commit 52ea7a0
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand All @@ -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

0 comments on commit 52ea7a0

Please sign in to comment.