-
Notifications
You must be signed in to change notification settings - Fork 57
93 lines (87 loc) · 3.78 KB
/
arm-build.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
name: ARM builds
on:
push:
branches:
- arm-build
schedule:
- cron: '0 4 * * 2' # Tuesday at 4:00 UTC
workflow_dispatch:
jobs:
Build:
if: github.repository == 'CESNET/UltraGrid' || github.event.schedule == null
runs-on: ubuntu-latest
strategy:
matrix:
arch: [armhf, arm64]
include:
- arch: armhf
repo: http://mirrordirector.raspbian.org/raspbian/
keyring: /etc/apt/trusted.gpg
qemu_bin_arch: arm
deb_release: bullseye
- arch: arm64
repo: https://deb.debian.org/debian
keyring: /usr/share/keyrings/debian-archive-keyring.gpg
qemu_bin_arch: aarch64
deb_release: bullseye
steps:
- uses: actions/checkout@v4
- name: Prepare
run: |
sudo apt update
sudo apt install binfmt-support curl qemu qemu-user-static
- name: Fetch SDKs ETags
id: etags
run: |
echo "ndi=$($GITHUB_WORKSPACE/.github/scripts/get-etags.sh https://downloads.ndi.tv/SDK/NDI_SDK_Linux/Install_NDI_SDK_v5_Linux.tar.gz)" >> $GITHUB_OUTPUT
- name: Cache NDI
id: cache-ndi
uses: actions/cache@main
with:
path: /var/tmp/Install_NDI_SDK_Linux.tar.gz
key: cache-ndi-${{ runner.os }}-${{ steps.etags.outputs.ndi }}
- name: Download NDI
if: steps.cache-ndi.outputs.cache-hit != 'true'
run: curl -L https://downloads.ndi.tv/SDK/NDI_SDK_Linux/Install_NDI_SDK_v5_Linux.tar.gz -o /var/tmp/Install_NDI_SDK_Linux.tar.gz
- name: Cache Environment
id: cache-bootstrap
uses: actions/cache@main
with:
path: '~/chroot.tar'
key: cache-bootstrap-${{ matrix.arch }}-${{ hashFiles('.github/scripts/Linux/arm/bootstrap.sh', '.github/scripts/Linux/install_others.sh') }}
- name: Debootstrap
if: steps.cache-bootstrap.outputs.cache-hit != 'true'
run: |
sudo apt install debootstrap debian-archive-keyring
sudo rm -rf ~/chroot
sudo mkdir -p ~/chroot/var/tmp
sudo mv /var/tmp/*NDI* ~/chroot/var/tmp
wget http://archive.raspbian.org/raspbian.public.key -O - | sudo apt-key add -q
sudo debootstrap --keyring=${{ matrix.keyring }} --arch ${{ matrix.arch }} ${{ matrix.deb_release }} ~/chroot ${{ matrix.repo }}
sudo cp -r $GITHUB_WORKSPACE/.github ~/chroot/
sudo cp /usr/bin/qemu-${{ matrix.qemu_bin_arch }}-static ~/chroot/usr/bin/
sudo chroot ~/chroot /.github/scripts/Linux/arm/bootstrap.sh ${{ matrix.arch }}
cd ~ && sudo tar cf chroot.tar chroot # Create archive for caching. Needs to be created as root, therefore created manually.
- name: Extract Cached Environment
if: steps.cache-bootstrap.outputs.cache-hit == 'true'
run: |
cd ~
sudo tar xf chroot.tar
- name: Build
run: |
sudo cp -ar $GITHUB_WORKSPACE ~/chroot/UltraGrid
env | grep -v '^\(HOME\)\|\(USER\)' | sed -e "s/=/='/" -e "s/$/'/" | sudo tee ~/chroot/envvars
sudo chroot ~/chroot /bin/sh -ec "set -a; . /envvars; set +a; cd UltraGrid; .github/scripts/Linux/arm/build.sh"
- name: Upload Release Asset
id: upload-release-asset
if: github.repository == 'CESNET/UltraGrid'
run: |
sudo apt install jq
sudo .github/scripts/replace-asset.sh GITHUB_REPOSITORY=$GITHUB_REPOSITORY GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} continuous ~/chroot/UltraGrid/UltraGrid-latest-${{ matrix.arch }}.AppImage application/x-appimage Linux%20${{ matrix.arch }}%20build
- name: Upload Build
if: steps.upload-release-asset.conclusion == 'skipped'
uses: actions/upload-artifact@main
with:
name: UltraGrid CI ${{ matrix.arch }} build
path: '~/chroot/UltraGrid/UltraGrid-latest-${{ matrix.arch }}.AppImage'
# vi: set expandtab sw=2: