From 95607cd603bf5ede61d281ef87cba4f934a49821 Mon Sep 17 00:00:00 2001 From: akuker <34318535+akuker@users.noreply.github.com> Date: Wed, 6 Oct 2021 13:42:52 -0500 Subject: [PATCH] Github action to create a raspberry pi image (#302) Co-authored-by: Tony Kuker --- .github/workflows/rpi_image_creation.yml | 69 ++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/rpi_image_creation.yml diff --git a/.github/workflows/rpi_image_creation.yml b/.github/workflows/rpi_image_creation.yml new file mode 100644 index 00000000..b69a9adb --- /dev/null +++ b/.github/workflows/rpi_image_creation.yml @@ -0,0 +1,69 @@ +name: Generate a RaSCSI OS image, based upon the official Rapsberry Pi OS + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the rpi_image_creation branch + push: + branches: [ rpi_image_creation, develop, master ] + pull_request: + branches: [ rpi_image_creation, develop, master ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + # TODO: I don't think this step is needed.... + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout RaSCSI + uses: actions/checkout@v2 + with: + path: RASCSI + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout RaSCSI + uses: actions/checkout@v2 + with: + repository: akuker/pi-gen + path: pi-gen + + - name: Install Raspberry Pi build toolchain + run: sudo apt-get install coreutils quilt parted qemu-user-static debootstrap zerofree zip dosfstools libarchive-tools libcap2-bin grep rsync xz-utils file git curl bc qemu-utils kpartx + + - name: Configure the build + run: | + echo ----------------------------------------------------- + echo "IMG_NAME=RaSCSI-$GITHUB_RUN_ID" > config + echo "TARGET_HOSTNAME=rascsi" >> config + echo "ENABLE_SSH=1" >> config + echo "LOCALE_DEFAULT=en_US.UTF-8" >> config + echo "KEYBOARD_KEYMAP=us" >> config + echo "KEYBOARD_LAYOUT=\"English (US)\"" >> config + echo ----------------------------------------------------- + cat config + working-directory: pi-gen + + - name: Run the Raspberry Pi build generation tool + run: sudo ./build.sh + working-directory: pi-gen + + - name: List the files in the deploy directory + run: | + echo ----------------------------------------------------- + ls -alh pi-gen/deploy/ + echo ----------------------------------------------------- + + - name: Archive the build artifacts + uses: actions/upload-artifact@v2.2.4 + with: + # Artifact name + name: raspberry-pi-image + # A file, directory or wildcard pattern that describes what to upload + path: pi-gen/deploy/*