From 7536d8fcc55b2dc11d1bf3bb2bf229782f826f4c Mon Sep 17 00:00:00 2001 From: Andrew Grimberg Date: Fri, 21 Apr 2023 06:43:25 -0700 Subject: [PATCH] CI: Add release workflow Change-Id: Iba40840972220b079789954a6776bebe3892c2c9 Signed-off-by: Andrew Grimberg --- .github/workflows/release.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..3f3b734 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,27 @@ +--- +name: PyPI release + +# yamllint disable-line rule:truthy +on: push + +jobs: + publish: + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Configure Python + uses: actions/setup-python@v4 + with: + python-version: '3.8' + - name: Build package distribution files + run: >- + pipx run tox -e clean,build + - name: Configure TWINE + run: | + echo "TWINE_USERNAME=__token__" >> $GITHUB_ENV + echo "TWINE_PASSWORD=${{ secrets.PYPI_API_TOKEN }}" >> $GITHUB_ENV + - name: Publish to PyPI + run: >- + pipx run tox -e publish -- --repository pypi -- 2.16.6