Skip to content

Commit df5f7d5

Browse files
authored
Merge pull request #9 from golioth/merge/template_v2.4.1
Merge/template v2.4.1
2 parents 1899520 + 33c6183 commit df5f7d5

34 files changed

+1137
-1067
lines changed

.github/workflows/build_zephyr.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Copyright (c) 2023 Golioth, Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Build Zephyr binaries
5+
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
ZEPHYR_SDK:
10+
required: true
11+
type: string
12+
default: 0.16.3
13+
BOARD:
14+
required: true
15+
type: string
16+
default: aludel_mini_v1_sparkfun9160_ns
17+
ARTIFACT:
18+
required: true
19+
type: boolean
20+
default: false
21+
TAG:
22+
type: string
23+
24+
workflow_call:
25+
inputs:
26+
ZEPHYR_SDK:
27+
required: true
28+
type: string
29+
BOARD:
30+
required: true
31+
type: string
32+
ARTIFACT:
33+
required: true
34+
type: boolean
35+
TAG:
36+
type: string
37+
38+
jobs:
39+
build:
40+
runs-on: ubuntu-latest
41+
42+
container: golioth/golioth-zephyr-base:${{ inputs.ZEPHYR_SDK }}-SDK-v0
43+
44+
env:
45+
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-${{ inputs.ZEPHYR_SDK }}
46+
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v4
50+
with:
51+
path: app
52+
53+
- name: Process Board name
54+
id: nicename
55+
shell: bash
56+
run: |
57+
BOARD_NICENAME=${{ inputs.BOARD }}
58+
BOARD_NICENAME=${BOARD_NICENAME//\//_}
59+
echo "BOARD_NICENAME=${BOARD_NICENAME}" >> $GITHUB_OUTPUT
60+
61+
- name: Setup West workspace
62+
run: |
63+
west init -l app
64+
west update --narrow -o=--depth=1
65+
west zephyr-export
66+
pip3 install -r deps/zephyr/scripts/requirements-base.txt
67+
# Needed for TF-M
68+
pip3 install cryptography pyasn1 pyyaml cbor>=1.0.0 imgtool>=1.9.0 jinja2 click
69+
70+
- name: Build with West
71+
run: |
72+
west build -p -b ${{ inputs.BOARD }} --sysbuild app
73+
74+
- name: Prepare artifacts
75+
shell: bash
76+
if: inputs.ARTIFACT == true && inputs.TAG != ''
77+
78+
run: |
79+
cd build
80+
mkdir -p artifacts
81+
mv merged.hex ./artifacts/soil_moisture_${{ inputs.TAG }}_${{ steps.nicename.outputs.BOARD_NICENAME }}_full.hex
82+
mv app/zephyr/zephyr.signed.bin ./artifacts/soil_moisture_${{ inputs.TAG }}_${{ steps.nicename.outputs.BOARD_NICENAME }}_update.bin
83+
mv app/zephyr/zephyr.elf ./artifacts/soil_moisture_${{ inputs.TAG }}_${{ steps.nicename.outputs.BOARD_NICENAME }}.elf
84+
85+
# Run IDs are unique per repo but are reused on re-runs
86+
- name: Save artifact
87+
if: inputs.ARTIFACT == true
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: build_artifacts_${{ github.run_id }}_${{ steps.nicename.outputs.BOARD_NICENAME }}
91+
path: |
92+
build/artifacts/*

.github/workflows/release.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Copyright (c) 2023 Golioth, Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Create Release
5+
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Release Version.'
11+
required: true
12+
default: 'v0.0.0'
13+
type: string
14+
15+
jobs:
16+
build-binaries:
17+
strategy:
18+
matrix:
19+
ZEPHYR_SDK: [0.16.3]
20+
BOARD: ["nrf9160dk/nrf9160/ns","aludel_mini/nrf9160/ns","aludel_elixir/nrf9160/ns"]
21+
22+
uses: ./.github/workflows/build_zephyr.yml
23+
with:
24+
ZEPHYR_SDK: ${{ matrix.ZEPHYR_SDK }}
25+
BOARD: ${{ matrix.BOARD }}
26+
ARTIFACT: true
27+
TAG: ${{ inputs.version }}
28+
29+
upload-binaries:
30+
needs: build-binaries
31+
32+
runs-on: ubuntu-latest
33+
34+
steps:
35+
- name: Checkout repo
36+
uses: actions/checkout@v4
37+
38+
- name: Download artifact
39+
uses: actions/download-artifact@v4
40+
with:
41+
pattern: build_artifacts_*
42+
path: ~/artifacts
43+
merge-multiple: true
44+
45+
- name: Create Release manually with GH CLI
46+
run: gh release create --title ${{ inputs.version }} --draft ${{ inputs.version }}
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Upload artifacts to release
51+
run: gh release upload --clobber ${{ inputs.version }} ~/artifacts/*.*
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright (c) 2023 Golioth, Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Test firmware
5+
6+
on:
7+
pull_request:
8+
9+
push:
10+
branches: [ main ]
11+
12+
jobs:
13+
test_build_nrf9160dk:
14+
uses: ./.github/workflows/build_zephyr.yml
15+
with:
16+
ZEPHYR_SDK: 0.16.3
17+
BOARD: nrf9160dk/nrf9160/ns
18+
ARTIFACT: false
19+
test_build_aludel_elixir:
20+
uses: ./.github/workflows/build_zephyr.yml
21+
with:
22+
ZEPHYR_SDK: 0.16.3
23+
BOARD: aludel_elixir/nrf9160/ns
24+
ARTIFACT: false
25+
test_build_aludel_mini:
26+
uses: ./.github/workflows/build_zephyr.yml
27+
with:
28+
ZEPHYR_SDK: 0.16.3
29+
BOARD: aludel_mini/nrf9160/ns
30+
ARTIFACT: false

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@ All notable changes to this project will be documented in this file.
88
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
99
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1010

11+
## [1.1.0] - Unreleased
12+
13+
### Added
14+
15+
- Pipeline example
16+
- Add support for Aludel Elixir
17+
18+
### Changed
19+
20+
- Merge changes from
21+
[`golioth/reference-design-template@template_v2.4.1`](https://github.com/golioth/reference-design-template/tree/template_v2.4.1).
22+
- Update board names for Zephyr hardware model v2
23+
- Use `VERSION` file instead of `prj.conf` to set firmware version
24+
1125
## [1.0.0] - 2023-09-05
1226

1327
### Added

CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ target_sources(app PRIVATE src/main.c)
1111
target_sources(app PRIVATE src/app_rpc.c)
1212
target_sources(app PRIVATE src/app_settings.c)
1313
target_sources(app PRIVATE src/app_state.c)
14-
target_sources(app PRIVATE src/app_work.c)
15-
target_sources(app PRIVATE src/dfu/app_dfu.c)
16-
target_sources_ifdef(CONFIG_BOOTLOADER_MCUBOOT app PRIVATE src/dfu/flash.c)
14+
target_sources(app PRIVATE src/app_sensors.c)
1715

1816
add_subdirectory_ifdef(CONFIG_ALUDEL_BATTERY_MONITOR src/battery_monitor)

0 commit comments

Comments
 (0)