Files
UltraGrid/.github/workflows/arm-build.yml
Martin Pulec 5fdaef03a3 GitHub CI [Linux ARM]: use code checked out by GitHub
Use code checked out by GitHub Action - previously there was a clone
but we want rather the actual code, which doesn't need to be in master
branch of the main repository.

This also requires a small refactor (chroot in home rather than in
$GITHUB_WORKSPACE)
2021-05-21 19:40:15 +02:00

67 lines
2.5 KiB
YAML

name: ARM builds
on:
push:
branches:
- arm-build
jobs:
Build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [armhf, arm64]
include:
- arch: armhf
repo: http://mirrordirector.raspbian.org/raspbian/
keyring: /etc/apt/trusted.gpg
- arch: arm64
repo: https://deb.debian.org/debian
keyring: /usr/share/keyrings/debian-archive-keyring.gpg
steps:
- uses: actions/checkout@v1
- name: Prepare
run: |
sudo apt update
sudo apt install binfmt-support qemu qemu-user-static
- name: Cache Environment
id: cache-bootstrap
uses: actions/cache@v2
with:
path: '~/chroot.tar'
key: cache-bootstrap-${{ matrix.arch }}-6
- name: Debootstrap
if: steps.cache-bootstrap.outputs.cache-hit != 'true'
run: |
sudo apt install debootstrap debian-archive-keyring
sudo mkdir ~/chroot
wget http://archive.raspbian.org/raspbian.public.key -O - | sudo apt-key add -q
sudo qemu-debootstrap --keyring=${{ matrix.keyring }} --arch ${{ matrix.arch }} buster ~/chroot ${{ matrix.repo }}
sudo cp $GITHUB_WORKSPACE/.github/scripts/Linux/arm/{bootstrap.sh,mksquashfs-compilation-fix.patch} ~/chroot
sudo chroot ~/chroot /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
sudo chroot ~/chroot /bin/sh -ec "cd UltraGrid; .github/scripts/Linux/arm/build.sh"
- name: Upload Build
if: github.repository != 'CESNET/UltraGrid' || github.ref != 'refs/heads/arm-build'
uses: actions/upload-artifact@v2
with:
name: UltraGrid CI ${{ matrix.arch }} build
path: '~/chroot/UltraGrid/UltraGrid-latest-${{ matrix.arch }}.AppImage'
- name: Upload Release Asset
if: github.repository == 'CESNET/UltraGrid' && github.ref == 'refs/heads/arm-build'
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
# vi: set expandtab sw=2: