Skip to content

Commit

Permalink
Get cargo-binutils as a binary package.
Browse files Browse the repository at this point in the history
  • Loading branch information
thejpster committed Oct 8, 2023
1 parent 6723b0d commit 95288ec
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,40 @@ jobs:
uses: actions/checkout@v3
with:
submodules: true

- name: Check Syntax
run: |
cargo check
- name: Test
run: |
cargo test --lib
- name: Install Targets and Tools
run: |
rustup target add thumbv7em-none-eabi
rustup target add thumbv7m-none-eabi
rustup target add thumbv6m-none-eabi
rustup component add llvm-tools-preview
cargo install cargo-binutils
- name: Install tools
uses: taiki-e/install-action@v2
with:
tool: cargo-binutils@0.3.6

- name: Build
run: |
./build.sh --verbose
- name: Upload Artifacts
uses: actions/upload-artifact@v3
if: ${{success()}}
with:
name: Artifacts
if-no-files-found: error
path: |
./release/
- name: Upload files to Release
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ for TARGET_ARCH in thumbv6m-none-eabi thumbv7m-none-eabi thumbv7em-none-eabi; do
echo "BINARY is ${BINARY}"
cargo build $* --release --target=${TARGET_ARCH} --bin ${BINARY}
# objcopy would do the build for us first, but it doesn't have good build output
cargo objcopy $* --release --target=${TARGET_ARCH} --bin ${BINARY} -- -O binary ${RELEASE_DIR}/${TARGET_ARCH}-${BINARY}-libneotron_os.bin
rust-objcopy -O binary ./target/${TARGET_ARCH}/release/${BINARY} ${RELEASE_DIR}/${TARGET_ARCH}-${BINARY}-libneotron_os.bin
# Keep the ELF file too (for debugging)
cp ./target/${TARGET_ARCH}/release/${BINARY} ${RELEASE_DIR}/${TARGET_ARCH}-${BINARY}-libneotron_os.elf
done
Expand Down

0 comments on commit 95288ec

Please sign in to comment.