Skip to content

Commit

Permalink
build a binary deb package instead of a source package - life is way …
Browse files Browse the repository at this point in the history
…too short for all this hassle!
  • Loading branch information
ftl committed Apr 2, 2021
1 parent 0ad0eb4 commit a8b2f54
Show file tree
Hide file tree
Showing 9 changed files with 129 additions and 56 deletions.
17 changes: 6 additions & 11 deletions debian/control → .debpkg/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
Source: hamdeck
Section: ham
Priority: extra
Package: hamdeck
Architecture: amd64
Section: universe/hamradio
Priority: optional
Version: !THE_VERSION!
Maintainer: Florian Thienel <[email protected]>
Homepage: http://github.com/ftl/hamdeck
Build-Depends:
debhelper (>= 12),
golang-go (>= 2:1.16),
libhidapi-libusb0 (>= 0.9)

Package: hamdeck
Architecture: amd64 i386 armhf
Recommends: pulseaudio
Bugs: http://github.com/ftl/hamdeck/issues
Description: HamDeck allows you to control and automate your ham radio station
using an Elgato Stream Deck device. You can define buttons using a JSON
configuration file. HamDeck connects to the local pulseaudio server, to a
Expand Down
File renamed without changes.
File renamed without changes.
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Continuous Build

on:
push:
branches:
- master
- "**"
pull_request:
branches:
- master

jobs:

build:
name: Continuous Build
runs-on: ubuntu-20.04
steps:
- name: Install Linux packages
run: sudo apt update && sudo apt install -y --no-install-recommends debhelper libhidapi-libusb0

- name: Set up Go 1.16
uses: actions/setup-go@v2
with:
go-version: 1.16
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Caching build artifacts and modules
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}

- name: Get dependencies
run: go get -v -t -d ./...

- name: Build and Test
run: env VERSION=ci@$GITHUB_REF make

- name: 'Upload binary for linux_x86_64'
uses: actions/upload-artifact@v2
with:
name: hamdeck-binary
path: ./hamdeck
72 changes: 72 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Release Build

on:
push:
tags:
- 'v*.*.*'
branches:
- releng

jobs:

build:
name: Release Build
runs-on: ubuntu-20.04
steps:
- id: version_number
run: echo "::set-output name=version_number::$(echo '${{github.ref}}' | sed -E 's#refs/tags/v##')"

- name: Install Linux packages
run: sudo apt update && sudo apt install -y --no-install-recommends debhelper libhidapi-libusb0

- name: Set up Go 1.16
uses: actions/setup-go@v2
with:
go-version: 1.16
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Caching build artifacts and modules
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}

- name: Get dependencies
run: go get -v -t -d ./...

- name: Build and Test
run: |
echo "Version ${{ steps.version_number.outputs.version_number }}"
env VERSION="${{ steps.version_number.outputs.version_number }}" make
- name: Create package structure
run: |
mkdir -p ./.debpkg/usr/bin
cp ./hamdeck ./.debpkg/usr/bin/hamdeck
chmod +x ./.debpkg/usr/bin/hamdeck
mkdir -p ./.debpkg/usr/share/hamdeck
cp ./example_conf.json ./.debpkg/usr/share/hamdeck/example_conf.json
- name: Create deb package
run: ./build-debpkg.sh ${{ steps.version_number.outputs.version_number }}

- id: package_filename
run: echo "::set-output name=package_filename::$(ls ./hamdeck*.deb | head -n 1)"

- name: 'Upload package for linux_x86_64'
uses: actions/upload-artifact@v2
with:
name: hamdeck-package
path: ./hamdeck*.deb

- name: Upload package to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.package_filename.outputs.package_filename }}
tag: ${{ github.ref }}
3 changes: 3 additions & 0 deletions build-debpkg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
sed -i -E "s#!THE_VERSION!#$1#" ./.debpkg/DEBIAN/control
dpkg-deb --build ./.debpkg .
5 changes: 0 additions & 5 deletions debian/changelog

This file was deleted.

1 change: 0 additions & 1 deletion debian/compat

This file was deleted.

39 changes: 0 additions & 39 deletions debian/rules

This file was deleted.

0 comments on commit a8b2f54

Please sign in to comment.