Skip to content

Commit

Permalink
Feature - PyPI publish GitHub Actions (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
khaitruong922 authored Apr 7, 2022
1 parent 810ea8a commit e7be9c7
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Publish package

on:
workflow_dispatch:

jobs:
publish-to-pypi:
environment: production
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python setup.py build_py && python -m build

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

- name: Install package from PyPI
run: pip install ${{ github.event.repository.name }}

0 comments on commit e7be9c7

Please sign in to comment.