client-release #64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Image | |
on: | |
push: | |
branches: | |
- "main" | |
workflow_dispatch: | |
repository_dispatch: | |
types: [client-release, firmware-release] | |
concurrency: | |
group: "build" | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clear workspace | |
run: sudo rm -rf * | |
- name: Install Dependencies | |
run: | | |
sudo apt update | |
sudo apt -y --force-yes install coreutils p7zip-full qemu-user-static wget python3 python3-dev zip | |
- name: Checkout CustomPiOS | |
uses: actions/checkout@v3 | |
with: | |
repository: "guysoft/CustomPiOS" | |
path: CustomPiOS | |
- name: Checkout Project Repository | |
uses: actions/checkout@v3 | |
with: | |
path: repository | |
submodules: true | |
- name: Download Raspbian Image | |
run: | | |
cd repository/src/image | |
wget -c --trust-server-names 'https://downloads.raspberrypi.org/raspios_lite_armhf_latest' | |
- name: Update CustomPiOS Paths | |
run: | | |
cd repository/src | |
../../CustomPiOS/src/update-custompios-paths | |
- name: Force apt mirror to work around intermittent mirror hiccups | |
run: | | |
echo "OCTOPI_APTMIRROR=http://mirror.us.leaseweb.net/raspbian/raspbian" > repository/src/config.local | |
- name: Build Image | |
run: | | |
cd repository/src | |
sudo bash -x ./build_dist | |
- name: Copy output | |
id: copy | |
run: | | |
source repository/src/config | |
NOW=$(date +"%Y-%m-%d-%H%M") | |
IMAGE=openscan-$NOW | |
sudo mv repository/src/workspace/*.img $IMAGE.img | |
echo "::set-output name=image::$IMAGE" | |
- name: "Package the image" | |
id: package-image | |
uses: OctoPrint/actions/package-rpi-image@main | |
with: | |
image_path: "${{ steps.copy.outputs.image }}.img" | |
- name: "Generate rpi-imager.json snippet" | |
uses: OctoPrint/actions/rpi-imager-snippet@main | |
with: | |
name: "OpenScan" | |
description: "Raspberry OS images with the latest OpenScan software ready to boot on your RPi." | |
icon: "https://raw.githubusercontent.com/OpenScan-org/OpenScan3-Image/main/media/rpi-imager-OpenScan.png" | |
url: "https://github.com/OpenScan-org/OpenScan3-Image/releases/download/${{ steps.copy.outputs.image }}/${{ steps.copy.outputs.image }}.zip" | |
output: "rpi-imager.json" | |
image_sha256: ${{ steps.package-image.outputs.image_sha256 }} | |
image_size: ${{ steps.package-image.outputs.image_size }} | |
zip_sha256: ${{ steps.package-image.outputs.zip_sha256 }} | |
zip_size: ${{ steps.package-image.outputs.zip_size }} | |
- name: Publish relese | |
uses: Polectron/action-gh-release@v1 | |
with: | |
tag_name: ${{ steps.copy.outputs.image }} | |
files: | | |
${{ steps.copy.outputs.image }}.zip | |
${{ steps.copy.outputs.image }}.zip.md5 | |
${{ steps.copy.outputs.image }}.zip.sha256 | |
rpi-imager.json |