Skip to content

Commit

Permalink
Merge pull request #379 from buffer/pypi-release
Browse files Browse the repository at this point in the history
[Github Actions] Publish Python distribution to PyPI
  • Loading branch information
buffer authored Apr 12, 2024
2 parents 4ee2285 + c851170 commit 4d2e9ac
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
name: Docker

on:
push:
release:
types: [published]
branches:
- master

jobs:
docker-build:
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish Python distribution to PyPI

on:
release:
types: [published]

jobs:
build:
name: Build distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Install pypa/build
run: |
python3 -m pip install build --user
- name: Build a source tarball
run: python3 -m build --sdist

- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: Publish Python distribution to PyPI
runs-on: ubuntu-latest
needs:
- build
environment:
name: pypi
url: https://pypi.org/p/thug
permissions:
id-token: write

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 4d2e9ac

Please sign in to comment.