-
Notifications
You must be signed in to change notification settings - Fork 11
83 lines (83 loc) · 3.44 KB
/
static-packaging.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
name: Build static deb arm64 packages and put them in zip files
on:
push:
branches:
- main
workflow_dispatch:
pull_request:
jobs:
build:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
architecture: [aarch64-linux-gnu]
build_type: [RelWithDebInfo, MinSizeRel]
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Cache Podman storage
uses: actions/cache@v4
with:
path: ~/.local/share/containers/
key: ${{ runner.os }}-${{ matrix.architecture }}-podman-${{ hashFiles('misc/staticbuildtestcontainer/*') }}
restore-keys: |
${{ runner.os }}-${{ matrix.architecture }}-podman-
- name: Build container for aarch64-linux-gnu
if: matrix.architecture == 'aarch64-linux-gnu'
run: |
podman build --from=docker.io/arm64v8/ubuntu:22.04 --arch=arm64 misc/staticbuildtestcontainer -t container
- name: Run build in container
shell: bash
run: |
# this will link static if no shared alternative lib is available
podman run -v $PWD/.:/aws-greengrass-lite --replace --name ggl container:latest bash -c "\
cd /aws-greengrass-lite && \
rm -rf build/ && \
cmake -B build \
-DGGL_LOG_LEVEL=DEBUG \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_FIND_DEBUG_MODE=ON \
-DGGL_SYSTEMD_SYSTEM_USER=ggcore \
-DGGL_SYSTEMD_SYSTEM_GROUP=ggcore \
-DGGL_SYSTEMD_SYSTEM_DIR=/lib/systemd/system \
-DCMAKE_INSTALL_PREFIX=/usr && \
make -C build -j$(nproc) && \
cd build && cpack -v -G DEB && cd - \
"
sudo chown -R $UID:$(id -g) ~/.local/share/containers
- name: Save package
run: |
mkdir ${{ github.workspace }}/zipfile/
cp ${{ github.workspace }}/build/*.deb ${{ github.workspace }}/zipfile/
- name: Generate readme / install file
run: |
cat ${{ github.workspace }}/.github/workflows/static-packaging/readme.template.txt >> ${{ github.workspace }}/zipfile/readme.txt
cp ${{ github.workspace }}/.github/workflows/packaging/install-greengrass-lite.sh ${{ github.workspace }}/zipfile/
sed -i 's|{{ VERSION_LINK }}|${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|g' ${{ github.workspace }}/zipfile/readme.txt
sed -i 's| {{ UBUNTU_VERSION }}|22.04|g' ${{ github.workspace }}/zipfile/install-greengrass-lite.sh
cat ${{ github.workspace }}/LICENSE >> ${{ github.workspace }}/zipfile/readme.txt
- name: md5sums
run: |
md5sum ${{ github.workspace }}/zipfile/*
- name: Save package
uses: actions/upload-artifact@v4
with:
name:
aws-greengrass-lite-ubuntu-${{ matrix.architecture || 'x86-64'}}_${{
matrix.build_type }}-static
path: |
${{ github.workspace }}/zipfile/*
retention-days: 1
- name:
Save arm64 package without build type - default package to download
if:
matrix.build_type == 'MinSizeRel' && matrix.architecture ==
'aarch64-linux-gnu'
uses: actions/upload-artifact@v4
with:
name: aws-greengrass-lite-ubuntu-arm64-static
path: |
${{ github.workspace }}/zipfile/*
retention-days: 1