Skip to content

Commit

Permalink
Merge pull request #136 from biglocalnews/setup.py
Browse files Browse the repository at this point in the history
Added system for deploying to PyPI via GitHub Actions
  • Loading branch information
zstumgoren authored Mar 22, 2022
2 parents 56069f6 + c715e14 commit 4e7fafe
Show file tree
Hide file tree
Showing 4 changed files with 190 additions and 91 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/continuous-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,65 @@ jobs:
- id: run
name: Run tests
run: pipenv run pytest -sv

test-build:
name: Build Python package
runs-on: ubuntu-latest
needs: [test-python]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install pipenv
run: pipx install pipenv

- uses: actions/setup-python@v2
with:
python-version: '3.7'
cache: 'pipenv'

- id: pipenv-install
name: Install Python dependencies
run: pipenv install --dev --python `which python`

- id: build
name: Build release
run: make build-release

- id: check
name: Check release
run: make check-release

- id: save
name: Save artifact
uses: actions/upload-artifact@v2
with:
name: test-release-${{ github.run_number }}
path: ./dist
if-no-files-found: error

tag-release:
name: Tagged PyPI release
runs-on: ubuntu-latest
needs: [test-build]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/setup-python@v2
with:
python-version: '3.9'

- id: fetch
name: Fetch artifact
uses: actions/download-artifact@v2
with:
name: test-release-${{ github.run_number }}
path: ./dist

- id: publish
name: Publish release
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
verify_metadata: false
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ typing-extensions = "*"
myst-parser = "*"
sphinx-autobuild = "*"
black = "*"
setuptools-scm = "*"

[requires]
python_version = "3.7"
188 changes: 98 additions & 90 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4e7fafe

Please sign in to comment.