Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bitbox build #64

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 4 additions & 26 deletions .github/workflows/repro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
strategy:
matrix:
# Working: coldcard, lnd, bitcoin-core, mycelium-android, zap-android, simple-bitcoin-wallet, wasabi, sparrow, blockstream-green
# WIP: trezor-firmware, bitbox02-firmware
project: [coldcard, coldcard-mk3, lnd, bitcoin-core, mycelium-android, zap-android, simple-bitcoin-wallet, wasabi, sparrow, blockstream-green, fulcrum, electrs, cln, poncho]
# WIP: trezor-firmware
project: [coldcard, coldcard-mk3, lnd, bitcoin-core, mycelium-android, zap-android, simple-bitcoin-wallet, wasabi, sparrow, blockstream-green, fulcrum, electrs, cln, poncho, bitbox02-firmware]
steps:
- name: Setup xvfb for video capture
run: |
Expand All @@ -34,7 +34,7 @@ jobs:
uses: actions/checkout@v2

- name: Install ARM toolchain
if: ${{ matrix.project == 'coldcard' || matrix.project == 'coldcard-mk3' || matrix.project == 'trezor-firmware' || matrix.project == 'bitbox02-firmware' }}
if: ${{ matrix.project == 'coldcard' || matrix.project == 'coldcard-mk3' || matrix.project == 'trezor-firmware'}}
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: 'latest'
Expand All @@ -54,29 +54,7 @@ jobs:

- name: Setup deps for BitBox02 firmware
if: ${{ matrix.project == 'bitbox02-firmware' }}
run: |
sudo apt install -y libhidapi-dev cmake protobuf-compiler python3-protobuf

( cd /usr/local/bin && ln -s `which arm-none-eabi-gcc` arm-none-eabi-gcc )
echo "/usr/local/bin" >> $GITHUB_PATH

# nanopb
wget 'https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.5-linux-x86.tar.gz'
tar xzf nanopb-0.4.5-linux-x86.tar.gz
echo "`pwd`/nanopb-0.4.5-linux-x86/generator-bin" >> $GITHUB_PATH

# protobuf
#wget 'https://github.com/protocolbuffers/protobuf/releases/download/v3.20.1/protoc-3.20.1-linux-x86_64.zip'
#mkdir .local
#unzip protoc-3.20.1-linux-x86_64.zip -d .local
#echo "`pwd`/.local/bin" >> $GITHUB_PATH

# protobuf-python
#wget 'https://github.com/protocolbuffers/protobuf/releases/download/v3.20.1/protobuf-python-3.20.1.tar.gz'
#tar xzf protobuf-python-3.20.1.tar.gz
#cd protobuf-3.20.1/python
#python setup.py build
#sudo python setup.py install
uses: docker/setup-buildx-action@v2

- name: Setup deps for Bitcoin Core
if: ${{ matrix.project == 'bitcoin-core' }}
Expand Down
10 changes: 5 additions & 5 deletions bitbox02-firmware/artifacts.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/bin/bash

DATE=`date +%Y-%m-%d`
DATE=$(date +%Y-%m-%d)
TWITTER_NAME="BitBox02"
URL="https://shiftcrypto.ch/bitbox02/"
VERSION="firmware-btc-only/v9.12.0"
VERSION_STRING="v9.12.0"
REPO="https://github.com/digitalbitbox/bitbox02-firmware"
CHECKSUM_SOURCE="https://github.com/digitalbitbox/bitbox02-firmware/releases/tag/${VERSION}"
CHECKSUM_SOURCE="https://github.com/digitalbitbox/bitbox02-firmware/releases/tag/firmware/${VERSION_STRING}"
PROJECT="bitbox02-firmware"
SHA256=`shasum -a 256 firmware/stm32/firmware-signed.bin | cut -f 1 -d ' '`
SHA256=$(shasum -a 256 bitbox02-firmware/releases/temp/build/bin/firmware-btc.bin | cut -f 1 -d ' ')

# Note GITHUB_ environment variables are populated by Github Actions
ARTIFACT_BASEURL="https://github.com/${GITHUB_REPOSITORY}/raw"
ARTIFACT_BRANCH=${GITHUB_REF_NAME}

ENTRY_TO_APPEND="<li><a href='${REPO}/releases/tag/${VERSION}'>${DATE}</a> | <a href='${URL}' class='project-name'>${PROJECT}</a> | <a href='${REPO}/releases/tag/${VERSION}'>${VERSION}</a> | <a href='${CHECKSUM_SOURCE}'> factory ${SHA256} </a>| <a href='${ARTIFACT_BASEURL}/${ARTIFACT_BRANCH}/${PROJECT}/${PROJECT}-${VERSION}-video.webm'>video proof</a> | <a href='https://github.com/coinkite/bitcoinbinary.org/blob/main/${PROJECT}/artifacts.sh' class="bot">build bot</a></li>"
ENTRY_TO_APPEND="<li><a href='${REPO}/releases/tag/firmware/${VERSION_STRING}'>${DATE}</a> | <a href='${URL}' class='project-name'>${PROJECT}</a> | <a href='${REPO}/releases/tag/firmware/${VERSION_STRING}'>${VERSION_STRING}</a> | <a href='${CHECKSUM_SOURCE}'> factory ${SHA256} </a>| <a href='${ARTIFACT_BASEURL}/${ARTIFACT_BRANCH}/${PROJECT}/${PROJECT}-${VERSION_STRING}-video.webm'>video proof</a> | <a href='https://github.com/coinkite/bitcoinbinary.org/blob/main/${PROJECT}/artifacts.sh' class="bot">build bot</a></li>"

echo ${ENTRY_TO_APPEND}
15 changes: 7 additions & 8 deletions bitbox02-firmware/steps.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
#!/bin/bash

# Pull in version numbers from artifacts.sh
eval "$(grep VERSION artifacts.sh)"
eval "$(grep VERSION_STRING artifacts.sh)"

if [ ! -e bitbox02-firmware ] ; then
# Checkout source and submodules
git clone --progress --recurse-submodules https://github.com/digitalbitbox/bitbox02-firmware
if [ ! -e bitbox02-firmware ]; then
# Checkout source and submodules
git clone --progress https://github.com/digitalbitbox/bitbox02-firmware
fi

cd bitbox02-firmware
git checkout ${VERSION_STRING}

make firmware
cd bitbox02-firmware/releases
./build.sh firmware-btc-only/${VERSION_STRING} "make firmware-btc"
echo "shasum" $(shasum -a 256 temp/build/bin/firmware-btc.bin)

# Add delay for results to be printed and recorded
sleep 10