From 17a8816c6a2f956328e9710d545606021a3c0338 Mon Sep 17 00:00:00 2001 From: Egor Savkin Date: Mon, 30 Sep 2024 16:26:49 +0800 Subject: [PATCH 1/2] Upload artifacts after objcopy Signed-off-by: Egor Savkin --- .github/workflows/ci.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5caff3a..ae7e081 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,10 +72,26 @@ jobs: toolchain: ${{ matrix.toolchain }} target: thumbv7em-none-eabihf override: true + components: llvm-tools-preview + - name: Install binary utils + uses: actions-rs/cargo@v1 + with: + command: install + args: | + cargo-binutils - uses: actions-rs/cargo@v1 with: command: build args: --release --features "${{ matrix.features }}" + - name: Objcopy release binary + uses: actions-rs/cargo@v1 + with: + command: objcopy + args: --release --bin thermostat-eem -- -O binary ${{ matrix.toolchain }}-thermostat-eem.bin + - name: Upload a Build Artifact + uses: actions/upload-artifact@v3.2.1-node20 + with: + path: ${{ matrix.toolchain }}-thermostat-eem.bin doc: runs-on: ubuntu-latest From 9d0ded6c708935a217f469e7e544cd8bf765399b Mon Sep 17 00:00:00 2001 From: Egor Savkin Date: Wed, 2 Oct 2024 10:46:00 +0800 Subject: [PATCH 2/2] Refactor compile action job to phase out deprecated dependencies Signed-off-by: Egor Savkin --- .github/workflows/ci.yml | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae7e081..3629338 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,32 +66,23 @@ jobs: features: '' continue-on-error: true steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ matrix.toolchain }} - target: thumbv7em-none-eabihf - override: true + targets: thumbv7em-none-eabihf components: llvm-tools-preview - - name: Install binary utils - uses: actions-rs/cargo@v1 - with: - command: install - args: | - cargo-binutils - - uses: actions-rs/cargo@v1 - with: - command: build - args: --release --features "${{ matrix.features }}" - - name: Objcopy release binary - uses: actions-rs/cargo@v1 - with: - command: objcopy - args: --release --bin thermostat-eem -- -O binary ${{ matrix.toolchain }}-thermostat-eem.bin - - name: Upload a Build Artifact - uses: actions/upload-artifact@v3.2.1-node20 + - run: cargo build --release --features "${{ matrix.features }}" + - name: Extract Stable Binary Using cargo-binutils + if: matrix.toolchain == 'stable' && github.ref == 'refs/heads/main' + run: | + cargo install cargo-binutils + cargo objcopy --release --bin thermostat-eem -- -O binary thermostat-eem.bin + - name: Upload Artifacts + if: matrix.toolchain == 'stable' && github.ref == 'refs/heads/main' + uses: actions/upload-artifact@v4.4.0 with: - path: ${{ matrix.toolchain }}-thermostat-eem.bin + path: thermostat-eem.bin doc: runs-on: ubuntu-latest