-
Notifications
You must be signed in to change notification settings - Fork 15
53 lines (44 loc) · 1.3 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
name: Release version
on:
push:
branches: [ main ]
permissions:
contents: write
jobs:
release-version:
if: "!startsWith(github.event.head_commit.message, 'bump:')"
runs-on: ubuntu-latest
name: "Bump version, create changelog and release"
steps:
- name: Check out
uses: actions/checkout@v3
with:
token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
id: bump
with:
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
changelog_increment_filename: release_body.md
- name: Build package
run: |
python -m build
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: release_body.md
tag_name: ${{ env.REVISION }}
files: dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}