|
| 1 | +name: Micro:bit v2 Release |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + version: |
| 7 | + description: 'Release version' |
| 8 | + required: true |
| 9 | + |
| 10 | +jobs: |
| 11 | + release: |
| 12 | + runs-on: "ubuntu-latest" |
| 13 | + |
| 14 | + # Steps represent a sequence of tasks that will be executed as part of the job |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v2 |
| 17 | + - uses: actions-rs/toolchain@v1 # pulls version from rust-toolchain file |
| 18 | + - name: build bootloader |
| 19 | + run: | |
| 20 | + cd boards/microbit_v2-bootloader |
| 21 | + export BOOTLOADER_VERSION="${{ github.event.inputs.version }}" |
| 22 | + export BOOTLOADER_HASH="$(git rev-parse HEAD)" |
| 23 | + export BOOTLOADER_KERNEL_HASH="$(cat Cargo.lock | grep https://github.com/tock/tock?branch=remove-submodule | uniq | cut -d '#' -f 2 | cut -d '"' -f 1)" |
| 24 | + make |
| 25 | + - name: Version |
| 26 | + run: | |
| 27 | + echo "Version: ${{ github.event.inputs.version }}" > tock-bootloader.microbit_v2.version |
| 28 | + echo "Toolchain: $(rustc --version)" >> tock-bootloader.microbit_v2.version |
| 29 | + echo "Tock Bootloader Hash: $(git rev-parse HEAD)" >> tock-bootloader.microbit_v2.version |
| 30 | + echo Tock Hash: $(cat boards/microbit_v2-bootloader/Cargo.lock | grep https://github.com/tock/tock?branch=remove-submodule | uniq | cut -d '#' -f 2 | cut -d '"' -f 1) >> tock-bootloader.microbit_v2.version |
| 31 | + echo "Bootloader SHA256: $(sha256sum target/thumbv7em-none-eabi/release/microbit_v2-bootloader.bin | cut -d ' ' -f 1)" >> tock-bootloader.microbit_v2.version |
| 32 | + echo "Build Date: $(date)" >> tock-bootloader.microbit_v2.version |
| 33 | + - name: Upload bootloader release |
| 34 | + uses: svenstaro/upload-release-action@v2 |
| 35 | + with: |
| 36 | + release_name: Micro:bit v2 ${{ github.event.inputs.version }} |
| 37 | + prerelease: true |
| 38 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 39 | + file: target/thumbv7em-none-eabi/release/microbit_v2-bootloader.bin |
| 40 | + asset_name: tock-bootloader.microbit_v2.v${{ github.event.inputs.version }}.bin |
| 41 | + tag: microbit_v2-v${{ github.event.inputs.version }} |
| 42 | + overwrite: true |
| 43 | + body: "Bootloader for Micro:bit v2 v${{ github.event.inputs.version }}" |
| 44 | + - name: Upload bootloader version |
| 45 | + uses: svenstaro/upload-release-action@v2 |
| 46 | + with: |
| 47 | + release_name: Micro:bit v2 ${{ github.event.inputs.version }} |
| 48 | + prerelease: true |
| 49 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 50 | + file: tock-bootloader.microbit_v2.version |
| 51 | + asset_name: tock-bootloader.microbit_v2.v${{ github.event.inputs.version }}.version |
| 52 | + tag: microbit_v2-v${{ github.event.inputs.version }} |
0 commit comments