Skip to content

Commit

Permalink
Add PyPI build/publish workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
valberg committed Sep 13, 2024
1 parent 5961225 commit 07404c9
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
---
name: Publish Python 🐍 distribution πŸ“¦ to TestPyPI

on: push
# We want to trigger on push (to deploy to TestPyPI) and on releases (to deploy to PyPI)
on:
push:
branches:
- main
tags:
- 'v*' # Push events to matching v*
release:
types:
- created

jobs:
build:
name: Build distribution πŸ“¦
name: Build πŸ“¦
runs-on: ubuntu-latest

steps:
Expand All @@ -28,7 +37,7 @@ jobs:
path: dist/

publish-to-pypi:
name: Publish Python 🐍 distribution πŸ“¦ to PyPI
name: "PyPI: Publish πŸš€"
if: startsWith(github.ref, 'refs/tags/v') # only publish to PyPI pushes of tags that start with 'v'
needs:
- build
Expand All @@ -49,7 +58,7 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1

publish-to-testpypi:
name: Publish Python 🐍 distribution πŸ“¦ to TestPyPI
name: "TestPyPi: Publish πŸ§ͺ"
needs:
- build
runs-on: ubuntu-latest
Expand Down

0 comments on commit 07404c9

Please sign in to comment.