Skip to content

Commit 89e2983

Browse files
committed
add github actions workflow
1 parent cda6a25 commit 89e2983

3 files changed

Lines changed: 75 additions & 0 deletions

File tree

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.*/
2+
build/
3+
Dockerfile*

.github/workflows/build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build
2+
on:
3+
- push
4+
jobs:
5+
build:
6+
name: Build
7+
strategy:
8+
matrix:
9+
include:
10+
- image_name: debian
11+
image_tag: 11
12+
- image_name: ubuntu
13+
image_tag: 20.04
14+
- image_name: ubuntu
15+
image_tag: 22.04
16+
runs-on: ubuntu-20.04
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Build
20+
run: |
21+
set -euxo pipefail
22+
export DOCKER_BUILDKIT=1
23+
docker build \
24+
--progress=plain \
25+
--output=build \
26+
--target=artifacts \
27+
--build-arg=IMAGE=${{ matrix.image_name }}:${{ matrix.image_tag }} \
28+
.
29+
for p in build/*.deb; do
30+
mv "$p" "${p/-Linux\.deb/-${{ matrix.image_name }}-${{ matrix.image_tag }}.deb}"
31+
done
32+
- name: Archive
33+
uses: actions/upload-artifact@v2
34+
with:
35+
name: Artifacts
36+
path: |
37+
build/*.deb

Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
ARG IMAGE=debian:11
2+
ARG NETWORK_NM=OFF
3+
ARG NETWORK_CM=OFF
4+
FROM ${IMAGE} as build
5+
ENV DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC
6+
RUN apt-get update && \
7+
apt-get install -y \
8+
cmake \
9+
file \
10+
g++ \
11+
git \
12+
python3 \
13+
libace-dev \
14+
libglib2.0-dev \
15+
libcurl4-openssl-dev \
16+
libxerces-c-dev \
17+
libnl-3-dev \
18+
libnl-route-3-dev \
19+
libxml2-dev
20+
COPY . /lms/
21+
RUN set -x && \
22+
cd /lms && \
23+
mkdir build && \
24+
cd build && \
25+
cmake \
26+
-DCMAKE_INSTALL_PREFIX=/usr \
27+
-DNETWORK_NM=${NETWORK_NM} \
28+
-DNETWORK_CM=${NETWORK_CM} \
29+
.. && \
30+
make -j$(nproc) package && \
31+
dpkg-deb --info *.deb && \
32+
dpkg-deb --contents *.deb
33+
34+
FROM scratch as artifacts
35+
COPY --from=build /lms/build/*.deb /

0 commit comments

Comments
 (0)