-
Notifications
You must be signed in to change notification settings - Fork 67
86 lines (83 loc) · 2.88 KB
/
cpack-deb-debian.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
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
76
77
78
79
80
81
82
83
84
85
86
name: CPack - DEB - Debian
on:
# push代码时触发workflow
push:
# 忽略README.md
paths-ignore:
- "README.md"
- "LICENSE"
- "BUILD.md"
# pull_request时触发workflow
pull_request:
# 忽略README.md
paths-ignore:
- "README.md"
- "LICENSE"
- "BUILD.md"
release:
types: [published]
jobs:
check_commit_msg:
outputs:
commit_message: ${{ steps.get_message.outputs.message }}
name: Check if the workflow has been disabled.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get commit message
id: get_message
run: |
echo "message=$(git log --format=%B -n 1 ${{ github.event.after }})" >> $GITHUB_OUTPUT
linux:
strategy:
fail-fast: false
matrix:
#distro: [stable, testing, sid]
build_type: [Release, RelWithDebInfo]
distro: [testing, sid]
needs: check_commit_msg
if: ${{ !contains( needs.check_commit_msg.outputs.commit_message, 'NO_DEB') }}
name: Debian ${{ matrix.distro }}
runs-on: ubuntu-latest
container: debian:${{ matrix.distro }}
steps:
- name: Install git
run: |
apt-get update
apt-get install -y git
- name: Get the version
id: get_version
shell: bash
run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_OUTPUT
- name: Checking out sources
uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Install build dependencies
run: |
apt-get install -y build-essential ninja-build qtbase5-dev qttools5-dev cmake pkgconf bash libspdlog-dev
- name: Build
run: |
mkdir build
cd build
cmake .. -GNinja -DEMBED_TRANSLATIONS=OFF -DEMBED_DOCS=OFF -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_DEB=ON -DLEMON_BUILD_INFO="Build for Debian" -DLEMON_BUILD_EXTRA_INFO="Build on $(uname -sr)"
cmake --build . --target package --parallel $(nproc)
- name: Get package name
shell: bash
id: get_package
run: |
echo "NAME=$(basename build/LemonLime-*.deb)" >> $GITHUB_OUTPUT
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: LemonLime-${{ steps.get_version.outputs.VERSION }}-debian-${{ matrix.distro }}-${{ matrix.build_type }}.deb
path: build/${{ steps.get_package.outputs.NAME }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
if: startsWith(github.event.ref, 'refs/tags/')
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/${{ steps.get_package.outputs.NAME }}
asset_name: LemonLime-${{ steps.get_version.outputs.VERSION }}-debian-${{ matrix.distro }}-${{ matrix.build_type }}.deb
tag: ${{ github.ref }}
overwrite: true