Continuous Deployment #52
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: Continuous Deployment | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| # Build every Monday | |
| schedule: | |
| - cron: '0 0 * * 1' | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| version: [dev, pilot] | |
| board: [beagleconnect_freedom] | |
| name: Build Artifacts - MicroBlocks ${{ matrix.version }} for ${{ matrix.board }} | |
| runs-on: ubuntu-22.04 | |
| env: | |
| OS_LIST_NAME: "MicroBlocks ${{ matrix.version }}" | |
| OS_LIST_DESC: "MicroBlocks is a blocks programming language for physical computing inspired by Scratch." | |
| OS_LIST_ICON: "https://microblocks.fun/assets/img/logos/MicroBlocks-white.svg" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| path: microblocks | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.11 | |
| - name: Setup Zephyr project | |
| uses: zephyrproject-rtos/action-zephyr-setup@v1 | |
| with: | |
| app-path: microblocks | |
| toolchains: arm-zephyr-eabi | |
| manifest-file-name: west_${{ matrix.version }}.yml | |
| - name: Link Arduino stream | |
| run: ln -srf modules/lib/ArduinoCore-API/api modules/lib/Arduino-Zephyr-API/cores/arduino/. | |
| - name: Build firmware | |
| run: west build -p -b ${{ matrix.board }} microblocks -d build | |
| - name: Rename firmware | |
| run: | | |
| VM=$(cat modules/microblocks/gp/runtime/versions | grep VM | awk '{print $2}') | |
| BIN_NAME=microblocks_${{ matrix.board }}_${{ matrix.version }}_${VM}.bin | |
| mv build/zephyr/zephyr.bin $BIN_NAME | |
| xz -z $BIN_NAME | |
| - name: Pre-Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| prerelease: true | |
| name: Continuous Release | |
| tag_name: continuous-release | |
| body: Continuous Dev and Pilot builds of MicroBlocks | |
| files: microblocks_*.bin.xz | |
| - name: Generate OS List | |
| run: | | |
| export VM=$(cat modules/microblocks/gp/runtime/versions | grep VM | awk '{print $2}') | |
| BIN_NAME=microblocks_${{ matrix.board }}_${{ matrix.version }}_${VM}.bin.xz | |
| export URL="https://github.com/beagleboard/microblocks-zephyr/releases/download/continuous-release/${BIN_NAME}" | |
| export SHA=$(sha256sum ${BIN_NAME} | cut -d " " -f 1) | |
| export RELEASE_DATE=$(date +"%Y-%m-%d") | |
| export DEVICE=$(echo ${{ matrix.board }} | sed "s/_/-/g") | |
| EXTRACT_SIZE=$(xz --robot --list ${BIN_NAME} | awk 'END {print $5}') | |
| jq -n --argjson extract_size $EXTRACT_SIZE '[ .name = env.OS_LIST_NAME | .description = env.OS_LIST_DESC | .icon = env.OS_LIST_ICON | .devices = [ env.DEVICE ] | .tags = [ "education" ] | .url = env.URL | .image_download_sha256 = env.SHA | .release_date = env.RELEASE_DATE | .extract_size = $extract_size ]' > os_list_${{ matrix.version }}.json | |
| - name: OS List Generation | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| prerelease: true | |
| name: OS List File | |
| tag_name: os-list | |
| body: OS List Files for use with BeagleBoard Imaging Utility | |
| files: os_list_${{ matrix.version }}.json |