-
-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (79 loc) · 2.24 KB
/
release.yaml
File metadata and controls
98 lines (79 loc) · 2.24 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: release
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # Fetch all history for all tags and branches
- uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Install Dependencies
run: python -m pip install --upgrade pip setuptools wheel twine
- name: Build sdist
run: |
python setup.py sdist bdist_wheel
twine check --strict dist/*
ls -l dist
- name: Get Source Tarball Name
id: tar
run: |
export type=tar
export file=$(ls dist/ | grep ${type})
echo "::set-output name=file::${file}"
- name: Get Binary Wheel Name
id: whl
run: |
export type=whl
export file=$(ls dist/ | grep ${type})
echo "::set-output name=file::${file}"
- uses: actions/upload-artifact@v4
with:
name: release
path: dist/
outputs:
tar: ${{ steps.tar.outputs.file }}
whl: ${{ steps.whl.outputs.file }}
publish-to-github:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # Fetch all history for all tags and branches
- uses: actions/download-artifact@v6
with:
name: release
path: dist/
- name: List dist/ Folder
run: ls dist/ -l
- name: Upload Release Asset to GitHub
uses: softprops/action-gh-release@v2
with:
draft: true
prerelease: ${{ contains(github.ref, 'rc') }}
files: dist/${{ needs.build.outputs.tar }}
publish-to-pypi:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # Fetch all history for all tags and branches
- uses: actions/download-artifact@v6
with:
name: release
path: dist/
- name: List dist/ Folder
run: ls dist/ -l
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.13.0
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true