-
Notifications
You must be signed in to change notification settings - Fork 3
42 lines (35 loc) · 980 Bytes
/
pypi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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