-
Notifications
You must be signed in to change notification settings - Fork 18
Microbit v2 serial bootloader release workflow #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Micro:bit v2 Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Release version' | ||
required: true | ||
|
||
jobs: | ||
release: | ||
runs-on: "ubuntu-latest" | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 # pulls version from rust-toolchain file | ||
- name: build bootloader | ||
run: | | ||
cd boards/microbit_v2-bootloader | ||
export BOOTLOADER_VERSION="${{ github.event.inputs.version }}" | ||
export BOOTLOADER_HASH="$(git rev-parse HEAD)" | ||
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)" | ||
make | ||
- name: Version | ||
run: | | ||
echo "Version: ${{ github.event.inputs.version }}" > tock-bootloader.microbit_v2.version | ||
echo "Toolchain: $(rustc --version)" >> tock-bootloader.microbit_v2.version | ||
echo "Tock Bootloader Hash: $(git rev-parse HEAD)" >> tock-bootloader.microbit_v2.version | ||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here, not sure how this checking out remove-submodule interacts with the Cargo.lock file using a commit on master |
||
echo "Bootloader SHA256: $(sha256sum target/thumbv7em-none-eabi/release/microbit_v2-bootloader.bin | cut -d ' ' -f 1)" >> tock-bootloader.microbit_v2.version | ||
echo "Build Date: $(date)" >> tock-bootloader.microbit_v2.version | ||
- name: Upload bootloader release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
release_name: Micro:bit v2 ${{ github.event.inputs.version }} | ||
prerelease: true | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: target/thumbv7em-none-eabi/release/microbit_v2-bootloader.bin | ||
asset_name: tock-bootloader.microbit_v2.v${{ github.event.inputs.version }}.bin | ||
tag: microbit_v2-v${{ github.event.inputs.version }} | ||
overwrite: true | ||
body: "Bootloader for Micro:bit v2 v${{ github.event.inputs.version }}" | ||
- name: Upload bootloader version | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
release_name: Micro:bit v2 ${{ github.event.inputs.version }} | ||
prerelease: true | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: tock-bootloader.microbit_v2.version | ||
asset_name: tock-bootloader.microbit_v2.v${{ github.event.inputs.version }}.version | ||
tag: microbit_v2-v${{ github.event.inputs.version }} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
extern crate bootloader_attributes; | ||
use std::env; | ||
|
||
fn main() { | ||
println!("cargo:rerun-if-changed=layout.ld"); | ||
println!("cargo:rerun-if-changed=../kernel_layout.ld"); | ||
|
||
let mut f = bootloader_attributes::get_file(); | ||
bootloader_attributes::write_flags(&mut f, "1.1.1", 0x8000); | ||
let version = if let Ok(v) = env::var("BOOTLOADER_VERSION") { | ||
v | ||
} else { | ||
String::from("1.1.1") | ||
}; | ||
bootloader_attributes::write_flags(&mut f, &version, 0x8000); | ||
bootloader_attributes::write_attribute(&mut f, "board", "microbit_v2"); | ||
bootloader_attributes::write_attribute(&mut f, "arch", "cortex-m4"); | ||
bootloader_attributes::write_attribute(&mut f, "appaddr", "0x40000"); | ||
if let Ok(bootloader) = env::var("BOOTLOADER_HASH") { | ||
bootloader_attributes::write_attribute(&mut f, "boothash", &bootloader); | ||
} | ||
if let Ok(bootloader_kernel) = env::var("BOOTLOADER_KERNEL_HASH") { | ||
bootloader_attributes::write_attribute(&mut f, "kernhash", &bootloader_kernel); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be master now?