mirror of https://github.com/wolfSSL/wolfBoot.git
95 lines
2.9 KiB
YAML
95 lines
2.9 KiB
YAML
name: Wolfboot Reusable Build Workflow
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
inputs:
|
|
arch:
|
|
required: true
|
|
type: string
|
|
config-file:
|
|
required: true
|
|
type: string
|
|
make-args:
|
|
required: false
|
|
type: string
|
|
|
|
jobs:
|
|
|
|
build:
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 30
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Workaround for sources.list
|
|
run: |
|
|
# Replace sources
|
|
|
|
set -euxo pipefail
|
|
|
|
# Peek (what repos are active now)
|
|
apt-cache policy
|
|
grep -RInE '^(deb|Types|URIs)' /etc/apt || true
|
|
|
|
# Enable nullglob so *.list/*.sources that don't exist don't break sed
|
|
shopt -s nullglob
|
|
|
|
echo "Replace sources.list (legacy)"
|
|
sudo sed -i \
|
|
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
|
|
/etc/apt/sources.list || true
|
|
|
|
echo "Replace sources.list.d/*.list (legacy)"
|
|
for f in /etc/apt/sources.list.d/*.list; do
|
|
sudo sed -i \
|
|
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
|
|
"$f"
|
|
done
|
|
|
|
echo "Replace sources.list.d/*.sources (deb822)"
|
|
for f in /etc/apt/sources.list.d/*.sources; do
|
|
sudo sed -i \
|
|
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
|
|
-e "s|https\?://azure\.archive\.ubuntu\.com|http://mirror.arizona.edu|g" \
|
|
"$f"
|
|
done
|
|
|
|
echo "Fix /etc/apt/apt-mirrors.txt (used by URIs: mirror+file:...)"
|
|
if grep -qE '^[[:space:]]*https?://azure\.archive\.ubuntu\.com/ubuntu/?' /etc/apt/apt-mirrors.txt; then
|
|
# Replace azure with our mirror (idempotent)
|
|
sudo sed -i 's|https\?://azure\.archive\.ubuntu\.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/apt-mirrors.txt
|
|
fi
|
|
|
|
# Peek (verify changes)
|
|
grep -RIn "azure.archive.ubuntu.com" /etc/apt || true
|
|
grep -RInE '^(deb|Types|URIs)' /etc/apt || true
|
|
echo "--- apt-mirrors.txt ---"
|
|
cat /etc/apt/apt-mirrors.txt || true
|
|
|
|
- name: Update repository
|
|
run: sudo apt-get update -o Acquire::Retries=3
|
|
|
|
- name: Install cross compilers
|
|
run: |
|
|
sudo apt-get install -y gcc-arm-none-eabi gcc-aarch64-linux-gnu gcc-powerpc-linux-gnu gnu-efi
|
|
|
|
- name: make clean
|
|
run: |
|
|
make distclean
|
|
|
|
- name: Select config
|
|
run: |
|
|
cp ${{inputs.config-file}} .config
|
|
|
|
- name: Build tools
|
|
run: |
|
|
make -C tools/keytools && make -C tools/bin-assemble
|
|
|
|
- name: Build wolfboot
|
|
run: |
|
|
make ${{inputs.make-args}}
|