aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDien-Nhung Nguyen-Phu <kein@kienlab.com>2024-09-29 14:39:45 +0700
committerDien-Nhung Nguyen-Phu <kein@kienlab.com>2024-09-29 14:46:10 +0700
commit44a03c9e395bbbc135312c27eb32c0029a3b01d2 (patch)
tree10cfba82c5d63047458c5c240721240059d600f5
parentb30731ff6cad0b7d00f50c511b3ed3c0ca13a6b2 (diff)
chore: update CI build for USB-C version
-rw-r--r--.github/workflows/build.yaml16
1 files changed, 9 insertions, 7 deletions
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 3144e5c..fadd402 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -7,7 +7,8 @@ on:
env:
MRS_TOOLCHAIN: MRS_Toolchain_Linux_x64_V1.91
- BUILD_DIR: build
+ USBC_BUILD_DIR: usb-c
+ MICROB_BUILD_DIR: micro-b
BIN_TYPES: '{.bin,.elf}'
jobs:
@@ -32,13 +33,15 @@ jobs:
- name: Build firmware
run: |
export PREFIX=${{ env.MRS_TOOLCHAIN }}/RISC-V_Embedded_GCC/bin/riscv-none-embed-
- export BUILD_DIR=${{ env.BUILD_DIR }}
- make -j$(nproc)
+ BUILD_DIR=${{ env.USBC_BUILD_DIR }} USBC_VERSION=1 make -j$(nproc)
+ BUILD_DIR=${{ env.MICROB_BUILD_DIR }} make -j$(nproc)
- uses: actions/upload-artifact@v4
with:
name: badgemagic-firmware
- path: ${{ env.BUILD_DIR }}/badgemagic-*
+ path: |
+ ${{ env.USBC_BUILD_DIR }}/badgemagic-*
+ ${{ env.MICROB_BUILD_DIR }}/badgemagic-*
# Skip upload APK for pull requests & only allow binaries build from master
- if: ${{ github.event_name != 'pull_request' && github.ref_name == 'master' }}
@@ -47,10 +50,9 @@ jobs:
git config --global user.name "${{ github.workflow }}"
git config --global user.email "gh-actions@${{ github.repository_owner }}"
- mv ${{ env.BUILD_DIR }}/badgemagic-*${{ env.BIN_TYPES }} ./
-
git checkout --orphan bin
git reset
- git add badgemagic-*${{ env.BIN_TYPES }}
+ git add ${{ env.USBC_BUILD_DIR }}/badgemagic-*${{ env.BIN_TYPES }}
+ git add ${{ env.MICROB_BUILD_DIR }}/badgemagic-*${{ env.BIN_TYPES }}
git commit -am "[Auto] Update firmware binaries from ${{ github.ref_name }} ($(date +%Y-%m-%d.%H:%M:%S))"
git push --force origin bin