Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: GitHub Release

on:
push:
tags:
- 'rrd-*'
workflow_dispatch:
inputs:
tag:
description: Existing rrd-* tag to release
required: true
type: string

permissions:
contents: write

concurrency:
group: release-${{ inputs.tag || github.ref_name }}

jobs:
release:
name: Create GitHub release
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
steps:
- name: Validate release tag
shell: bash
run: |
if [[ ! "$RELEASE_TAG" =~ ^rrd-[0-9]+\.[0-9]+\.[0-9]+([A-Za-z0-9.-]+)?$ ]]; then
echo "Invalid release tag: $RELEASE_TAG" >&2
exit 1
fi

- name: Create release
shell: bash
run: |
if gh release view "$RELEASE_TAG" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
echo "GitHub release already exists for $RELEASE_TAG"
exit 0
fi

gh release create "$RELEASE_TAG" \
--repo "$GITHUB_REPOSITORY" \
--verify-tag \
--generate-notes \
--title "rrd ${RELEASE_TAG#rrd-}"
Loading