-
Notifications
You must be signed in to change notification settings - Fork 35
47 lines (38 loc) · 1.14 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
37
38
39
40
41
42
43
44
45
46
47
name: release
on:
push:
tags:
- v*
jobs:
release:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- run: pipx run build
- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
attestations: false
- name: Get Previous Tag
id: tag
uses: trim21/changelog-previous-tag@master
with:
token: ${{ github.token }}
version-spec: pep440
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
fromTag: ${{ github.ref_name }}
toTag: ${{ env.previousTag }}
restrictToTypes: feat,fix,revert
- name: Upload Github Release
run: gh release create "${GITHUB_REF}" --notes "${CHANGELOG}" $EXTRA_OPTS
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHANGELOG: "${{ steps.changelog.outputs.changes }}"
EXTRA_OPTS: "${{ env.preRelease == 'true' && '-p' || '' }}"