Skip to content

Commit bf9c9fa

Browse files
author
mkuettner97
committed
Merge branch 'main' of https://github.com/OpenEarable/open-earable-v2 into main
2 parents 254fb1f + 5390fca commit bf9c9fa

2 files changed

Lines changed: 66 additions & 8 deletions

File tree

.github/workflows/build_firmware.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
name: Build OpenEarable v2 Firmware
22

33
on:
4-
workflow_dispatch:
5-
pull_request:
6-
branches: ["main"]
4+
workflow_call:
5+
pull_request: {}
76
push:
8-
branches: ["main"]
7+
branches:
8+
- main
9+
paths-ignore:
10+
- .github/workflows/release_firmware.yaml
11+
- README.md
12+
- LICENSE
913

1014
permissions:
1115
pull-requests: write
@@ -100,10 +104,6 @@ jobs:
100104
cp $(pwd)/zephyr-workspace/build/ipc_radio/zephyr/zephyr.elf $(pwd)/workflow-board-temp/build-output/openearable_v2_firmware.elf
101105
cp $(pwd)/zephyr-workspace/build/dfu_application.zip $(pwd)/workflow-board-temp/build-output/openearable_v2_fota.zip
102106
(cd $(pwd)/workflow-board-temp/build-output && unzip openearable_v2_fota.zip -d openearable_v2_fota && rm openearable_v2_fota.zip)
103-
ls $(pwd)/workflow-board-temp/build-output/openearable_v2_firmware.elf
104-
echo ""
105-
echo "Fota dir:"
106-
ls $(pwd)/workflow-board-temp/build-output/openearable_v2_fota
107107
108108
- name: Upload Build Artifact (Firmware)
109109
uses: actions/upload-artifact@v4
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Release OpenEarable v2 Firmware
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release_tag:
7+
required: true
8+
description: 'Tag (e.g. v1.0.0)'
9+
release_name:
10+
required: false
11+
description: 'Name (defaults to tag)'
12+
13+
permissions:
14+
pull-requests: write
15+
contents: write
16+
17+
jobs:
18+
build:
19+
uses: ./.github/workflows/build_firmware.yaml
20+
21+
release:
22+
needs: build
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Download Firmware Artifact (Firmware)
26+
uses: actions/download-artifact@v4
27+
with:
28+
name: openearable_v2_firmware.elf
29+
30+
- name: Create Directory for FOTA
31+
run: mkdir -p openearable_v2_fota
32+
33+
- name: Download Firmware Artifact (FOTA)
34+
uses: actions/download-artifact@v4
35+
with:
36+
name: openearable_v2_fota.zip
37+
path: ./openearable_v2_fota
38+
39+
- name: Zip FOTA files again
40+
run: |
41+
# Pack the FOTA files into a zip file
42+
# Downloading it unpacked the zip
43+
ls openearable_v2_fota
44+
(cd "openearable_v2_fota" && ls && zip -r ../openearable_v2_fota.zip *)
45+
46+
- name: Create Github Release & Upload Firmware + FOTA
47+
if: startsWith(github.ref, 'refs/tags/${{ inputs.release_tag }}')
48+
uses: softprops/action-gh-release@v2
49+
with:
50+
tag_name: ${{ inputs.release_tag }}
51+
name: ${{ inputs.release_name || inputs.release_tag }}
52+
draft: false
53+
prerelease: false
54+
files: |
55+
openearable_v2_firmware.elf
56+
openearable_v2_fota.zip
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)