Skip to content

Commit

Permalink
Update publish-to-test-pypi.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
yury-lysogorskiy authored Oct 24, 2022
1 parent 41f1d89 commit 296f1f2
Showing 1 changed file with 30 additions and 22 deletions.
52 changes: 30 additions & 22 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,39 @@
name: Publish to TestPyPI
on: push
name: PyPi Release

on:
push:
pull_request:
workflow_dispatch:

# based on https://github.com/pypa/gh-action-pypi-publish
jobs:
build-n-publish:
name: Build and publish Python distributions to TestPyPI
runs-on: ubuntu-18.04
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Set up Python 3.8
uses: actions/setup-python@v1
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install pypa/build
python-version: "3.10"

- name: Install dependencies
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
python -m pip install --user --upgrade setuptools wheel
- name: Convert dependencies
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
sed -i 's/==/>=/g' setup.py; cat setup.py
- name: Build
run: >-
python setup.py sdist bdist_wheel
# - name: Publish distribution 📦 to PyPI
# if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
# uses: pypa/gh-action-pypi-publish@master
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}

- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
Expand Down

0 comments on commit 296f1f2

Please sign in to comment.