-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (45 loc) · 1.69 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
name: Create release
on:
workflow_dispatch:
jobs:
changelog:
name: Create changelog
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Generate changelog and determine version
id: changelog
uses: TriPSs/conventional-changelog-action@v5
with:
preset: conventionalcommits
github-token: ${{ secrets.GH_AIDE_TOKEN }}
git-user-name: ${{ github.actor }}
git-user-email: ${{ github.actor }}@users.noreply.github.com
tag-prefix: ''
input-file: 'CHANGELOG.md'
output-file: 'CHANGELOG.md'
release-count: 10000
skip-on-empty: false
skip-version-file: true
- name: Update version in pyproject.toml
if: ${{ steps.changelog.outputs.skipped == 'false' }}
run: |
VERSION=${{ steps.changelog.outputs.tag }}
sed -i "s/^version = .*/version = \"$VERSION\"/" pyproject.toml
shell: bash
- name: Commit updated version
if: ${{ steps.changelog.outputs.skipped == 'false' }}
run: |
git config --local user.name "${{ github.actor }}"
git config --local user.email "${{ github.actor }}@users.noreply.github.com"
git add pyproject.toml
git commit -m "chore: update version to ${{ steps.changelog.outputs.tag }}"
git push
- name: Create Release
uses: softprops/action-gh-release@v2
if: ${{ steps.changelog.outputs.skipped == 'false' }}
with:
tag_name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
token: ${{ secrets.GH_AIDE_TOKEN }}