-
Notifications
You must be signed in to change notification settings - Fork 63
36 lines (34 loc) · 1.07 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
name: Build and Attach Wheel to GitHub Release
on:
push:
tags:
- 'release/v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install Poetry
run: pip install poetry
- name: Get the version from pyproject.toml
run: echo "VERSION=$(poetry version -s)" >> $GITHUB_ENV
- name: Build Wheel
run: poetry build -f wheel
- name: Extract Changelog for the Version
run: |
VERSION=${{ env.VERSION }}
CHANGELOG=$(awk '/^## \['"${VERSION//./\\.}"'\]/ {flag=1; next} /^## \[/ {flag=0} flag' CHANGELOG.md)
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
echo "$CHANGELOG" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Upload Wheel to Release
uses: softprops/action-gh-release@v1
with:
files: dist/*.whl
body: ${{ env.CHANGELOG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}