-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (52 loc) · 1.8 KB
/
retouch-relnote.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
name: Retouch Release Notes
on:
push:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
tags:
description: 'Test scenario tags'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Check out the release notes
env:
SECRET_SSH_KEY: ${{ secrets.VPP_RELNOTES_PRIVATE_SSH_KEY }}
run: |
git clone https://github.com/FDio/vpp
git clone https://github.com/ayourtch/vpp-relops
echo "$SECRET_SSH_KEY" >secret_ssh_key
chmod 600 secret_ssh_key
ssh-agent bash -c 'ssh-add secret_ssh_key; git clone [email protected]:vpp-dev/vpp-release-notes.git'
- name: Retouch the release notes
run: |
cd vpp
VERSION=$(git describe --long HEAD | sed -e 's/-[^-]\+-[^-]\+$//g' -e 's/^\(v[0-9]\+.[0-9]\+\)-.*$/\1/')
cd ..
cd vpp-release-notes
SED_FILE="${VERSION}.sed"
if [ -e ${SED_FILE} ]; then
sed -f ${SED_FILE} RELEASE-GENERATED.md >RELEASE.md
else
cp RELEASE-GENERATED.md RELEASE.md
fi
cat HOW-IT-WORKS.md RELEASE.md > README.md
- name: Push the new release note
env:
SECRET_SSH_KEY: ${{ secrets.VPP_RELNOTES_PRIVATE_SSH_KEY }}
run: |
cd vpp-release-notes
DIFFS_LINES=$(git diff | wc -l)
if [ "$DIFFS_LINES" != "0" ]; then
git config user.email "[email protected]"
git config user.name "Andrew Yourtchenko (ghjobs)"
git add RELEASE.md || true
git add README.md || true
git commit -a -m "Retouch at $(date)"
ssh-agent bash -c 'ssh-add ../secret_ssh_key; git push origin master'
fi