-
Notifications
You must be signed in to change notification settings - Fork 0
178 lines (152 loc) · 5.78 KB
/
Copy pathrelease.yml
File metadata and controls
178 lines (152 loc) · 5.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# SPDX-FileCopyrightText: © 2025 StreamKit Contributors
#
# SPDX-License-Identifier: MPL-2.0
name: Release
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
dry_run:
description: "Build and validate without creating a GitHub release"
required: false
default: true
type: boolean
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUSTC_WRAPPER: sccache
jobs:
build-linux-x64:
name: Build Linux x64
runs-on: ubuntu-22.04
steps:
- name: Compute version
id: version
run: |
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
echo "version=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
else
echo "version=dry-run-sha-${GITHUB_SHA::12}" >> "$GITHUB_OUTPUT"
fi
- uses: actions/checkout@v5
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.14"
- name: Build UI
working-directory: ./ui
run: |
bun install --frozen-lockfile
bun run build
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.95.0"
- name: Restore sccache cache
uses: actions/cache/restore@v4
with:
path: ~/.cache/sccache
key: sccache-release-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
restore-keys: |
sccache-release-${{ runner.os }}-
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Install system dependencies (libvpx for VP9, cmake + nasm for AV1 static build)
run: sudo apt-get update && sudo apt-get install -y libvpx-dev nasm libclang-dev cmake
- name: Build release binaries
# -fuse-ld=bfd: override rust-lld with the system linker (ld.bfd).
# rust-lld (default since Rust 1.85 on x86_64-linux) ignores
# --whole-archive for native static archives under thin LTO,
# causing undefined SVT-AV1 symbols.
run: |
RUSTFLAGS="-C link-arg=-fuse-ld=bfd" \
cargo build --locked --profile release-lto -p streamkit-server --bin skit --features "moq,svt_av1_static"
cargo build --locked --profile release-lto -p streamkit-client --bin skit-cli
- name: Strip binaries
run: |
strip target/release-lto/skit
strip target/release-lto/skit-cli
- name: Prepare release directory
run: |
VERSION="${{ steps.version.outputs.version }}"
mkdir -p streamkit-${VERSION}/plugins/{wasm,native}
mkdir -p streamkit-${VERSION}/samples
cp target/release-lto/skit streamkit-${VERSION}/
cp target/release-lto/skit-cli streamkit-${VERSION}/
cp LICENSE streamkit-${VERSION}/
cp README.md streamkit-${VERSION}/
cp DOCKER.md streamkit-${VERSION}/
cp NOTICE streamkit-${VERSION}/
cp -r LICENSES streamkit-${VERSION}/
cp docker-skit.toml streamkit-${VERSION}/
cp docker-skit-gpu.toml streamkit-${VERSION}/
cp samples/skit.toml streamkit-${VERSION}/samples/skit.toml
cp -r samples/pipelines streamkit-${VERSION}/samples/
- name: Create tarball
run: |
VERSION="${{ steps.version.outputs.version }}"
tar -czf streamkit-${VERSION}-linux-x64.tar.gz streamkit-${VERSION}/
- name: Generate checksum
run: |
VERSION="${{ steps.version.outputs.version }}"
sha256sum streamkit-${VERSION}-linux-x64.tar.gz > streamkit-${VERSION}-linux-x64.tar.gz.sha256
- name: Save sccache cache
if: always()
uses: actions/cache/save@v4
with:
path: ~/.cache/sccache
key: sccache-release-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: linux-x64
path: |
streamkit-${{ steps.version.outputs.version }}-linux-x64.tar.gz
streamkit-${{ steps.version.outputs.version }}-linux-x64.tar.gz.sha256
create-release:
name: Create GitHub Release
needs: [build-linux-x64]
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # Full history for changelog
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Generate changelog
id: changelog
run: |
# Extract version tag
VERSION="${{ github.ref_name }}"
# Simple changelog from git log (can be enhanced with git-cliff later)
echo "## What's Changed" > changelog.md
PREV_TAG=$(git describe --tags --abbrev=0 --match 'v[0-9]*' HEAD^ 2>/dev/null || echo "")
if [ -n "$PREV_TAG" ]; then
git log --pretty=format:"- %s (%h)" ${PREV_TAG}..HEAD >> changelog.md
else
echo "- Initial release" >> changelog.md
fi
echo "" >> changelog.md
echo "" >> changelog.md
echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREV_TAG}...${{ github.ref_name }}" >> changelog.md
cat changelog.md
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/**/streamkit-*.tar.gz
artifacts/**/streamkit-*.tar.gz.sha256
body_path: changelog.md
draft: false
prerelease: ${{ contains(github.ref_name, '-rc') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-alpha') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}