-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (54 loc) · 1.88 KB
/
release.yml
File metadata and controls
61 lines (54 loc) · 1.88 KB
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
60
61
name: "Release"
on:
push:
branches:
- main
jobs:
release-on-push:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- uses: actions/checkout@v4
- id: release
uses: rymndhng/release-on-push-action@master
with:
bump_version_scheme: minor
tag_prefix: v
# Step 2: Generate Changelog using git-cliff-action
- name: Generate Changelog with GitCliff
uses: orhun/git-cliff-action@v1
with:
args: "-o CHANGELOG.md"
config: 'cliff.toml'
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
# Step 4: Check Output Parameters (optional, for debugging)
- name: Check Output Parameters
run: |
echo "Got tag name ${{ steps.release.outputs.tag_name }}"
echo "Got release version ${{ steps.release.outputs.version }}"
echo "Upload release artifacts to ${{ steps.release.outputs.upload_url }}"
# Step 5: Set release body with changelog
- name: Set release body with changelog
id: release_body
run: |
ls -l # List files to check if CHANGELOG.md exists
if [ -f CHANGELOG.md ]; then
echo "CHANGELOG.md exists"
echo "body<<EOF" >> $GITHUB_ENV
cat CHANGELOG.md >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
else
echo "CHANGELOG.md does not exist"
echo "body=No changelog available" >> $GITHUB_ENV
fi
# Step 6: Create GitHub Release with Changelog in Release Notes
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.release.outputs.tag_name }}
files: ./artifacts/*
body: ${{ steps.release_body.outputs.body }}
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}