-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (49 loc) · 1.43 KB
/
Copy pathrelease.yml
File metadata and controls
52 lines (49 loc) · 1.43 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
name: Release — Build Wheel & GitHub Release
on:
push:
tags: ['v*']
permissions:
contents: write
jobs:
build-wheel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-release-${{ hashFiles('pyproject.toml') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install build deps
run: |
python -m pip install --upgrade pip
pip install build
- name: Build wheel
run: python -m build --wheel
- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: wheel
path: dist/*.whl
- name: Generate release notes
id: release_notes
run: |
if [ -f CHANGELOG.md ]; then
echo "notes<<EOF" >> $GITHUB_OUTPUT
head -80 CHANGELOG.md >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
else
echo "notes=Release ${{ github.ref_name }}" >> $GITHUB_OUTPUT
fi
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: dist/*.whl
body: ${{ steps.release_notes.outputs.notes }}
generate_release_notes: true
draft: false
prerelease: false