-
Notifications
You must be signed in to change notification settings - Fork 4
59 lines (56 loc) · 1.64 KB
/
semantic_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
57
58
59
name: semantic_release
# define when this workflow is triggered
on:
workflow_dispatch:
push:
branches:
- main
jobs:
# update the changelog and create a commit
changelog:
name: Changelog
runs-on: ubuntu-latest
steps:
# checkout the repo and supply a PAT for the changelog update commit.
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{secrets.PAT}}
# ref: ${{ github.head_ref || github.ref_name }}
- name: update changelog
run: |
pip install -U pip
pip install python-semantic-release==9.3
semantic-release changelog
# Commits files to repository
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
author_name: semantic-release
message: "chore: automatically updating changelog [skip ci]"
add: "./CHANGELOG.md"
# determine appropriate version number and create a release commit
semantic-release:
name: Semantic Release
needs: changelog
runs-on: ubuntu-latest
# concurrency: release
permissions:
id-token: write
contents: write
steps:
# checkout the repo and supply a PAT for the changelog update commit.
- id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{secrets.PAT}}
- name: git pull
run: git pull origin main --rebase
# use semantic-release
- id: semantic-release
uses: python-semantic-release/python-semantic-release@master
with:
github_token: ${{ secrets.PAT }}
changelog: "true"
push: "true"