-
Notifications
You must be signed in to change notification settings - Fork 7
56 lines (48 loc) · 1.49 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
48
49
50
51
52
53
54
55
56
name: Release
on:
push:
tags:
- '*.*.*'
jobs:
release:
name: Release
runs-on: ubuntu-22.04
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Set up Poetry
uses: snok/install-poetry@v1
- name: Install project
run: poetry install
- name: Run lint
run: poetry run make lint
- name: Run tests
run: poetry run make test
- name: Publish package on PyPi
run: |
poetry config http-basic.pypi __token__ ${{secrets.PYPI_TOKEN}}
poetry build
poetry publish
# FIXME: Fails on prereleases; https://github.com/mindsers/changelog-reader-action/pull/39
- name: Parse changelog
id: changelog
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ github.ref_name }}
- name: Publish GitHub release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ steps.changelog.outputs.version }}
body: |
## ${{ steps.changelog.outputs.version }} - ${{ steps.changelog.outputs.date }}
${{ steps.changelog.outputs.changes }}
draft: false
prerelease: ${{ steps.changelog.outputs.status == 'prereleased' }}