Skip to content
This repository was archived by the owner on Jun 3, 2023. It is now read-only.

Commit de1a5c0

Browse files
committed
Set-up automated Debian packaging
1 parent 6b62c47 commit de1a5c0

File tree

7 files changed

+95
-0
lines changed

7 files changed

+95
-0
lines changed

.github/workflows/release.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- feature/ci
7+
8+
tags:
9+
- v[0-9]*
10+
- testing-ci.*
11+
12+
jobs:
13+
debian:
14+
name: Build Debian Package
15+
runs-on: ubuntu-latest
16+
container: debian:sid
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
21+
- name: Install dependencies
22+
run: |
23+
sed 's/^deb /deb-src /' /etc/apt/sources.list >> /etc/apt/sources.list
24+
apt-get -y update
25+
apt-get -y install build-essential fakeroot debhelper dpkg-sig
26+
27+
- name: Build package
28+
run: ./pkg/debian/makedeb
29+
30+
- name: Sign package
31+
env:
32+
GPG_KEY_ID: 56C464BAAC421453
33+
GPG_KEY: ${{ secrets.SURFACE_GPG_KEY }}
34+
run: |
35+
cd pkg/debian
36+
37+
# import GPG key
38+
echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes
39+
export GPG_TTY=$(tty)
40+
41+
# sign package
42+
dpkg-sig -g "--batch --no-tty" --sign builder -k $GPG_KEY_ID ./*.deb
43+
44+
- name: Prepare release
45+
run: |
46+
mkdir release
47+
mv ./pkg/debian/*.deb release
48+
49+
- name: Upload artifacts
50+
uses: actions/upload-artifact@v1
51+
with:
52+
name: debian-latest
53+
path: release

pkg/debian/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source
2+
*.buildinfo
3+
*.changes
4+
*.deb

pkg/debian/debian/changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
surface-ipts-firmware (1.0.0) unstable; urgency=medium
2+
3+
* Initial release.
4+
5+
-- Maximilian Luz <luzmaximilian@gmail.com> Thu, 09 Jan 2020 22:31:43 +0100

pkg/debian/debian/compat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9

pkg/debian/debian/control

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Source: surface-ipts-firmware
2+
Section: misc
3+
Priority: optional
4+
Maintainer: Maximilian Luz <luzmaximilian@gmail.com>
5+
Build-Depends: build-essential, debhelper (>= 9)
6+
7+
Package: surface-ipts-firmware
8+
Architecture: amd64
9+
Description: Intel Precise Touch and Stylus firmware for Microsoft Surface devices

pkg/debian/debian/rules

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/make -f
2+
export DH_VERBOSE = 1
3+
4+
pkgdir = debian/surface-ipts-firmware
5+
6+
override_dh_install:
7+
find firmware -type f -name "*.bin" -exec install -D -m644 "{}" "${pkgdir}/lib/{}" \;
8+
9+
%:
10+
dh $@

pkg/debian/makedeb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
set -e
3+
4+
basepath="$( cd "$(dirname "$0")" ; pwd -P )"
5+
6+
# prepare source
7+
rm -rf "${basepath}/source" && mkdir -p "${basepath}/source"
8+
cp -r "${basepath}/../../firmware" "${basepath}/source/"
9+
cp -r "${basepath}/debian" "${basepath}/source/"
10+
11+
# build package
12+
cd "${basepath}/source"
13+
dpkg-buildpackage -b -us -uc

0 commit comments

Comments
 (0)