-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (58 loc) · 1.75 KB
/
deb.yml
File metadata and controls
68 lines (58 loc) · 1.75 KB
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
name: Build .deb
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag:
description: "Tag to be published"
required: true
type: string
permissions:
contents: write
jobs:
build-deb:
runs-on: ubuntu-latest
env:
RELEASE_TAG: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || github.event.inputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install build tooling
run: |
sudo apt-get update
sudo apt-get install -y build-essential debhelper devscripts fakeroot python3 python3-pip python3-venv nodejs npm
- name: Validate Python sources
run: python3 -m compileall host-agent
- name: Build UI assets
run: |
cd host-agent/ui
npm install --no-audit --no-fund --no-save
npm run build
- name: Prepare debian directory
run: |
rm -rf debian
cp -a host-agent/debian debian
ls -ld debian
- name: Build package
run: |
dpkg-buildpackage -us -uc
mkdir -p artifacts
find .. -maxdepth 1 -type f \( -name '*.deb' -o -name '*.dsc' -o -name '*.changes' -o -name '*.buildinfo' -o -name '*.tar.*' \) -exec mv {} artifacts/ \;
ls -l artifacts
- name: Upload .deb artifacts
uses: actions/upload-artifact@v4
with:
name: debs
path: artifacts/*.deb
- name: Attach to GitHub Release
if: env.RELEASE_TAG != ''
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.RELEASE_TAG }}
files: artifacts/*.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}