-
Notifications
You must be signed in to change notification settings - Fork 58
72 lines (64 loc) · 2.28 KB
/
release.yml
File metadata and controls
72 lines (64 loc) · 2.28 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
name: Release specification
on:
workflow_dispatch:
push:
branches: master
jobs:
make-release:
name: Make and publish spec release
runs-on: ubuntu-latest
steps:
- name: Clone main
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984
with:
python-version: 3.x
cache: 'pip'
- name: Get previous version
id: prevver
run: |
prev_version=`git tag | sort -V -r | head -n 1 | cut -c 2-`
echo "::set-output name=prev_version::$(echo -n $prev_version)"
- name: Get version
id: getver
run: |
spec_version=`grep -oP 'VERSION \K(\d+\.\d+\.\d+)' tuf-spec.md`
echo "::set-output name=spec_version::$(echo -n $spec_version)"
- name: Make release
if: steps.getver.outputs.spec_version != steps.prevver.outputs.prev_version
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.getver.outputs.spec_version }}
release_name: v${{ steps.getver.outputs.spec_version }}
body: Specification release v${{ steps.getver.outputs.spec_version }}
- name: Build specification
if: steps.getver.outputs.spec_version != steps.prevver.outputs.prev_version
run: |
python -m pip install -r requirements.txt
mkdir build && cd build
make -f ../Makefile release
- name: Switch branch
if: steps.getver.outputs.spec_version != steps.prevver.outputs.prev_version
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
ref: gh-pages
clean: false
- name: Push generated specification
if: steps.getver.outputs.spec_version != steps.prevver.outputs.prev_version
env:
SPEC_VERSION: v${{ steps.getver.outputs.spec_version }}
run: |
git config user.name "TUF Specification Automation"
git config user.email theupdateframework@googlegroups.com
rm -fr latest
mv build/* .
rmdir build
make index
git add .
git commit -m "Publish latest specification $SPEC_VERSION"
git push