-
Notifications
You must be signed in to change notification settings - Fork 23
47 lines (42 loc) · 1.22 KB
/
release.yml
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
name: release
on:
workflow_run:
workflows:
- test
branches: [main]
types:
- completed
jobs:
release:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Build
run: |
poetry build --no-interaction
echo "RELEASE_NAME=$(poetry version)" >> $GITHUB_ENV
echo "TAG_NAME=v$(poetry version -s)" >> $GITHUB_ENV
echo "## Release notes" > NOTES.md
sed -n '/^## /{n; :a; /^## /q; p; n; ba}' CHANGELOG.md >> NOTES.md
- name: Release
uses: softprops/action-gh-release@v1
with:
fail_on_unmatched_files: true
append_body: true
name: ${{ env.RELEASE_NAME }}
tag_name: ${{ env.TAG_NAME }}
body_path: ./NOTES.md
files: ./dist/*
- name: Publish
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: poetry publish