Skip to content

Commit

Permalink
gh actions: update deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianHofmann committed Sep 2, 2022
1 parent 622825e commit e55d3e8
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,34 @@ name: Deploy Package
on: [push]

jobs:
build:

runs-on: ubuntu-latest
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: casperdcl/deploy-pypi@v2
- uses: actions/checkout@master
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9

- 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 PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_TOKEN }}
pip: wheel -w dist/ --no-deps .
# only upload if a tag is pushed (otherwise just build & check)
upload: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') }}

0 comments on commit e55d3e8

Please sign in to comment.