Skip to content

Commit 5bfacbd

Browse files
authored
Fix NCS version in build (#3)
1 parent 48d9b59 commit 5bfacbd

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ jobs:
3030

3131
- name: Apply patches
3232
run: |
33-
git -C /opt/ncs/v3.1.1/nrf apply < patches/peripheral_mds.patch
33+
git -C /opt/ncs/${MEMFAULT_NCS_VERSION}/nrf apply < patches/peripheral_mds.patch
3434
3535
- name: Build firmware for ${{ matrix.board }}
3636
run: |
3737
. /opt/toolchain-env.sh
38-
cd /opt/ncs/v3.1.1
38+
cd /opt/ncs/${MEMFAULT_NCS_VERSION}
3939
west build --sysbuild --pristine=always --board ${{ matrix.board }} nrf/samples/bluetooth/peripheral_mds -- -DCONFIG_MEMFAULT_NCS_PROJECT_KEY=\"dummy\"
4040
4141
- name: Create sanitized board name
@@ -50,25 +50,25 @@ jobs:
5050
with:
5151
name: firmware-v0.0.1-${{ steps.board_name.outputs.sanitized }}-${{ github.sha }}
5252
path: |
53-
/opt/ncs/v3.1.1/build/dfu_application.zip_manifest.json
54-
/opt/ncs/v3.1.1/build/dfu_application.zip
55-
/opt/ncs/v3.1.1/build/merged.hex
56-
/opt/ncs/v3.1.1/build/peripheral_mds/zephyr/zephyr.elf
53+
/opt/ncs/*/build/dfu_application.zip_manifest.json
54+
/opt/ncs/*/build/dfu_application.zip
55+
/opt/ncs/*/build/merged.hex
56+
/opt/ncs/*/build/peripheral_mds/zephyr/zephyr.elf
5757
retention-days: 30
5858

5959
- name: Rebuild with version=0.0.2
6060
run: |
6161
. /opt/toolchain-env.sh
62-
cd /opt/ncs/v3.1.1
62+
cd /opt/ncs/${MEMFAULT_NCS_VERSION}
6363
west build --sysbuild --pristine=always --board ${{ matrix.board }} nrf/samples/bluetooth/peripheral_mds -- -DCONFIG_MEMFAULT_NCS_PROJECT_KEY=\"dummy\" -DCONFIG_MEMFAULT_NCS_FW_VERSION=\"0.0.2\"
6464
6565
- name: Upload v0.0.2 build artifacts
6666
uses: actions/upload-artifact@v4
6767
with:
6868
name: firmware-v0.0.2-${{ steps.board_name.outputs.sanitized }}-${{ github.sha }}
6969
path: |
70-
/opt/ncs/v3.1.1/build/dfu_application.zip_manifest.json
71-
/opt/ncs/v3.1.1/build/dfu_application.zip
72-
/opt/ncs/v3.1.1/build/merged.hex
73-
/opt/ncs/v3.1.1/build/peripheral_mds/zephyr/zephyr.elf
70+
/opt/ncs/*/build/dfu_application.zip_manifest.json
71+
/opt/ncs/*/build/dfu_application.zip
72+
/opt/ncs/*/build/merged.hex
73+
/opt/ncs/*/build/peripheral_mds/zephyr/zephyr.elf
7474
retention-days: 30

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ RUN west init -m https://github.com/nrfconnect/sdk-nrf --mr ${NCS_VERSION} /opt/
1010
west update --narrow -o=--depth=1 && \
1111
west zephyr-export
1212

13-
RUN rm /opt/.bashrc
13+
# Save NCS version as an environment variable, for use in the container
14+
ENV MEMFAULT_NCS_VERSION=${NCS_VERSION}
1415

16+
# Remove the built-in bashrc shim, it tries to install J-Link
17+
RUN rm /opt/.bashrc
1518
ENTRYPOINT ["/bin/bash", "-c", "source /opt/toolchain-env.sh && exec \"$@\"", "--"]
1619
CMD ["/bin/bash"]
1720

0 commit comments

Comments
 (0)