-
Notifications
You must be signed in to change notification settings - Fork 7
56 lines (48 loc) · 1.37 KB
/
release_to_pypi.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
45
46
47
48
49
50
51
52
53
54
55
56
name: Package Release to PyPI
on:
push:
tags:
- "v*"
jobs:
build-n-publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install pypa/build
run: >-
python -m
pip install build
- name: Build a binary wheel
run: >-
python -m build
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Get Asset name
if: success() || failure()
run: |
export PKG=$(ls dist/ | grep tar)
set -- $PKG
echo "asset_name=$1" >> $GITHUB_ENV
- name: Create GitHub Release
if: success() || failure()
id: create_release
uses: softprops/action-gh-release@v2
with:
name: ${{ github.ref }}
tag_name: ${{ github.ref }}
files: |
dist/${{ env.asset_name }}
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token