build: v0.5.2 #42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-FileCopyrightText: 2002 BigBlueButton Inc. and by respective authors | |
# | |
# SPDX-License-Identifier: LGPL-3.0-or-later | |
name: Package build | |
on: push | |
jobs: | |
ubuntu: | |
strategy: | |
matrix: | |
UBUNTU_VERSION: [ "20.04" ] | |
include: | |
- UBUNTU_VERSION: "20.04" | |
UBUNTU_CODENAME: focal | |
runs-on: ubuntu-latest | |
container: ubuntu:${{ matrix.UBUNTU_VERSION }} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: '>=1.19.0' | |
cache: true | |
- name: Install dependencies | |
run: | | |
apt update | |
apt install -y ca-certificates | |
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list | |
apt update | |
apt install -y nfpm | |
- name: Build package | |
run: | | |
rm -rf ./build ./release | |
mkdir -p ./build ./release | |
export V=($(cat ./VERSION)) GOMOD=$(go list -m) | |
echo $GOMOD ${V[@]} | |
go mod tidy | |
go build -o ./build/bbb-webrtc-recorder \ | |
-ldflags="-X '$GOMOD/internal.AppVersion=v${V[0]}-${V[1]} (${GITHUB_SHA::7})'" \ | |
./cmd/bbb-webrtc-recorder | |
cp ./packaging/env ./build/ | |
cp ./packaging/systemd.service ./build/ | |
VERSION=${V[0]}+${GITHUB_SHA::7} RELEASE=${V[1]} \ | |
nfpm pkg -p deb -f ./packaging/nfpm.yml -t ./release | |
apt reinstall -y --allow-downgrades ./release/*.deb | |
bbb-webrtc-recorder -v | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ubuntu-${{ matrix.UBUNTU_VERSION }} | |
path: "release/*.deb" |