Skip to content

Commit fca7ee2

Browse files
authored
Merge pull request #9 from CERALIVE/feature/calver-versioning-with-beta-support
2 parents 87920a8 + 64f5d7b commit fca7ee2

4 files changed

Lines changed: 509 additions & 85 deletions

File tree

.github/workflows/publish-deb.yml

Lines changed: 72 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,100 @@
11
name: Build and Upload Debian Package
22

33
on:
4+
workflow_dispatch:
5+
inputs:
6+
release_type:
7+
description: "Release type"
8+
required: true
9+
type: choice
10+
options:
11+
- stable
12+
- beta
13+
default: stable
414
push:
515
branches:
616
- master
7-
release:
8-
types: [released]
917

1018
jobs:
19+
calculate-version:
20+
name: Calculate Version
21+
runs-on: ubuntu-latest
22+
outputs:
23+
version: ${{ steps.calver.outputs.version }}
24+
is_beta: ${{ steps.calver.outputs.is_beta }}
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Calculate CalVer version
32+
id: calver
33+
env:
34+
RELEASE_TYPE: ${{ github.event.inputs.release_type || 'beta' }}
35+
run: |
36+
YEAR=$(date -u +"%Y")
37+
MONTH=$(date -u +"%-m")
38+
IS_BETA=$([[ "$RELEASE_TYPE" == "beta" ]] && echo "true" || echo "false")
39+
40+
PREFIX="v${YEAR}.${MONTH}"
41+
42+
if [ "$IS_BETA" == "true" ]; then
43+
LATEST_BETA=$(git tag -l "${PREFIX}.*-beta.*" | sed -E "s/.*-beta\.([0-9]+)/\1/" | sort -n | tail -1)
44+
if [ -z "$LATEST_BETA" ]; then
45+
BETA_NUM=1
46+
else
47+
BETA_NUM=$((LATEST_BETA + 1))
48+
fi
49+
LATEST_STABLE=$(git tag -l "${PREFIX}.*" | grep -v beta | sed "s/${PREFIX}\.//" | sort -n | tail -1)
50+
PATCH=${LATEST_STABLE:-0}
51+
NEXT_PATCH=$((PATCH + 1))
52+
VERSION="${YEAR}.${MONTH}.${NEXT_PATCH}-beta.${BETA_NUM}"
53+
else
54+
LATEST_PATCH=$(git tag -l "${PREFIX}.*" | grep -v beta | sed "s/${PREFIX}\.//" | sort -n | tail -1)
55+
if [ -z "$LATEST_PATCH" ]; then
56+
PATCH=0
57+
else
58+
PATCH=$((LATEST_PATCH + 1))
59+
fi
60+
VERSION="${YEAR}.${MONTH}.${PATCH}"
61+
fi
62+
63+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
64+
echo "is_beta=${IS_BETA}" >> $GITHUB_OUTPUT
65+
echo "✅ Version: ${VERSION} (Beta: ${IS_BETA})"
66+
1167
deb:
68+
name: Build Debian Package
69+
needs: calculate-version
1270
runs-on: ubuntu-latest
1371
steps:
1472
- uses: actions/checkout@v4
73+
with:
74+
submodules: recursive
75+
1576
- run: sudo apt update && sudo apt install -y qemu-user-static binfmt-support
77+
1678
- uses: docker/build-push-action@v3
1779
with:
1880
context: .
1981
outputs: build
2082
platforms: linux/arm64
21-
- uses: paulhatch/semantic-version@v5.4.0
22-
id: semantic
23-
with:
24-
tag_prefix: ""
25-
version_format: ${{ github.event_name == 'release' && '${major}.${minor}.${patch}' || '${major}.${minor}.${patch}-prerelease${increment}' }}
83+
2684
- uses: jiro4989/build-deb-action@v4
2785
id: deb
2886
with:
29-
package: irl-belacoder
87+
package: ceracoder
3088
package_root: ./build
31-
maintainer: IRL Software <mail@irl.software>
89+
maintainer: CERALIVE <contact@ceralive.com>
3290
desc: "Live video encoder with dynamic bitrate control and SRT support"
33-
version: ${{ steps.semantic.outputs.version }}
34-
#depends: "openssl, libssl-dev"
35-
homepage: "https://irl.software"
91+
version: ${{ needs.calculate-version.outputs.version }}
92+
homepage: "https://github.com/CERALIVE/ceracoder"
3693
arch: "arm64"
37-
section: "unknown"
94+
section: "video"
3895
compress_type: zstd
96+
3997
- uses: actions/upload-artifact@v4
4098
with:
41-
name: belacoder-arm64.deb
99+
name: ceracoder-arm64.deb
42100
path: ${{ steps.deb.outputs.file_name }}

0 commit comments

Comments
 (0)