-
Notifications
You must be signed in to change notification settings - Fork 2.5k
48 lines (43 loc) · 1.85 KB
/
changelog-build.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
name: 'Changelog Build (Release)'
on:
push:
branches:
- ko3n1g/chore/release-docs
tags:
- '*'
jobs:
changelog:
# if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags
- name: Get Previous tag
id: previous_tag
# git for-each-ref --sort=-creatordate --format '%(refname)' refs/tags ==> refs/tags/vX.Y.Z in descending order of date
# awk 'FNR == 2 {print substr($1, 11, length($1))}') ==> Selects the 2nd tag from the list, then strips the /refs/tags/ part of the tag
# set-output name=tag_name:: ==> Takes the clean tag vX.Y.Z and sets it to steps.previous_tag.outputs.tag_name
run: |
echo "::set-output name=tag_name::$(git for-each-ref --sort=-creatordate --format '%(refname)' refs/tags | awk 'FNR == 2 {print substr($1, 11, length($1))}')"
echo ${{ steps.previous_tag.outputs.tag_name }}
- name: Build Changelog
id: github_tag
uses: mikepenz/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Configuration file is setup with filters for domains
# owner:repo must point to current repo
# fromTag: Auto resolved from historical tag order (previous tag compared to current tag)
# toTag: Current tag reference
configuration: ".github/workflows/config/changelog-config.json"
owner: "NVIDIA"
repo: "NeMo"
ignorePreReleases: "false"
failOnError: "false"
fromTag: r2.0.0rc0
toTag: r2.0.0rc1
- name: Print Changelog
run: |
echo "${{steps.github_tag.outputs.changelog}}"