-
Notifications
You must be signed in to change notification settings - Fork 22
38 lines (36 loc) · 1.13 KB
/
promote-tag.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
name: Releases
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Pick Release Version from git tag
id: version
run: |
echo "::set-output name=version::${GITHUB_REF#refs/*/}"
- name: Debug Release Version
run: echo "Extracted this version ${{ steps.version.outputs.version }}"
- name: Pick Changelog from git tag
id: changelog
run: |
OUTPUT=$(git tag -l --format='%(contents:body)' ${GITHUB_REF#refs/*/})
OUTPUT="${OUTPUT//'%'/'%25'}"
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
echo "body=$OUTPUT" >> $GITHUB_OUTPUT
- name: Debug Changelog
run: echo "Extracted this Changelog \n ${{ steps.changelog.outputs.body }}"
- uses: ncipollo/release-action@v1
with:
body: ${{ steps.changelog.outputs.body }}
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ steps.version.outputs.version }}
tag: ${{ steps.version.outputs.version }}
allowUpdates: true