Skip to content

Commit

Permalink
Adding Github action to automatically publish to pypi
Browse files Browse the repository at this point in the history
Publishing id3c to pypi will help standardize how this package is being
installed compared to other dependencies. This will make the package simpler
include in multiple applications and pin to a specific version when needed.

One workflow change this will require is that commits on master branch will need to
be tagged to be published to pypi.org (whereas all commits on master branch will be
published to test.pypi.org). A version naming convention will need to be
decided on and integrated into the deployment workflow, but the specific format
chosen will not impact this PR.
  • Loading branch information
davereinhart committed Nov 29, 2021
1 parent bed2a21 commit 0e2a611
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CD

on: push

jobs:
build-n-publish:
name: Build and publish Python distributions to PyPI and TestPyPI
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
- name: Set up Python 3.6
uses: actions/setup-python@v1
with:
python-version: 3.6
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ Thumbs.db

# IDE files
/.vscode

# Build and dist files
build/
dist/

0 comments on commit 0e2a611

Please sign in to comment.