-
Notifications
You must be signed in to change notification settings - Fork 33
35 lines (32 loc) · 1.02 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
# As described in https://www.nicholasnadeau.com/post/2020/08/one-version-to-rule-them-all-keeping-your-python-package-version-number-in-sync-with-git-and-poetry/
name: publish
on:
push:
tags:
- 'v*'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Generate Changelog
run: grep -B 9999 "##" -m2 CHANGELOG.md | head -n -1 | tail -n +4 > ${{ github.workspace }}-CHANGELOG.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Build and publish
run: |
poetry version $(git describe --tags --abbrev=0 | sed s/^v//)
poetry build
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish
- name: Release
uses: softprops/action-gh-release@v2
with:
body_path: ${{ github.workspace }}-CHANGELOG.txt
files: dist/*