@@ -3,11 +3,12 @@ name: Auto Release
3
3
on :
4
4
push :
5
5
tags :
6
- - ' v*' # Change 'main' to your default branch name
6
+ - ' v*' # Only trigger on tags starting with 'v'
7
7
8
8
jobs :
9
9
build :
10
- runs-on : ubuntu-latest # You can use other runners like macOS or Windows
10
+ runs-on : ubuntu-latest
11
+
11
12
12
13
steps :
13
14
- name : Checkout code
@@ -18,25 +19,36 @@ jobs:
18
19
- name : Set up Python
19
20
uses : actions/setup-python@v2
20
21
with :
21
- python-version : 3.x # Specify the Python version you need
22
+ python-version : 3.x
23
+
24
+ # Add steps here to build the Python package, generate a wheel, etc.
22
25
23
- - name : " Build Changelog"
24
- id : build_changelog
25
- uses : mikepenz/release-changelog-builder-action@v4
26
+ - name : Fetch all tags
27
+ run : git fetch --tags
26
28
27
29
- name : Create Release
28
30
id : create_release
29
31
uses : actions/create-release@v1
30
32
env :
31
33
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
32
34
with :
33
- tag_name : ${{ github.ref }} # Specify the version number you want to release
35
+ tag_name : ${{ github.ref }}
34
36
release_name : Release ${{ github.ref }}
35
37
body : |
36
38
Add release notes here
37
- You can also include links to the artifacts like mvn jar and pypi package.
38
- ${{steps.build_changelog.outputs.changelog}}
39
+ ${{ steps.changelog.outputs.changelog }}
39
40
draft : false
40
41
prerelease : false
41
42
42
43
# Add steps here to upload any additional artifacts (e.g., mvn jar, pypi package, etc.) if required.
44
+
45
+ - name : Install jq
46
+ run : sudo apt-get update && sudo apt-get install -y jq
47
+
48
+ - name : Generate Changelog
49
+ id : changelog
50
+ run : |
51
+ from_tag="v1.0.5"
52
+ to_tag="${{ github.ref }}"
53
+ changelog=$(git log --pretty=format:"- %s" $from_tag...$to_tag)
54
+ echo "::set-output name=changelog::$changelog"
0 commit comments