-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (66 loc) · 2.51 KB
/
dkms-build.yaml
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: DKMS package building workflow
on:
# Trigger manually
workflow_dispatch:
# Trigger when "v____" tags are pushed
push:
tags:
- 'v**'
jobs:
build:
name: DKMS packages build
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Change directory to repo clone
run: cd $GITHUB_WORKSPACE
- name: Set card model and driver version from dkms.conf
run: |
source "./src/dkms.conf" && \
echo "ENV_CARD_MODEL=${PACKAGE_NAME}" >> $GITHUB_ENV && \
echo "ENV_DRIVER_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV
- name: Build Docker image
run: |
docker build \
-t dkms-builder \
--build-arg=CARD_MODEL="$ENV_CARD_MODEL" \
--build-arg=DRIVER_VERSION="$ENV_DRIVER_VERSION" \
.
- name: Build DKMS packages in Docker container
id: build_dkms
run: docker run --rm --volume $(pwd)/output:/output dkms-builder
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.ENV_DRIVER_VERSION }}
release_name: ${{ env.ENV_CARD_MODEL }}-${{ env.ENV_DRIVER_VERSION }}
- name: Upload RPM package
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./output/${{ steps.build_dkms.outputs.rpm_package }}
asset_name: ${{ steps.build_dkms.outputs.rpm_package }}
asset_content_type: application/x-rpm
- name: Upload DEB package
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./output/${{ steps.build_dkms.outputs.deb_package }}
asset_name: ${{ steps.build_dkms.outputs.deb_package }}
asset_content_type: application/vnd.debian.binary-package
- name: Upload checksum
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./output/${{ steps.build_dkms.outputs.checksum_file }}
asset_name: ${{ steps.build_dkms.outputs.checksum_file }}
asset_content_type: text/plain