Intall qemu and setup buildx for multiplatform builds #40
This file contains hidden or 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 | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_call: | |
| env: | |
| # Customize the CMake build | |
| BUILD_TYPE: RelWithDebInfo # Release, Debug, RelWithDebInfo | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clean workspace | |
| run: | | |
| echo "Cleaning up previous run" | |
| rm -rf "${{ github.workspace }}" | |
| mkdir -p "${{ github.workspace }}" | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Checkout PicoBoot code | |
| uses: actions/checkout@v4 | |
| - name: Set outputs | |
| id: vars | |
| run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| - uses: robinraju/release-downloader@v1 | |
| id: gekkoboot-download | |
| with: | |
| repository: 'webhdx/iplboot' | |
| latest: true | |
| fileName: '*.zip' | |
| out-file-path: gekkoboot | |
| extract: true | |
| - name: Copy gekkoboot uf2 payload | |
| run: | | |
| cd gekkoboot | |
| if [ -f "gekkoboot_pico.uf2" ]; then | |
| cp gekkoboot_pico.uf2 ${{ github.workspace }}/payload.uf2 | |
| elif [ -f "iplboot_pico.uf2" ]; then | |
| cp iplboot_pico.uf2 ${{ github.workspace }}/payload.uf2 | |
| else | |
| echo "Neither gekkoboot_pico.uf2 nor iplboot_pico.uf2 found." | |
| exit 1 | |
| fi | |
| - name: Build and run Dev Container task | |
| uses: devcontainers/[email protected] | |
| with: | |
| imageName: ghcr.io/webhdx/picoboot | |
| cacheFrom: ghcr.io/webhdx/picoboot | |
| runCmd: | | |
| cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE . | |
| make | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: picoboot-${{ steps.vars.outputs.sha_short }} | |
| path: | | |
| picoboot_full.uf2 | |
| picoboot.uf2 | |
| payload.uf2 |