From 943765b76c7c9cb6abe1bec48870b0c95332c061 Mon Sep 17 00:00:00 2001 From: Mike Lee Williams Date: Sat, 24 Apr 2021 21:49:37 -0700 Subject: [PATCH] Use Github CI to publish to PyPI --- .github/workflows/publish.yml | 43 +++++++++++++++++++++++++++++++++++ setup.cfg | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..828a4ae --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,43 @@ +name: Build and publish to PyPI + +on: + push: + branches: + - main + release: + types: + - published + +jobs: + publish: + if: github.repository == 'mikepqr/ambient-archiver' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: Install pypa/build + run: >- + python -m + pip install + build + --user + + - name: Build binary wheel and source tarball + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + + - name: Publish to PyPI + if: github.event.action == 'published' + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/setup.cfg b/setup.cfg index f4a4761..daef1b8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = ambient-archiver -version = 0.1.2 +version = 0.1.3 description = Archive your data from ambientweather.net long_description = file: README.md long_description_content_type = text/markdown