-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (54 loc) · 1.53 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
55
56
57
58
59
60
61
62
name: Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
jobs:
changelog:
name: Create Release
runs-on: ubuntu-latest
outputs:
release_body: ${{ steps.git-cliff.outputs.content }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Generate release docs
uses: orhun/git-cliff-action@v2
id: git-cliff
with:
config: cliff.toml
args: -vv --latest --strip all
env:
OUTPUT: CHANGES.md
- name: Generate a changelog
uses: orhun/git-cliff-action@v2
id: git-cliff-change
with:
config: cliff.toml
env:
OUTPUT: CHANGELOG.md
- name: Read release
id: read_release
shell: bash
run: |
r=$(cat CHANGES.md)
r="${r//'%'/'%25'}" # Multiline escape sequences for %
r="${r//$'\n'/'%0A'}" # Multiline escape sequences for '\n'
r="${r//$'\r'/'%0D'}" # Multiline escape sequences for '\r'
echo "RELEASE_BODY=$r" >> $GITHUB_OUTPUT
# - name: Publish to Hex.pm
# uses: erlangpack/github-action@v3
# env:
# HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
- name: Create release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: CHANGES.md
tag: ${{ github.ref }}
body: |
${{ steps.read_release.outputs.RELEASE_BODY }}