forked from tt-acm/DesignExplorer
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 1.1 KB
/
release.yml
File metadata and controls
40 lines (33 loc) · 1.1 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
name: Release
on:
push:
tags: ['v*']
permissions:
contents: write
jobs:
release:
name: Create GitHub Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate changelog
id: changelog
run: |
# Get previous tag
PREV_TAG=$(git tag --sort=-version:refname | head -2 | tail -1)
if [ -z "$PREV_TAG" ] || [ "$PREV_TAG" = "${{ github.ref_name }}" ]; then
PREV_TAG=$(git rev-list --max-parents=0 HEAD)
fi
echo "## What's Changed" > changelog.md
echo "" >> changelog.md
git log --pretty=format:"- %s (%h)" "$PREV_TAG".."${{ github.ref_name }}" >> changelog.md
echo "" >> changelog.md
echo "" >> changelog.md
echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREV_TAG}...${{ github.ref_name }}" >> changelog.md
- name: Create release
uses: softprops/action-gh-release@v2
with:
body_path: changelog.md
generate_release_notes: false