Release version 14.0 #15
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
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 }} |