Skip to content

Commit

Permalink
[WIP] Added publication to pypi through actions (#131)
Browse files Browse the repository at this point in the history
* Added publication to pypi through actions

* Updated token name

* Skip existing
  • Loading branch information
neubig committed Feb 4, 2022
1 parent f936eb0 commit 4d2fc94
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/publish-to-pypi.yml
@@ -0,0 +1,39 @@
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI

on: push

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
skip_existing: true
password: ${{ secrets.TEST_PYPI_API_KEY }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_KEY }}

0 comments on commit 4d2fc94

Please sign in to comment.