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