From abdca643a4f2a489f5259d4394e75f52dfa93ed0 Mon Sep 17 00:00:00 2001 From: Aedial Date: Wed, 24 May 2023 18:37:09 +0200 Subject: [PATCH] [MISC] Add github workflow to publish on Pypi --- .github/workflows/publish.yaml | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..8b92b21 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,35 @@ +name: Pypi publish + +on: + push: + tags: + - "v*" + +jobs: + publish: + environment: Pypi + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Exit if not on master branch + if: endsWith(github.ref, 'master') == false + run: exit -1 + + - name: Build and publish to pypi + uses: JRubics/poetry-publish@v1.16 + with: + ignore_dev_requirements: "yes" + pypi_token: ${{ secrets.PYPI_TOKEN }} + + - id: pypi-size + run: stat -c "%s" dist/*.tar.gz | numfmt --to=iec --suffix=B --format="%.2f" + + - name: Create repo size badge + uses: RubbaBoy/BYOB@v1.3.0 + with: + NAME: pypi-size + LABEL: "package size" + ICON: "pypi" + STATUS: ${{ steps.date.outputs.data }} + COLOR: blue