-
-
Notifications
You must be signed in to change notification settings - Fork 142
44 lines (39 loc) · 1.34 KB
/
releasing.yml
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
43
44
name: PyPI Release
on:
push:
branches: [main]
tags: ["v?[0-9]+.[0-9]+.[0-9]+"]
pull_request:
branches: [main]
release:
types: [published]
jobs:
# based on https://github.com/pypa/gh-action-pypi-publish
release-pkg:
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Set up Python 🐍
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Create package 📦
run: |
pip install "twine==5.1.1" setuptools wheel
python setup.py sdist bdist_wheel
ls -lh dist/
twine check dist/*
- name: Upload to release
if: github.event_name == 'release'
uses: AButler/upload-release-assets@v3.0
with:
files: "dist/*"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish distribution 📦 to PyPI
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@v1.12.2
with:
user: __token__
password: ${{ secrets.pypi_password }}