Skip to content

Commit

Permalink
[MISC] Add github workflow to publish on Pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
Aedial committed May 24, 2023
1 parent e62aaf1 commit abdca64
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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/[email protected]
with:
NAME: pypi-size
LABEL: "package size"
ICON: "pypi"
STATUS: ${{ steps.date.outputs.data }}
COLOR: blue

0 comments on commit abdca64

Please sign in to comment.