-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (51 loc) · 1.78 KB
/
Copy pathrelease.yml
File metadata and controls
62 lines (51 loc) · 1.78 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
62
name: Create Release and Notify Discord
on:
push:
tags:
- 'v*.*.*'
jobs:
release:
name: Create GitHub Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract and Linkify Changelog
id: changelog
run: |
TAG="${GITHUB_REF_NAME}"
CHANGELOG="docs/docs/blog/changelog.md"
BODY=$(awk "
/^## \`${TAG}\`/ { found=1; next }
found && /^## \`v[0-9]+\.[0-9]+\.[0-9]+\`/ { exit }
found { print }
" "$CHANGELOG")
LINKIFIED_BODY=$(echo "$BODY" | sed -E 's|\(#([0-9]+)\)|([#\1](https://github.com/'"${GITHUB_REPOSITORY}"'/pull/\1))|g')
echo "body<<EOF" >> $GITHUB_OUTPUT
echo "$LINKIFIED_BODY" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.changelog.outputs.body }}
make_latest: true
- name: Send Discord Notification
uses: sarisia/actions-status-discord@v1
if: success()
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
content: "@everyone A new update has been published!"
title: ""
notitle: true
description: |
## [🍁 ${{ github.ref_name }}](https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }})
${{ steps.changelog.outputs.body }}
nodetail: true
color: 0xA728F3
username: Nova Release
avatar_url: https://raw.githubusercontent.com/nova-guild/nova/main/nova-release.png