-
Notifications
You must be signed in to change notification settings - Fork 22
89 lines (69 loc) · 2.12 KB
/
create-release.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
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
name: Create release
on:
push:
tags:
- 'v*'
jobs:
create_release:
name: Create release
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Create draft
run: gh release create $GITHUB_REF_NAME --draft=true --title $GITHUB_REF_NAME zabbix-redis.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
upload_assets:
name: Upload assets
runs-on: ubuntu-22.04
needs: create_release
strategy:
matrix:
version:
- '6.0'
- '6.2'
- '6.4'
- '7.0'
- '7.2'
flavour:
- name: Redis Server
slug: redis-server
- name: Redis Sentinel
slug: redis-sentinel
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install jinja2-cli
- name: Build template file name
run: |
echo "TEMPLATE_FILE_NAME=template-app-${{ matrix.flavour.slug }}-${{ matrix.version }}-$GITHUB_REF_NAME.xml" >> $GITHUB_ENV
- name: Generate template
run: |
PYTHONPATH=. jinja2 \
-D version=${{ matrix.version }} \
-D name='${{ matrix.flavour.name }}' \
-D description="Template App ${{ matrix.flavour.name }} $GITHUB_REF_NAME" \
-D release="${GITHUB_REF_NAME:1}" \
--extension=extensions.zabbix.ZabbixExtension --strict -o $TEMPLATE_FILE_NAME template-app-${{ matrix.flavour.slug }}.j2
- name: Upload template
run: gh release upload $GITHUB_REF_NAME $TEMPLATE_FILE_NAME
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish_release:
name: Publish release
runs-on: ubuntu-22.04
needs:
- create_release
- upload_assets
steps:
- uses: actions/checkout@v3
- name: Publish release
run: gh release edit $GITHUB_REF_NAME --draft=false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}