|
| 1 | +name: ARM Build ELXR12 Raw Image |
| 2 | +on: |
| 3 | + workflow_dispatch: # Manual runs |
| 4 | + push: |
| 5 | + inputs: |
| 6 | + ref: |
| 7 | + description: "Branch or SHA to test (e.g. feature/x or a1b2c3)" |
| 8 | + required: false |
| 9 | + run_qemu_test: |
| 10 | + description: "Run QEMU boot test after build" |
| 11 | + required: false |
| 12 | + default: "false" |
| 13 | + type: choice |
| 14 | + options: |
| 15 | + - "true" |
| 16 | + - "false" |
| 17 | + push: |
| 18 | + branches: |
| 19 | + - srmungar_armlocal_dev_branch |
| 20 | + |
| 21 | +permissions: |
| 22 | + contents: read |
| 23 | + |
| 24 | +jobs: |
| 25 | + build-elxr12-arm-raw: |
| 26 | + runs-on: ubuntu-24.04-arm |
| 27 | + steps: |
| 28 | + - name: Checkout code |
| 29 | + uses: actions/checkout@v4 |
| 30 | + with: |
| 31 | + persist-credentials: false |
| 32 | + ref: ${{ github.event.inputs.ref || github.ref }} |
| 33 | + |
| 34 | + - name: Set up Docker Buildx |
| 35 | + uses: docker/setup-buildx-action@v3 |
| 36 | + |
| 37 | + - name: Install Earthly |
| 38 | + uses: earthly/actions-setup@v1 |
| 39 | + with: |
| 40 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 41 | + version: "latest" |
| 42 | + |
| 43 | + - name: Install system deps |
| 44 | + run: | |
| 45 | + sudo apt-get update |
| 46 | + sudo apt-get install -y qemu-system-aarch64 ovmf tree jq systemd-ukify mmdebstrap systemd-boot qemu-efi-aarch64 |
| 47 | +
|
| 48 | + - name: Set up Go |
| 49 | + uses: actions/setup-go@v5 |
| 50 | + with: |
| 51 | + go-version: stable |
| 52 | + |
| 53 | + - name: Prepare build script |
| 54 | + run: | |
| 55 | + if [ ! -f scripts/build_elxr12_arm_raw.sh ]; then |
| 56 | + echo "scripts/build_elxr12_arm_raw.sh not found!" |
| 57 | + exit 1 |
| 58 | + fi |
| 59 | + chmod +x scripts/build_elxr12_arm_raw.sh |
| 60 | +
|
| 61 | + - name: Run ARM ELXR12 Raw Image Build |
| 62 | + env: |
| 63 | + RUN_QEMU_TEST: ${{ github.event.inputs.run_qemu_test }} |
| 64 | + run: | |
| 65 | + echo "Starting ARM ELXR12 raw image build..." |
| 66 | + # Ensure script has access to docker group for Earthly |
| 67 | + sudo usermod -aG docker $USER |
| 68 | + |
| 69 | + # Prepare arguments with input validation |
| 70 | + ARGS="" |
| 71 | + case "${RUN_QEMU_TEST}" in |
| 72 | + "true") |
| 73 | + ARGS="--qemu-test" |
| 74 | + echo "QEMU boot test will be run after build" |
| 75 | + ;; |
| 76 | + "false"|"") |
| 77 | + echo "QEMU boot test will be skipped" |
| 78 | + ;; |
| 79 | + *) |
| 80 | + echo "Invalid input for run_qemu_test: ${RUN_QEMU_TEST}" |
| 81 | + exit 1 |
| 82 | + ;; |
| 83 | + esac |
| 84 | + |
| 85 | + # Run the ELXR12 raw image build script |
| 86 | + ./scripts/build_elxr12_arm_raw.sh $ARGS |
| 87 | + echo "ELXR12 raw image build completed." |
| 88 | + - name: Set file permissions for artifacts |
| 89 | + run: | |
| 90 | + sudo chmod -R 755 workspace/ || true |
| 91 | + find workspace/*/imagebuild/*/ -name "*.raw*" -exec chmod 777 {} \; || true |
| 92 | +
|
| 93 | + - name: GitHub Upload Release Artifacts |
| 94 | + uses: actions/upload-artifact@v4 |
| 95 | + with: |
| 96 | + name: ubuntu24-arm-raw-image |
| 97 | + path: | |
| 98 | + workspace/*/imagebuild/*/*.raw* |
| 99 | + retention-days: 30 |
0 commit comments