-
Notifications
You must be signed in to change notification settings - Fork 8
35 lines (32 loc) · 1.55 KB
/
kmod.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Build the kernel module
on: [push, pull_request]
jobs:
build-kmod:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v2
with:
submodules: true
- run: sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive apt-get install dkms linux-headers-`uname -r` build-essential devscripts dh-make
- run: source dkms.conf && echo "BUILT_MODULE_NAME=$BUILT_MODULE_NAME" >> $GITHUB_ENV && echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
- run: echo "DKMS_DIR=/usr/src/${BUILT_MODULE_NAME}-${PACKAGE_VERSION}" >> $GITHUB_ENV
- run: sudo mkdir $DKMS_DIR
- run: sudo cp -r * $DKMS_DIR
- run: sudo dkms build -m $BUILT_MODULE_NAME -v $PACKAGE_VERSION
- run: sudo dkms mktarball -m $BUILT_MODULE_NAME -v $PACKAGE_VERSION --source-only
- run: sudo dkms mkdeb -m $BUILT_MODULE_NAME -v $PACKAGE_VERSION --source-only
- name: Find debian package
id: dkms_path
run: |
export F="$(sudo find /var/lib/dkms/${BUILT_MODULE_NAME}/${PACKAGE_VERSION}/deb/${BUILT_MODULE_NAME}-dkms_${PACKAGE_VERSION}*.deb)"
echo $F
echo "::set-output name=path::$F"
echo "::set-output name=name::$(basename $F)"
- name: Find tarball
id: tarball_path
run: |
export F="$(sudo find /var/lib/dkms/${BUILT_MODULE_NAME}/${PACKAGE_VERSION}/tarball/${BUILT_MODULE_NAME}-${PACKAGE_VERSION}*.tar.gz)"
echo $F
echo "::set-output name=path::$F"
echo "::set-output name=name::$(basename $F)"