Skip to content

Experimental Build #659

Experimental Build

Experimental Build #659

Workflow file for this run

name: Experimental Build
on:
push:
branches:
- "**"
paths:
- "playbooks/**"
- "inventory"
- "ansible.cfg"
- ".github/workflows/experimental.yml"
workflow_dispatch:
# No inputs defined here so that push behaviour matches all manual builds
schedule:
# Run daily at midnight
- cron: '0 0 * * *'
pull_request:
branches:
- master
env:
DISTRO_NAME: "bullseye"
REPO_NAME: "experimental"
jobs:
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
build_type_suffix: ["", "-lite"]
architecture: ["armhf", "arm64"]
steps:
- name: GitHub Environment Variables Action
uses: FranzDiebold/github-env-vars-action@v2.7.0
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: aarcangeli/load-dotenv@v1.0.0
- name: Get build type and RPi OS image name
run: |
build_type="${{ matrix.architecture }}${{ matrix.build_type_suffix }}"
echo "BUILD_TYPE=${build_type}" >> $GITHUB_ENV
echo "IMAGE_NAME=${{ env.RASPIOS_BUILD_DATE }}-raspios-${{ env.DISTRO_NAME }}-${build_type}" >> $GITHUB_ENV
- name: Install ansible and playbook dependencies
# Install 'qemu-user-static' >v5 to allow 'arm64' chroot
# 'ubuntu-20.04' (currently latest) does not have an up-to-date version, so we install from `ubuntu-security` repo
run: |
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/q/qemu/qemu-user-static_5.2+dfsg-9ubuntu3.1_amd64.deb
sudo apt-get update && sudo apt-get install -y \
ansible \
unzip \
zerofree \
./qemu-user-static_5.2+dfsg-9ubuntu3.1_amd64.deb
- name: Build
run: |
export ANSIBLE_FORCE_COLOR=true
export TERM=xterm-color
# chroot connection requires running as root
# 'ansible-playbook' is not in root user's PATH
ANSIBLE="sudo $(which ansible-playbook) -i inventory -vv"
build_type_dir="raspios_$(echo ${{ env.BUILD_TYPE }} | python3 -c "import sys; print('_'.join(reversed(sys.stdin.read().strip().split('-'))))")"
url="https://downloads.raspberrypi.org/${build_type_dir}/images/${build_type_dir}-${{ env.RASPIOS_RELEASE_DATE }}/${{ env.IMAGE_NAME }}.img.xz"
echo "==> Running get_raspios playbook..."
${ANSIBLE} --extra-vars "raspi_os_url=${url}" \
--extra-vars "image_name=${{ env.IMAGE_NAME }}" \
playbooks/get_raspios.yml
echo "==> Running mount_raspios playbook..."
${ANSIBLE} --extra-vars "image_name=${{ env.IMAGE_NAME }}" \
playbooks/mount_raspios.yml
echo "==> Running create_pi_top_os_image playbook..."
${ANSIBLE} playbooks/create_pi_top_os_image.yml
echo "==> Running mount_pi_top_os playbook..."
${ANSIBLE} playbooks/mount_pi_top_os.yml
echo "==> Running install_pi_top_os playbook..."
${ANSIBLE} --extra-vars "repo_name=${{ env.REPO_NAME }}" \
--extra-vars "distro_name=${{ env.DISTRO_NAME }}" \
--extra-vars "top_level_pkg=pt-os${{ matrix.build_type_suffix }}" \
--extra-vars "architecture=${{ matrix.architecture }}" \
--extra-vars "{'full_install': ${{ matrix.build_type_suffix == '' }}}" \
playbooks/install_pi_top_os.yml
echo "==> Running configure_pi_top_os playbook..."
${ANSIBLE} --extra-vars "distro_name=${{ env.DISTRO_NAME }}" \
--extra-vars "build_number=${{ github.run_number || github.run_id }}" \
--extra-vars "build_repo_commit=$(git rev-parse HEAD)" \
--extra-vars "build_repo_commit_short=$(git rev-parse --short HEAD)" \
--extra-vars "build_action_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
--extra-vars "build_repo_name=${{ env.REPO_NAME }}" \
--extra-vars "build_type=${{ env.BUILD_TYPE }}" \
playbooks/configure_pi_top_os.yml
echo "==> Running finalise_pi_top_image playbook..."
${ANSIBLE} --extra-vars "distro_name=${{ env.DISTRO_NAME }}" \
--extra-vars "build_number=${{ github.run_number || github.run_id }}" \
--extra-vars "build_repo_name=${{ env.REPO_NAME }}" \
--extra-vars "build_type=${{ env.BUILD_TYPE }}" \
playbooks/finalise_pi_top_image.yml
echo "==> Running analyse_build playbook..."
${ANSIBLE} --extra-vars "build_number=${{ github.run_number || github.run_id }}" \
playbooks/analyse_build.yml
- name: Get current date
id: date
run: echo "DATE_STAMP=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Upload OS zip contents
uses: actions/upload-artifact@v3
with:
name: pi-topOS_${{ env.DISTRO_NAME }}_${{ env.REPO_NAME }}_${{ env.BUILD_TYPE }}_${{ env.DATE_STAMP }}_B${{ github.run_number || github.run_id }}
if-no-files-found: error
path: |
playbooks/artifacts/*
!**/*.zip
- name: Print metadata
run: cat playbooks/artifacts/metadata.txt