ci: change release pipeline to run on every push
All checks were successful
Release / Build and Release (push) Successful in 6s
Continuous Integration / Lint, Check & Test (push) Successful in 1m31s
Continuous Integration / Build Package (push) Successful in 1m44s

This commit is contained in:
Konstantin Fickel 2026-04-03 16:01:15 +02:00
parent 7564ce01d5
commit 19a9e6a72e
Signed by: kfickel
GPG key ID: A793722F9933C1A5

View file

@ -2,8 +2,6 @@ name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
@ -20,45 +18,44 @@ jobs:
- name: Extract version and handle tagging
id: version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
# Manual trigger: read version from Cargo.toml
VERSION_LINE=$(grep '^version' Cargo.toml | head -1)
VERSION="${VERSION_LINE#*\"}"
VERSION="${VERSION%\"*}"
TAG="v${VERSION}"
# Read version from Cargo.toml
VERSION_LINE=$(grep '^version' Cargo.toml | head -1)
VERSION="${VERSION_LINE#*\"}"
VERSION="${VERSION%\"*}"
TAG="v${VERSION}"
# Check if tag already exists
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "::error::Version ${VERSION} is already released"
exit 1
fi
# Create and push the tag
git tag "$TAG"
git push origin "$TAG"
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
echo "TAG=${TAG}" >> $GITHUB_OUTPUT
else
# Tag push trigger: extract version from tag
VERSION="${GITHUB_REF_NAME#v}"
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
echo "TAG=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
# Check if tag already exists
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Tag ${TAG} already exists, skipping release"
echo "SKIP=true" >> $GITHUB_OUTPUT
exit 0
fi
# Create and push the tag
git tag "$TAG"
git push origin "$TAG"
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
echo "TAG=${TAG}" >> $GITHUB_OUTPUT
echo "SKIP=false" >> $GITHUB_OUTPUT
- name: Build .deb package
if: steps.version.outputs.SKIP != 'true'
run: nix build .#streamd-deb -o result-deb
- name: Build static binary
if: steps.version.outputs.SKIP != 'true'
run: nix build .#streamd-musl -o result-musl
- name: Prepare release artifacts
if: steps.version.outputs.SKIP != 'true'
run: |
mkdir -p release
cp result-deb release/streamd_${{ steps.version.outputs.VERSION }}_amd64.deb
cp result-musl/bin/streamd release/streamd-${{ steps.version.outputs.VERSION }}-linux-x86_64
- name: Create release
if: steps.version.outputs.SKIP != 'true'
uses: https://git.konstantinfickel.de/actions/forgejo-release@v2
with:
direction: upload