Skip to content

0.55.14

0.55.14 #23

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Build & Release
on:
workflow_dispatch:
release:
types: [created, edited]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Tidy Up Modules
run: go mod tidy
- name: Build Binaries
run: |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-extldflags=-static" -o HFP_amd64 *.go
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-extldflags=-static" -o HFP_arm64 *.go
- name: Patch NFPM Version
run: |
sudo sed -i "s/0.0.0/${{ github.ref_name || github.event.release.tag_name }}/g" hfp.yml
- name: Create deb package
id: nfpm-deb
uses: burningalchemist/nfpm-action@v1
env:
VERSION: ${{ github.event.release.tag_name }}
with:
packager: deb
config: hfp.yml
target: HFP_${{ github.ref_name || github.event.release.tag_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: hfp.yml
target: HFP_${{ github.ref_name || github.event.release.tag_name }}.amd64.rpm
- name: Upload Release
uses: boxpositron/upload-multiple-releases@1.0.7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_config: |
./HFP_amd64
./HFP_arm64
./HFP_${{ github.ref_name || github.event.release.tag_name }}_all.deb
./HFP_${{ github.ref_name || github.event.release.tag_name }}.amd64.rpm
tag_name: ${{ github.ref_name ||github.event.release.tag_name }}
release_name: ${{ github.ref_name || github.event.release.tag_name }}
draft: false
prerelease: false
overwrite: true
- name: Log in to the Container registry
uses: docker/login-action@v2.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Build and push
uses: docker/build-push-action@v3.0.0
with:
context: .
push: true
tags: |
ghcr.io/sipcapture/hfp:latest
ghcr.io/sipcapture/hfp:${{ github.ref_name || github.event.release.tag_name }}