forked from hpcc-systems/HPCC-Platform
-
Notifications
You must be signed in to change notification settings - Fork 0
153 lines (147 loc) · 6.89 KB
/
build-changelogs.yml
File metadata and controls
153 lines (147 loc) · 6.89 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: Build Changelogs
on:
workflow_call:
inputs:
current-version:
description: 'Current Version'
required: true
type: string
make-latest:
description: 'Make Latest'
required: false
type: boolean
default: false
workflow_dispatch:
inputs:
current-version:
type: string
description: 'Current Version'
required: true
previous-rc-version:
type: string
description: 'Previous RC Version'
required: true
previous-gold-version:
type: string
description: 'Previous Gold Version'
required: true
jobs:
changelogs:
name: Generate Changelogs
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'hpcc-systems' }}
permissions:
contents: write
steps:
- name: Checkout HPCC-Platform
uses: actions/checkout@v4
with:
ref: refs/tags/community_${{ inputs.current-version }}
submodules: recursive
path: HPCC-Platform
fetch-tags: true
fetch-depth: 0
- name: Checkout LN
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/LN
ref: refs/tags/internal_${{ inputs.current-version }}
submodules: recursive
token: ${{ secrets.LNB_TOKEN}}
path: LN
fetch-tags: true
fetch-depth: 0
- name: Checkout ECLIDE
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/ECLIDE
ref: refs/tags/eclide_${{ inputs.current-version }}
submodules: recursive
path: ECLIDE
fetch-tags: true
fetch-depth: 0
- name: Checkout PrettyGitLogs
uses: actions/checkout@v4
with:
repository: hpcc-systems/PrettyGitLogs
ref: master
path: PrettyGitLogs
- name: Get Previous Versions for workflow call
if: ${{ github.event_name != 'workflow_dispatch' }}
id: get_version
shell: bash
working-directory: HPCC-Platform
run: |
set -x
tag=$(git describe --exact-match --tags 2>/dev/null)
version=$(echo $tag | cut -d_ -f2)
major=$(echo $version | cut -d. -f1)
minor=$(echo $version | cut -d. -f2)
point=$(echo $version | cut -d. -f3 | cut -d- -f1)
type=$(echo $version | cut -d- -f2)
if [[ $point -eq 0 ]]; then
if [[ $minor -eq 0 ]]; then
major=$((major - 1))
previous_rc=$(git tag --sort=-v:refname | grep -E "^community_$major\.[0-9]*\.[0-9]*-rc" | head -n 1 | cut -d_ -f2 2>/dev/null)
previous_gold=$(git tag --sort=-v:refname | grep -E "^community_$major\.[0-9]*\.[0-9]*-[0-9]" | head -n 1 | cut -d_ -f2 2>/dev/null)
else
minor=$((minor - 2))
previous_rc=$(git tag --sort=-v:refname | grep -E "^community_$major\.$minor\.[0-9]*-rc" | head -n 1 | cut -d_ -f2 2>/dev/null)
previous_gold=$(git tag --sort=-v:refname | grep -E "^community_$major\.$minor\.[0-9]*-[0-9]" | head -n 1 | cut -d_ -f2 2>/dev/null)
fi
else
point=$((point - 2))
previous_rc=$(git tag --sort=-v:refname | grep -E "^community_$major\.$minor\.$point-rc" | head -n 1 | cut -d_ -f2 2>/dev/null)
previous_gold=$(git tag --sort=-v:refname | grep -E "^community_$major\.$minor\.$point-[0-9]" | head -n 1 | cut -d_ -f2 2>/dev/null)
fi
echo "current_version=$version" >> $GITHUB_OUTPUT
echo "previous_rc_version=$previous_rc" >> $GITHUB_OUTPUT
echo "previous_gold_version=$previous_gold" >> $GITHUB_OUTPUT
echo "type=$type" >> $GITHUB_OUTPUT
- name: Print Vars
if: ${{ github.event_name != 'workflow_dispatch' }}
shell: bash
run: |
echo "${{ toJSON(steps.get_version.outputs) }}"
- name: Generate Changelogs
shell: bash
working-directory: PrettyGitLogs
run: |
./prettyLogs_setup.sh
set -x
echo "pwd = $(pwd)"
sed -i -e '/^JIRAUser/c\JIRAUser=${{ secrets.JIRA_USERNAME}}' prettylogs.conf
sed -i -e '/^JIRAPW/c\JIRAPW=${{ secrets.JIRA_TOKEN }}' prettylogs.conf
cat prettylogs.conf
if [[ "${{ github.event_name }}" != 'workflow_dispatch' ]]; then
type=${{ steps.get_version.outputs.type }}
current_version=${{ steps.get_version.outputs.current_version }}
previous_rc_version=${{ steps.get_version.outputs.previous_rc_version }}
previous_gold_version=${{ steps.get_version.outputs.previous_gold_version }}
else
type=$(echo "${{ github.event.inputs.current-version }}" | cut -d- -f2)
current_version=${{ github.event.inputs.current-version }}
previous_rc_version=${{ github.event.inputs.previous-rc-version }}
previous_gold_version=${{ github.event.inputs.previous-gold-version }}
fi
if [[ ! "${type}" == *"rc"* ]]; then
perl ./prettyLogs.pl -bt community_${current_version} -et community_${previous_gold_version} -repo ../HPCC-Platform -sort -html community_${current_version}
perl ./prettyLogs.pl -bt internal_${current_version} -et internal_${previous_gold_version} -repo ../LN -sort -html internal_${current_version}
perl ./prettyLogs.pl -bt eclide_${current_version} -et eclide_${previous_gold_version} -repo ../ECLIDE -sort -html eclide_${current_version}
elif [ "${type}" == "rc1" ]; then
perl ./prettyLogs.pl -bt community_${current_version} -et community_${previous_gold_version} -repo ../HPCC-Platform -sort -html community_${current_version}
perl ./prettyLogs.pl -bt internal_${current_version} -et internal_${previous_gold_version} -repo ../LN -sort -html internal_${current_version}
perl ./prettyLogs.pl -bt eclide_${current_version} -et eclide_${previous_gold_version} -repo ../ECLIDE -sort -html eclide_${current_version}
else
perl ./prettyLogs.pl -bt community_${current_version} -et community_${previous_rc_version} -repo ../HPCC-Platform -sort -html community_${current_version}
perl ./prettyLogs.pl -bt internal_${current_version} -et internal_${previous_rc_version} -repo ../LN -sort -html internal_${current_version}
perl ./prettyLogs.pl -bt eclide_${current_version} -et eclide_${previous_rc_version} -repo ../ECLIDE -sort -html eclide_${current_version}
fi
- name: Upload Changelogs
uses: ncipollo/release-action@v1.16.0
with:
allowUpdates: true
generateReleaseNotes: false
prerelease: ${{ contains(github.ref, '-rc') }}
makeLatest: ${{ inputs.make-latest }}
artifacts: PrettyGitLogs/community_*.html,PrettyGitLogs/internal_*.html,PrettyGitLogs/eclide_*.html