From: Andrew Grimberg Date: Fri, 21 Apr 2023 13:43:25 +0000 (-0700) Subject: CI: Add release workflow X-Git-Tag: v0.1.0^0 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F12%2F71612%2F1;p=releng%2Fpython-one-password.git CI: Add release workflow Change-Id: Iba40840972220b079789954a6776bebe3892c2c9 Signed-off-by: Andrew Grimberg --- 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