diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index de472fb6eabd1899dbddff880257397234f6af19..deead844c8227ec726f7d57a0a5e87b21c945599 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,9 +3,12 @@ image: "rust:latest" stages: - lint - build + - build-flasher before_script: + - apt update && apt install -y binutils-arm-none-eabi gcc-mingw-w64-x86-64-win32 - rustup target add thumbv7em-none-eabihf + - rustup target add x86_64-pc-windows-gnu - rustup component add rustfmt - rustup component add clippy - cargo install flip-link @@ -20,6 +23,25 @@ build: stage: build script: - cargo build --release + - cp target/thumbv7em-none-eabihf/release/cats-mobile-transceiver-mainboard firmware.bin + - arm-none-eabi-strip firmware.bin artifacts: paths: - - target/thumbv7em-none-eabihf/release/cats-mobile-transceiver-mainboard + - firmware.bin + +build-flasher: + stage: build-flasher + script: + - mkdir flasher + - cd .. + - git clone https://gitlab.scd31.com/cats/firmware-flasher + - cd firmware-flasher + - cp ../mobile-transceiver-software/firmware.bin firmware.bin + - cargo build --release + - cargo build --release --target x86_64-pc-windows-gnu + - cp target/release/stm32-firmware-flasher ../mobile-transceiver-software/flasher/flasher-linux + - strip ../mobile-transceiver-software/flasher/flasher-linux + - cp target/x86_64-pc-windows-gnu/release/stm32-firmware-flasher.exe ../mobile-transceiver-software/flasher/flasher-windows.exe + artifacts: + paths: + - flasher/*