Skip to content

Commit

Permalink
Publish Python to PyPI in pythonapp.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
zmalkmus authored Apr 5, 2024
1 parent f05c2f9 commit 98f69eb
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
on:
push:
branches: [ "master", "develop", "unittesting" ]
pull_request:
branches: [ "master" ]
name: Python application

on: [push, pull_request]

jobs:
build:
Expand Down Expand Up @@ -47,25 +45,17 @@ jobs:
# pip install flake8 # specify flake8 to avoid unknown error
# # stop the build if there are Python syntax errors or undefined names
# flake8 .

publish-to-pypi:
name: Publish Python distribution to PyPI
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
needs:
- build
- build
- test
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/agvis/
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1


- name: Publish Python dist to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}

0 comments on commit 98f69eb

Please sign in to comment.