Skip to content

Commit

Permalink
Merge pull request #12 from lsst-sqre/tickets/DM-35459
Browse files Browse the repository at this point in the history
[DM-35459] Publish to pypi on release
  • Loading branch information
cbanek authored Jul 11, 2022
2 parents 09c7d32 + c6a99c7 commit 61b987c
Showing 1 changed file with 40 additions and 1 deletion.
41 changes: 40 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
name: CI

"on": [push]
"on":
push:
branches-ignore:
# These should always correspond to pull requests, so ignore them for
# the push trigger and let them be triggered by the pull_request
# trigger, avoiding running the workflow twice. This is a minor
# optimization so there's no need to ensure this is comprehensive.
- "dependabot/**"
- "renovate/**"
- "tickets/**"
- "u/**"
tags:
- "*"
pull_request: {}

jobs:
test:
Expand Down Expand Up @@ -38,3 +51,29 @@ jobs:
- name: Run tox
run: tox -e py,coverage-report,typing
pypi:
runs-on: ubuntu-latest
needs: [test]
if: startsWith(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "setup.cfg"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel --universal
twine upload dist/*

0 comments on commit 61b987c

Please sign in to comment.