-
Notifications
You must be signed in to change notification settings - Fork 4
130 lines (126 loc) · 3.95 KB
/
main.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Build
on:
push:
paths:
- .github/workflows/main.yml
- 'src/**'
tags:
- '*'
branches:
- '**'
pull_request:
env:
CARGO_TERM_COLOR: always
PIPEWIRE_VERSION: '0.3.77'
jobs:
Build:
name: 'Build'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout
- name: Check formatting
run: cargo fmt --check --verbose
- name: Install system dependencies
run: |
sudo apt install meson ninja-build libdbus-1-dev llvm-dev libclang-dev clang
- uses: actions/cache@v3
name: Restore PipeWire cache
id: pipewire-cache
with:
key: ${{ env.PIPEWIRE_VERSION }}
path: 'pipewire'
- uses: actions/checkout@v3
name: Checkout PipeWire
if: steps.pipewire-cache.outputs.cache-hit != 'true'
with:
repository: pipewire/pipewire
ref: ${{ env.PIPEWIRE_VERSION }}
path: 'pipewire'
- name: Build PipeWire
if: steps.pipewire-cache.outputs.cache-hit != 'true'
working-directory: 'pipewire'
run: |
meson setup builddir
meson configure builddir -Dprefix=/usr \
-Dauto_features=disabled \
-Davb=disabled \
-Dlegacy-rtkit=false \
-Dpw-cat=disabled \
-Dsndfile=disabled \
-Daudiotestsrc=disabled \
-Dvideotestsrc=disabled \
-Daudiomixer=disabled \
-Dvideoconvert=disabled \
-Dcontrol=disabled \
-Dsupport=disabled \
-Draop=disabled \
-Dflatpak=disabled \
-Dvolume=disabled \
-Dvulkan=disabled \
-Ddbus=disabled \
-Ddocs=disabled \
-Dman=disabled \
-Dlibcamera=disabled \
-Dsystemd=disabled \
-Dalsa=disabled \
-Dpipewire-alsa=disabled \
-Djack=disabled \
-Dpipewire-jack=disabled \
-Dudev=disabled \
-Dbluez5=disabled \
-Dgstreamer=disabled \
-Dsession-managers=[] \
-Dexamples=disabled \
-Dtests=disabled
meson compile -C builddir
- name: Install PipeWire
working-directory: 'pipewire'
run: sudo meson install -C builddir
- uses: actions/cache@v3
name: Restore Cargo cache
id: cargo-cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Cargo tools
if: steps.cargo-cache.outputs.cache-hit != 'true'
run: cargo install cargo-deb cargo-generate-rpm
- name: Build
run: cargo build --release --verbose --all-features
- uses: actions/upload-artifact@v3
name: Upload binary
with:
name: coppwr
path: target/release/coppwr
- name: Package
run: |
case "$GITHUB_REF" in
*tags*) NAME=coppwr-$GITHUB_REF_NAME ;;
*) NAME=coppwr-$GITHUB_REF_NAME-$GITHUB_SHA ;;
esac
NAME="${NAME//\//-}"
mkdir out/
cargo deb -v --no-build --output out/"$NAME".deb
cargo generate-rpm -o out/"$NAME".rpm
mkdir .cargo
cargo vendor -v > .cargo/config.toml
tar --exclude='out' --exclude='.git*' --exclude='coppwr/pipewire' --exclude='coppwr/target' --transform "s|coppwr|$NAME|" -zcvf out/"$NAME"-vendor.tar.gz -C .. coppwr/
- uses: actions/upload-artifact@v3
name: Upload packages
with:
name: coppwr-deb-rpm
path: |
out/*.deb
out/*.rpm
- uses: actions/upload-artifact@v3
name: Upload vendor archive
with:
name: coppwr-vendor
path: |
out/*-vendor.tar.gz