Skip to content

Commit 9a8966b

Browse files
fix: Review commits
1 parent 836cc59 commit 9a8966b

File tree

5 files changed

+13
-29
lines changed

5 files changed

+13
-29
lines changed

.github/workflows/auto-tag-versions.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,4 @@ jobs:
2121
run: |
2222
VERSION=$(cat version.txt | grep firmware | cut -f 2-2 -d '=' | awk -F ':' '{ print 0+$1 "." 0+$2 "." $3*2**8 + $4 }')
2323
echo $VERSION
24-
curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${AUTH_TOKEN}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/${REPOSITORY}/git/refs -d '{"ref":"refs/tags/v'${VERSION}'","sha":"'${COMMIT}'"}'
25-
echo "Tag v${VERSION} created successfully."
24+
curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${AUTH_TOKEN}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/${REPOSITORY}/git/refs -d '{"ref":"refs/tags/v'${VERSION}'","sha":"'${COMMIT}'"}'

.github/workflows/build.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
matrix:
1616
firmware: [Main]
1717
target: [Release]
18-
coin_support: ["BTC_ONLY", "MULTI_COIN"] # Builds both BTC_ONLY and MULTI_COIN variants
18+
coin_support: ["BTC_ONLY", "MULTI_COIN"]
1919
uses: ./.github/workflows/containerized-build.yml
2020
with:
2121
firmware: ${{ matrix.firmware }}
@@ -24,7 +24,7 @@ jobs:
2424
secrets: inherit
2525

2626
create-release:
27-
needs: build-firmwares # Depends on all firmwares being built
27+
needs: build-firmwares
2828
runs-on: ubuntu-latest
2929
if: ${{ github.ref_type }} == 'tag'
3030
steps:
@@ -34,7 +34,7 @@ jobs:
3434
- name: Download artifacts
3535
uses: actions/download-artifact@v4
3636
with:
37-
path: ./ # Downloads all artifacts to the current directory
37+
path: ./
3838

3939
- name: Publish a release
4040
env:
@@ -48,8 +48,8 @@ jobs:
4848
4949
# Calculate SHA256 hash for the BTC_ONLY firmware
5050
# The path assumes download-artifact placed it in Main-Release-BTC_ONLY-outputs/build/
51-
# The filename is Cypherock-Main-btc.bin due to the CMakeLists.txt modification
52-
chkmain_btc_only=$(sha256sum Main-Release-BTC_ONLY-outputs/build/Cypherock-Main-btc.bin | cut -f -1 -d ' ')
51+
# The filename is Cypherock-Main-BTC.bin due to the CMakeLists.txt modification
52+
chkmain_btc_only=$(sha256sum Main-Release-BTC_ONLY-outputs/build/Cypherock-Main-BTC.bin | cut -f -1 -d ' ')
5353
5454
APP_VERSION=$(cat version.txt | grep firmware | cut -f 2-2 -d '=' | awk -F ':' '{ print 0+$1 "." 0+$2 "." $3*2**8 + $4 }')
5555
HW_VERSION=$(cat version.txt | grep hardware | cut -f 2-2 -d '=' | awk -F ':' '{ print 0+$1 "." 0+$2 "." $3*2**8 + $4 }')
@@ -67,7 +67,7 @@ jobs:
6767
"tag_name":"'${TAG_NAME}'",
6868
"target_commitish":"main",
6969
"name":"'${TAG_NAME}'",
70-
"body":"Application version: '${APP_VERSION}'\r\nHardware version: '${HW_VERSION}'\r\n## SHA256 of binaries:\r\n**Cypherock-Main.bin** : '${chkmain_multicoin}' \r\n**Cypherock-Main-btc.bin** : '${chkmain_btc_only}'",
70+
"body":"Application version: '${APP_VERSION}'\r\nHardware version: '${HW_VERSION}'\r\n## SHA256 of binaries:\r\n**Cypherock-Main.bin** : '${chkmain_multicoin}' \r\n**Cypherock-Main-BTC.bin** : '${chkmain_btc_only}'",
7171
"draft":true,
7272
"prerelease":false,
7373
"generate_release_notes":true
@@ -79,7 +79,6 @@ jobs:
7979
- name: Upload assets
8080
env:
8181
auth_token: ${{ secrets.GITHUB_TOKEN }}
82-
upload_url: ${{ env.upload_url }} # Use the extracted upload_url
8382
run: |
8483
# Upload the MULTI_COIN firmware binary
8584
content_type_multicoin=$(file -b --mime-type Main-Release-MULTI_COIN-outputs/build/Cypherock-Main.bin)
@@ -92,14 +91,14 @@ jobs:
9291
--data-binary @Main-Release-MULTI_COIN-outputs/build/Cypherock-Main.bin
9392
9493
# Upload the BTC_ONLY firmware binary
95-
content_type_btc_only=$(file -b --mime-type Main-Release-BTC_ONLY-outputs/build/Cypherock-Main-btc.bin)
94+
content_type_btc_only=$(file -b --mime-type Main-Release-BTC_ONLY-outputs/build/Cypherock-Main-BTC.bin)
9695
curl -X POST \
9796
-H "Content-Type: ${content_type_btc_only}" \
9897
-H "Accept: application/vnd.github+json" \
9998
-H "Authorization: Bearer ${auth_token}" \
10099
-H "X-GitHub-Api-Version: 2022-11-28" \
101-
"${upload_url}?name=Cypherock-Main-btc.bin" \
102-
--data-binary @Main-Release-BTC_ONLY-outputs/build/Cypherock-Main-btc.bin
100+
"${upload_url}?name=Cypherock-Main-BTC.bin" \
101+
--data-binary @Main-Release-BTC_ONLY-outputs/build/Cypherock-Main-BTC.bin
103102
104103
# Upload version.txt
105104
content_type_version=$(file -b --mime-type version.txt)

.github/workflows/ci-tests.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,5 +197,4 @@ jobs:
197197
bash ./utilities/run_unit_tests.sh -f ${{ matrix.firmware }} -p ${{ matrix.platform }} > test_results.txt || true
198198
cat test_results.txt
199199
# Unity prints "OK" if all tests pass, "FAIL" if tests fail; return 1 to indicate failure
200-
if [ ! "$(tail -n 1 test_results.txt)" = "OK" ]; then exit 1; fi
201-
200+
if [ ! "$(tail -n 1 test_results.txt)" = "OK" ]; then exit 1; fi

.github/workflows/containerized-build.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,8 @@ on:
1111
type: string
1212
coin_support_variant:
1313
required: true
14-
type: string
15-
workflow_dispatch:
16-
inputs:
17-
firmware:
18-
required: true
19-
type: string
20-
default: 'Main'
21-
target:
22-
required: true
23-
type: string
24-
default: 'Release'
25-
coin_support_variant:
26-
required: true
27-
type: string
2814
default: 'MULTI_COIN'
15+
type: string
2916

3017
jobs:
3118
build:

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ OPTION(BTC_ONLY "Build firmware for Bitcoin only" OFF)
2020

2121
# Logic to append -btc to project name if BTC_ONLY is enabled
2222
if (BTC_ONLY)
23-
set(PROJECT ${PROJECT}-btc)
23+
set(PROJECT ${PROJECT}-BTC)
2424
endif()
2525

2626
# Make static functions testable via unit-tests

0 commit comments

Comments
 (0)