Skip to content

Commit 60bf18d

Browse files
ci: updated CI to generate changelog from commits in next releases
1 parent b515921 commit 60bf18d

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
--compressed
5353
5454
deploy:
55-
name: Deploy Server
55+
name: Update Server
5656
runs-on: ubuntu-latest
5757
needs: [startMaintenance]
5858
if: github.ref == 'refs/heads/master'
@@ -65,10 +65,24 @@ jobs:
6565
master && ${{ secrets.INSTALL_COMMAND }} && ${{ secrets.BUILD_COMMAND }} && ${{
6666
secrets.RESTART_COMMAND }}"
6767

68-
release:
69-
name: Release
68+
changelog:
69+
name: Changelog
70+
runs-on: ubuntu-latest
7071
needs: [deploy]
7172
if: github.ref == 'refs/heads/master'
73+
steps:
74+
- uses: actions/checkout@v4
75+
name: Checkout repository
76+
- id: build_changelog
77+
name: Build changelog
78+
run: |
79+
PREV_TAG=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sed -n '2p')
80+
echo "CHANGELOG=$({ git log $PREV_TAG...${{ github.ref_name }} --pretty=format:"- %s" | grep '^- feat' | sed 's/^- feat:/- New:/'; git log $PREV_TAG...v1.41.0 --pretty=format:"- %s" | grep '^- fix' | sed 's/^- fix:/- Fixed/'; })" >> $GITHUB_OUTPUT
81+
82+
release:
83+
name: Update Client
84+
needs: [changelog]
85+
if: github.ref == 'refs/heads/master'
7286
strategy:
7387
matrix:
7488
os: [ubuntu-latest, macos-latest, windows-latest]
@@ -111,7 +125,9 @@ jobs:
111125
with:
112126
tagName: v__VERSION__
113127
releaseName: 'v__VERSION__'
114-
releaseBody: 'See the assets to download this version and install it.'
128+
releaseBody: |
129+
${{ needs.changelog.outputs.CHANGELOG }}
130+
See the assets to download this version and install.
115131
releaseDraft: false
116132
prerelease: false
117133

0 commit comments

Comments
 (0)