Skip to content

Commit

Permalink
chore: use official pypi GH action and pypi API token
Browse files Browse the repository at this point in the history
  • Loading branch information
phantomas1234 committed Oct 12, 2021
1 parent 8561689 commit 094c7d6
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,28 +61,12 @@ jobs:
python-version: [3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
python-version: ${{ matrix.python-version }}
- name: Get tag
id: tag
run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install twine
- name: Build package
run: python setup.py sdist bdist_wheel
- name: Check the package
run: twine check dist/*
- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run:
twine upload --verbose -u TWINE_USERNAME -p TWINE_PASSWORD --skip-existing --non-interactive dist/*
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Create GitHub release
uses: actions/create-release@v1
env:
Expand Down

0 comments on commit 094c7d6

Please sign in to comment.