streamd/.forgejo/workflows/release.yml
Konstantin Fickel dbc68da5c9
All checks were successful
Continuous Integration / Lint, Check & Test (push) Successful in 1m28s
Continuous Integration / Build Package (push) Successful in 1m36s
feat: add Windows cross-compilation and release artifacts
- Add mkWindowsCraneLib using x86_64-pc-windows-gnu target
- Add mkStreamdWindows using mingw-w64 toolchain for cross-compilation
- Export streamd-windows package from flake
- Add Windows build step and .exe artifact to release workflow
2026-04-07 14:22:32 +02:00

74 lines
2.3 KiB
YAML

name: Release
on:
push:
branches:
- main
workflow_dispatch:
jobs:
release:
name: Build and Release
runs-on: nix
steps:
- name: Check out Repository
uses: https://git.konstantinfickel.de/actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Extract version and handle tagging
id: version
run: |
# 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 "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: Build Windows binary
if: steps.version.outputs.SKIP != 'true'
run: nix build .#streamd-windows -o result-windows
- 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
cp result-windows/bin/streamd.exe release/streamd-${{ steps.version.outputs.VERSION }}-windows-x86_64.exe
- name: Create release
if: steps.version.outputs.SKIP != 'true'
uses: https://git.konstantinfickel.de/actions/forgejo-release@v2
with:
direction: upload
url: https://git.konstantinfickel.de
repo: kfickel/streamd
token: ${{ secrets.RELEASE_TOKEN }}
tag: ${{ steps.version.outputs.TAG }}
release-dir: release
verbose: true