Skip to content

Commit

Permalink
Create python-pypi-publish.yaml (#39)
Browse files Browse the repository at this point in the history
Signed-off-by: Bradley Reynolds <bradley.reynolds@darbia.dev>
  • Loading branch information
shenanigansd authored Oct 10, 2023
1 parent f73bac9 commit 21be6fb
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/python-pypi-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "Publish Python 🐍 distributions 📦 to PyPI"

on:
release:
types: [released]

jobs:
build-publish:
name: "Build and publish Python 🐍 distributions 📦 to PyPI"
runs-on: ubuntu-latest
permissions:
id-token: write

steps:
- name: "Checkout repository"
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

- name: "Set up Python 3.x"
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: "3.x"
cache: "pip"
cache-dependency-path: "pyproject.toml"

- name: "Install pypa/build"
run: >-
python -m
pip install
build
--user
- name: "Build a binary wheel and a source tarball"
run: >-
python -m
build
--outdir dist/
- name: "Upload packages"
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: packages
path: dist

- name: "Publish distribution 📦 to PyPI"
uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e # v1.8.10
with:
skip-existing: true
verbose: true
print-hash: true

0 comments on commit 21be6fb

Please sign in to comment.