Skip to content

Publish package

Publish package #10

Workflow file for this run

name: Publish package
on:
workflow_dispatch:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@master
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install packages
run: |
python -m pip install build twine
- name: Build
run: |
python -m build
- name: Attach binaries
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
dist/*
- name: Upload to PyPi
if: startsWith(github.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1