-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (35 loc) · 1.11 KB
/
deploy.yml
File metadata and controls
44 lines (35 loc) · 1.11 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
name: Build and Release
on:
workflow_dispatch:
jobs:
build-and-release:
runs-on: ubuntu-latest
permissions:
contents: write # required to create a release
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Install build tools
run: |
pip install --upgrade pip setuptools wheel build
- name: Extract version from pyproject.toml
id: get_version
run: |
VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Build package
run: |
python -m build
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.get_version.outputs.version }}
name: Release v${{ steps.get_version.outputs.version }}
files: |
dist/*.whl
dist/*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}