From ab31d2af62ad23aee23473a9af0085749a177266 Mon Sep 17 00:00:00 2001 From: Cody Wang Date: Tue, 25 Aug 2020 19:35:25 -0700 Subject: [PATCH] infra: Automatically publish to PyPi (#54) --- .github/workflows/publish-to-pypi.yml | 26 ++++++++++++++++++++++++++ README.md | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish-to-pypi.yml diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml new file mode 100644 index 000000000..fa99300b7 --- /dev/null +++ b/.github/workflows/publish-to-pypi.yml @@ -0,0 +1,26 @@ +name: Publish distribution to PyPI + +on: + release: + types: [published] + +jobs: + build-and-publish: + name: Build and publish distribution to PyPi + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Install wheel + run: python -m pip install --user --upgrade wheel + - name: Install twine + run: python -m pip install --user --upgrade twine + - name: Build a binary wheel and a source tarball + run: python setup.py sdist bdist_wheel + - name: Publish distribution to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.pypi_token }} diff --git a/README.md b/README.md index 064680fc2..7af6906cc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## Amazon Braket Python Schemas +# Amazon Braket Python Schemas [![Latest Version](https://img.shields.io/pypi/v/amazon-braket-schemas.svg)](https://pypi.python.org/pypi/amazon-braket-schemas) [![Supported Python Versions](https://img.shields.io/pypi/pyversions/amazon-braket-schemas.svg)](https://pypi.python.org/pypi/amazon-braket-schemas)