-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (85 loc) · 2.3 KB
/
release.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
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
99
100
101
name: release
on:
push:
branches:
- main
tags:
- "v*"
pull_request:
branches:
- main
jobs:
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all tags and branches
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install Dependencies
run: python -m pip install --upgrade build twine
- name: Build sdist
run: make dist
- uses: actions/upload-artifact@v4
with:
name: release
path: dist/
publish-to-TestPyPI:
needs: sdist
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: release
path: dist/
- name: List dist/ Folder
run: ls dist/ -l
- name: Publish to TestPyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
verbose: true
publish-to-PyPI:
needs: sdist
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: release
path: dist/
- name: List dist/ Folder
run: ls dist/ -l
- name: Publish to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
publish-to-GitHub:
needs: sdist
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: release
path: dist/
- name: List dist/ Folder
run: ls dist/ -l
- name: Get Asset name
run: |
export PKG=$(ls dist/ | grep tar)
set -- $PKG
echo "name=$1" >> $GITHUB_ENV
- name: Publish to GitHub
uses: softprops/action-gh-release@v2
with:
draft: true
prerelease: ${{ contains(github.ref, 'rc') }}
files: dist/${{ env.name }}