Skip to content

Commit 12996af

Browse files
fix: Firmware binary naming and ci
1 parent ab30a3c commit 12996af

3 files changed

Lines changed: 31 additions & 30 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ jobs:
1515
matrix:
1616
firmware: [Main]
1717
target: [Release]
18-
coin_support: ["BTC_ONLY", "MULTI_COIN"]
1918
vendor: [Cypherock, Odix]
19+
coin_support: ["BTC_ONLY", "MULTI_COIN"]
2020
exclude:
2121
- vendor: Odix
2222
coin_support: BTC_ONLY
2323
uses: ./.github/workflows/containerized-build.yml
2424
with:
2525
firmware: ${{ matrix.firmware }}
2626
target: ${{ matrix.target }}
27-
coin_support_variant: ${{ matrix.coin_support }}
2827
vendor: ${{ matrix.vendor }}
28+
coin_support_variant: ${{ matrix.coin_support }}
2929
secrets: inherit
3030

3131
create-release:
@@ -54,7 +54,7 @@ jobs:
5454
chkmain_cypherock_btc_only=$(sha256sum Main-Release-Cypherock-BTC_ONLY-outputs/Cypherock-Main-BTC.bin | cut -f -1 -d ' ')
5555
5656
# Calculate SHA256 hash for the Odix firmware with MULTI_COIN support
57-
chkmain_odix_multicoin=$(sha256sum Main-Release-Odix-MULTI_COIN-outputs/Cypherock-Main-Odix.bin | cut -f -1 -d ' ')
57+
chkmain_odix_multicoin=$(sha256sum Main-Release-Odix-MULTI_COIN-outputs/Odix-Main.bin | cut -f -1 -d ' ')
5858
5959
APP_VERSION=$(cat version.txt | grep firmware | cut -f 2-2 -d '=' | awk -F ':' '{ print 0+$1 "." 0+$2 "." $3*2**8 + $4 }')
6060
HW_VERSION=$(cat version.txt | grep hardware | cut -f 2-2 -d '=' | awk -F ':' '{ print 0+$1 "." 0+$2 "." $3*2**8 + $4 }')
@@ -106,14 +106,14 @@ jobs:
106106
--data-binary @Main-Release-Cypherock-BTC_ONLY-outputs/Cypherock-Main-BTC.bin
107107
108108
# Upload the Odix MULTI_COIN firmware binary
109-
content_type_odix_multicoin=$(file -b --mime-type Main-Release-Odix-MULTI_COIN-outputs/Cypherock-Main-Odix.bin)
109+
content_type_odix_multicoin=$(file -b --mime-type Main-Release-Odix-MULTI_COIN-outputs/Odix-Main.bin)
110110
curl -X POST \
111111
-H "Content-Type: ${content_type_odix_multicoin}" \
112112
-H "Accept: application/vnd.github+json" \
113113
-H "Authorization: Bearer ${auth_token}" \
114114
-H "X-GitHub-Api-Version: 2022-11-28" \
115115
"${upload_url}?name=Odix-Main.bin" \
116-
--data-binary @Main-Release-Odix-MULTI_COIN-outputs/Cypherock-Main-Odix.bin
116+
--data-binary @Main-Release-Odix-MULTI_COIN-outputs/Odix-Main.bin
117117
118118
# Upload version.txt
119119
content_type_version=$(file -b --mime-type version.txt)

.github/workflows/containerized-build.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@ on:
99
target:
1010
required: true
1111
type: string
12-
coin_support_variant:
13-
required: true
14-
default: 'MULTI_COIN'
15-
type: string
1612
vendor:
17-
required: true
1813
default: "Cypherock"
1914
type: string
15+
coin_support_variant:
16+
default: 'MULTI_COIN'
17+
type: string
2018

2119
jobs:
2220
build:
@@ -74,9 +72,9 @@ jobs:
7472
7573
mkdir -p build
7674
77-
cp x1_wallet_firmware/"${BUILD_DIR}"/Cypherock-*.* ./build/
75+
cp x1_wallet_firmware/"${BUILD_DIR}"/${{ inputs.vendor }}-*.* ./build/
7876
79-
- name: Archive Build Artifacts ($${{ inputs.vendor }}-$${{ inputs.coin_support_variant }})
77+
- name: Archive Build Artifacts (${{ inputs.vendor }}-${{ inputs.coin_support_variant }})
8078
uses: actions/upload-artifact@v4
8179
with:
8280
name: ${{ inputs.firmware }}-${{ inputs.target }}-${{ inputs.vendor }}-${{ inputs.coin_support_variant }}-outputs

CMakeLists.txt

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,42 @@
11
cmake_minimum_required(VERSION 3.19.0)
22
set(CMAKE_MESSAGE_LOG_LEVEL debug)
33

4-
if("${CMAKE_BUILD_PLATFORM}" STREQUAL "Device")
5-
message("Device platform selected")
6-
set(CMAKE_TOOLCHAIN_FILE utilities/cmake/arm-none-eabi-gcc.cmake)
7-
set(PROJECT Cypherock-${FIRMWARE_TYPE})
8-
elseif("${CMAKE_BUILD_PLATFORM}" STREQUAL "Simulator")
9-
message("Simulator platform selected")
10-
set(PROJECT Cypherock_Simulator)
11-
else()
12-
message(WARNING "No platform specified defaulting to Simulator. Specify using -DCMAKE_BUILD_PLATFORM=<Type> Type can be Device or Simulator")
13-
set(PROJECT Cypherock_Simulator)
14-
endif()
15-
16-
# Define all options upfront, including BTC_ONLY
17-
OPTION(DEV_SWITCH "Additional features/logs to aid developers" OFF)
18-
OPTION(UNIT_TESTS_SWITCH "Compile build for main firmware or unit tests" OFF)
19-
OPTION(BTC_ONLY "Build firmware for Bitcoin only" OFF)
20-
214
# Add vendor specific compile definitions
225
if ("${VENDOR}" STREQUAL "Odix")
6+
message("Vendor Odix")
237
add_compile_definitions(VENDOR_NAME="Odix Wallet")
248
add_compile_definitions(VENDOR_COMPANION_APP="Odix")
259
add_compile_definitions(VENDOR_DEVICE_NAME="Odix Wallet")
2610
add_compile_definitions(VENDOR_COMPANY_NAME"Odix")
27-
set(PROJECT ${PROJECT}-Odix)
11+
set(PROJECT Odix)
2812
add_compile_definitions(VENDOR_ID=1)
2913
else()
14+
message("Vendor Cypherock")
3015
add_compile_definitions(VENDOR_NAME="Cypherock X1 Wallet")
3116
add_compile_definitions(VENDOR_COMPANION_APP="cySync")
3217
add_compile_definitions(VENDOR_DEVICE_NAME="Cypherock X1")
3318
add_compile_definitions(VENDOR_COMPANY_NAME"Cypherock")
3419
add_compile_definitions(VENDOR_ID=0)
20+
set(PROJECT Cypherock)
3521
endif()
3622

23+
if("${CMAKE_BUILD_PLATFORM}" STREQUAL "Device")
24+
message("Device platform selected")
25+
set(CMAKE_TOOLCHAIN_FILE utilities/cmake/arm-none-eabi-gcc.cmake)
26+
set(PROJECT ${PROJECT}-${FIRMWARE_TYPE})
27+
elseif("${CMAKE_BUILD_PLATFORM}" STREQUAL "Simulator")
28+
message("Simulator platform selected")
29+
set(PROJECT ${PROJECT}_Simulator)
30+
else()
31+
message(WARNING "No platform specified defaulting to Simulator. Specify using -DCMAKE_BUILD_PLATFORM=<Type> Type can be Device or Simulator")
32+
set(PROJECT ${PROJECT}_Simulator)
33+
endif()
34+
35+
# Define all options upfront, including BTC_ONLY
36+
OPTION(DEV_SWITCH "Additional features/logs to aid developers" OFF)
37+
OPTION(UNIT_TESTS_SWITCH "Compile build for main firmware or unit tests" OFF)
38+
OPTION(BTC_ONLY "Build firmware for Bitcoin only" OFF)
39+
3740
# Append -BTC to project name if BTC_ONLY is enabled
3841
if (BTC_ONLY)
3942
set(PROJECT ${PROJECT}-BTC)

0 commit comments

Comments
 (0)