Skip to content

Commit

Permalink
Add Github Actions workflow to build and publish sdist and wheel to PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
flozz committed Dec 1, 2021
1 parent ffd3549 commit 74182af
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/python-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: "Build and Publish Python Packages"

on:
push:
tags: "v[0-9]+.[0-9]+.[0-9]+"

jobs:

build_sdist_wheel:

name: "Source and wheel distribution"
runs-on: ubuntu-latest

steps:

- name: "Checkout the repository"
uses: actions/checkout@v2

- name: "Set up Python"
uses: actions/setup-python@v1
with:
python-version: 3.9

- name: "Install Python build dependencies"
run: |
pip install wheel nox
- name: "Build source distribution"
run: |
python setup.py sdist
- name: "Build wheel"
run: |
python setup.py bdist_wheel
- name: "Upload artifacts"
uses: actions/upload-artifact@v2
with:
name: rivalcfg-dist
path: dist/
retention-days: 1

publish_pypi:

name: "Publish packages on PyPI"
runs-on: ubuntu-latest
needs:
- build_sdist_wheel

steps:

- name: "Download artifacts"
uses: actions/download-artifact@v2

- name: "Move packages to the dist/ folder"
run: |
mkdir dist/
mv rivalcfg-dist/* dist/
- name: "Publish packages on PyPI"
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 74182af

Please sign in to comment.