Build tezuka_fw - Tezuka_0.2.0 #61
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 Tezuka Firmware | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Release tag (e.g. 0.6.0)' | |
| type: string | |
| required: true | |
| boards: | |
| description: 'Boards to build (comma-separated, or "all")' | |
| type: string | |
| required: false | |
| default: 'all' | |
| permissions: | |
| contents: write | |
| run-name: Build tezuka_fw - Tezuka_${{ inputs.version }} | |
| jobs: | |
| prepare: | |
| runs-on: ubuntu-22.04 | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.matrix }} | |
| steps: | |
| - id: set-matrix | |
| run: | | |
| # Mini variants share toolchain/kernel -- skip in CI to save runner time. | |
| ALL='["pluto","plutoplus","e200","e310","libre","fishball","fishball7020","nano","signalsdrpro","plutoskyr2"]' | |
| INPUT="${{ inputs.boards }}" | |
| if [ "$INPUT" = "all" ] || [ -z "$INPUT" ]; then | |
| echo "matrix={\"board\":${ALL}}" >> "$GITHUB_OUTPUT" | |
| else | |
| BOARDS=$(echo "$INPUT" | jq -Rc 'split(",")|map(ltrimstr(" ")|rtrimstr(" "))') | |
| echo "matrix={\"board\":${BOARDS}}" >> "$GITHUB_OUTPUT" | |
| fi | |
| build: | |
| needs: prepare | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJson(needs.prepare.outputs.matrix) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Free disk space | |
| uses: jlumbroso/free-disk-space@main | |
| with: | |
| tool-cache: false | |
| android: true | |
| dotnet: true | |
| haskell: true | |
| large-packages: false | |
| - name: Install build dependencies | |
| run: | | |
| sudo apt-get update -q -y | |
| sudo apt-get install -y make gcc g++ \ | |
| zip unzip dfu-util fakeroot u-boot-tools device-tree-compiler \ | |
| mtools bison flex libncurses5-dev libssl-dev bc cpio rsync \ | |
| cmake xz-utils libgmp-dev libmpc-dev bootgen-xlnx libclang-dev | |
| - name: Cache Buildroot downloads | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/br-dl | |
| key: br-dl-${{ hashFiles('configs/*') }} | |
| restore-keys: br-dl- | |
| - name: Cache ccache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.buildroot-ccache | |
| key: ccache-${{ matrix.board }}-week${{ github.run_number }} | |
| restore-keys: ccache-${{ matrix.board }}- | |
| - name: Build ${{ matrix.board }} | |
| run: | | |
| ./getbuildroot.sh | |
| source sourceme.first | |
| export BR2_DL_DIR=~/br-dl | |
| ./build.sh "${{ matrix.board }}" | |
| REV="${GITHUB_SHA::7}" | |
| mkdir -p "artifacts/tezuka-${{ matrix.board }}-${REV}" | |
| unzip -q "build/${{ matrix.board }}.zip" -d "artifacts/tezuka-${{ matrix.board }}-${REV}" | |
| echo "REV=${REV}" >> "$GITHUB_ENV" | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: tezuka-${{ matrix.board }}-${{ env.REV }} | |
| path: artifacts/tezuka-${{ matrix.board }}-${{ env.REV }}/ | |
| if-no-files-found: error | |
| release: | |
| needs: build | |
| if: github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts/ | |
| pattern: tezuka-* | |
| - name: Create release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| cd artifacts | |
| for dir in tezuka-*/; do | |
| name="${dir%/}" | |
| zip -r "../${name}.zip" "${dir}" | |
| echo "Packaged ${name}.zip" | |
| done | |
| cd .. | |
| gh release create "Tezuka_${{ inputs.version }}" \ | |
| tezuka-*.zip \ | |
| -R "${{ github.repository }}" \ | |
| --generate-notes |