Skip to content

Commit

Permalink
Create pypi.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
BvB93 committed Apr 26, 2023
1 parent 0e9b4c6 commit 8354649
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Publish

on:
release:
types: [published]
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: pip install build twine

- name: Python info
run: |
which python
python --version
- name: Installed packages
run: pip list

- name: Build the package
run: python -m build --sdist --wheel

- name: Validate wheels
run: |
tree dist
twine check dist/*
- uses: actions/upload-artifact@v3
with:
name: wheels
path: ./build/*

- name: Publish the package
if: github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}

- name: Attach wheels to GitHub release
if: github.event_name == 'release'
uses: AButler/upload-release-assets@v2.0.2
with:
files: 'dist/*'
repo-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 8354649

Please sign in to comment.