-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
54 lines (44 loc) · 1.42 KB
/
release.yml
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
name: Release
on:
push:
tags:
- "v*.*.*"
jobs:
release:
if: github.event.repository.fork == false
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: step-security/harden-runner@v1
with:
allowed-endpoints:
api.github.com:443
github.com:443
- name: Get version from tag
id: tag_name
run: echo "current_version=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT"
shell: bash
- uses: actions/checkout@v3
- uses: mindsers/changelog-reader-action@v2
id: changelog_reader
with:
version: ${{ steps.tag_name.outputs.current_version }}
- name: Get common links from changelog
id: changelog
run: |
# Parse the changelog for common links
_links="$(grep -P '^\[.*]:.+' ${GITHUB_WORKSPACE}/CHANGELOG.md | sort -u)"
_links="${_links//'%'/'%25'}"
_links="${_links//$'\n'/'%0A'}"
_links="${_links//$'\r'/'%0D'}"
# Set output 'links' to $_links
DELIMITER=$(uuidgen)
echo "links<<${DELIMITER}" >> "${GITHUB_OUTPUT}"
echo "$_links" >> "${GITHUB_OUTPUT}"
echo "${DELIMITER}" >> "${GITHUB_OUTPUT}"
- uses: softprops/action-gh-release@v1
with:
body: |
${{ steps.changelog_reader.outputs.changes }}
${{ steps.changelog.outputs.links }}