|
1 | 1 | name: Build and Upload Debian Package |
2 | 2 |
|
3 | 3 | 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 |
4 | 14 | push: |
5 | 15 | branches: |
6 | 16 | - master |
7 | | - release: |
8 | | - types: [released] |
9 | 17 |
|
10 | 18 | 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 | + |
11 | 67 | deb: |
| 68 | + name: Build Debian Package |
| 69 | + needs: calculate-version |
12 | 70 | runs-on: ubuntu-latest |
13 | 71 | steps: |
14 | 72 | - uses: actions/checkout@v4 |
| 73 | + with: |
| 74 | + submodules: recursive |
| 75 | + |
15 | 76 | - run: sudo apt update && sudo apt install -y qemu-user-static binfmt-support |
| 77 | + |
16 | 78 | - uses: docker/build-push-action@v3 |
17 | 79 | with: |
18 | 80 | context: . |
19 | 81 | outputs: build |
20 | 82 | 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 | + |
26 | 84 | - uses: jiro4989/build-deb-action@v4 |
27 | 85 | id: deb |
28 | 86 | with: |
29 | | - package: irl-belacoder |
| 87 | + package: ceracoder |
30 | 88 | package_root: ./build |
31 | | - maintainer: IRL Software <mail@irl.software> |
| 89 | + maintainer: CERALIVE <contact@ceralive.com> |
32 | 90 | 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" |
36 | 93 | arch: "arm64" |
37 | | - section: "unknown" |
| 94 | + section: "video" |
38 | 95 | compress_type: zstd |
| 96 | + |
39 | 97 | - uses: actions/upload-artifact@v4 |
40 | 98 | with: |
41 | | - name: belacoder-arm64.deb |
| 99 | + name: ceracoder-arm64.deb |
42 | 100 | path: ${{ steps.deb.outputs.file_name }} |
0 commit comments