v0.0.8 #16
Workflow file for this run
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
name: RTCAgent Builder | |
on: | |
workflow_dispatch: | |
release: | |
types: [created] | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/[email protected] | |
with: | |
go-version: 1.21 | |
- name: Setup Build Env | |
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com//sipcapture/rtcagent/master/builder/init_env.sh)" | |
- name: Build RTCAgent | |
run: make | |
- name: Compress | |
run: | | |
# strip bin/rtcagent | |
upx bin/rtcagent | |
- name: Check & Run | |
run: | | |
ls -alFh bin/rtcagent | |
./bin/rtcagent --help | |
- name: Patch NFPM Version | |
run: | | |
sudo sed -i "s/0.0.0/${{ github.ref_name }}/g" rtcagent.yml | |
- name: Create deb package | |
id: nfpm-deb | |
uses: burningalchemist/nfpm-action@v1 | |
env: | |
VERSION: ${{ github.event.release.tag_name }} | |
with: | |
packager: deb | |
config: rtcagent.yml | |
target: rtcagent_${{ github.ref_name }}_all.deb | |
- name: Create rpm package | |
id: nfpm-rpm | |
uses: burningalchemist/nfpm-action@v1 | |
env: | |
VERSION: ${{ github.event.release.tag_name }} | |
with: | |
packager: rpm | |
config: rtcagent.yml | |
target: rtcagent_${{ github.ref_name }}.amd64.rpm | |
- name: Upload Release | |
if: github.event_name != 'pull_request' | |
uses: boxpositron/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
release_config: | | |
./bin/rtcagent | |
./rtcagent_${{ github.ref_name }}_all.deb | |
./rtcagent_${{ github.ref_name }}.amd64.rpm | |
tag_name: ${{ github.ref_name }} | |
release_name: rtcagent_${{ github.ref_name }} | |
draft: false | |
prerelease: false | |
overwrite: true | |
- name: Log in to the Container registry | |
uses: docker/[email protected] | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Docker Build and push | |
uses: docker/[email protected] | |
with: | |
context: . | |
push: true | |
tags: | | |
ghcr.io/sipcapture/rtcagent:latest | |
ghcr.io/sipcapture/rtcagent:${{ github.ref_name }} |