-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.47 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
name: Release
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+a[0-9]*'
- '[0-9]+.[0-9]+.[0-9]+b[0-9]*'
- '[0-9]+.[0-9]+.[0-9]+rc[0-9]*'
- '[0-9]+.[0-9]+.[0-9]+.post[0-9]*'
- '[0-9]+.[0-9]+.[0-9]+.dev[0-9]*'
jobs:
build-project:
name: Build Project 🧱
uses: ./.github/workflows/build.yaml
secrets: inherit
permissions:
contents: read
create_release:
needs: build-project
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip build twine
- name: Build source distribution
run: python -m build --sdist
- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
name: Release ${{ github.ref_name }}
draft: false
prerelease: false
files: |
dist/*.tar.gz
*/*.whl
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m twine upload */*.whl