1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-25 17:09:44 +00:00

ci: include version+githash into artefact filenames

This commit is contained in:
Pavol Rusnak 2019-08-28 20:36:29 +02:00
parent fc1f90875b
commit cc3f7b8d48
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
4 changed files with 25 additions and 8 deletions

View File

@ -17,11 +17,13 @@ build core firmware:
- pipenv run make build_prodtest
- pipenv run make build_firmware
- pipenv run make sizecheck
- cd ..
- export VERSION=$(./tools/version.sh core/embed/firmware/version.h)
- cp core/build/firmware/firmware.bin trezor-$VERSION-$CI_COMMIT_SHORT_SHA.bin
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- core/build/firmware/firmware.bin
- core/build/bootloader/bootloader.bin
- trezor-*.*.*-$CI_COMMIT_SHORT_SHA.bin
expire_in: 1 week
build core firmware bitcoinonly:
@ -34,10 +36,12 @@ build core firmware bitcoinonly:
- mv build/firmware/firmware.bin build/firmware/firmware-bitcoinonly.bin
- cd ..
- pipenv run ./tools/check-bitcoin-only core/build/firmware/firmware-bitcoinonly.bin
- export VERSION=$(./tools/version.sh core/embed/firmware/version.h)
- cp core/build/firmware/firmware-bitcoinonly.bin trezor-$VERSION-$CI_COMMIT_SHORT_SHA-bitcoinonly.bin
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- core/build/firmware/firmware-bitcoinonly.bin
- trezor-*.*.*-$CI_COMMIT_SHORT_SHA-bitcoinonly.bin
expire_in: 1 week
build core unix:
@ -115,10 +119,13 @@ build legacy firmware:
- pipenv run script/cibuild
- pipenv run make -C bootloader
- pipenv run make -C demo
- cd ..
- export VERSION=$(./tools/version.sh legacy/firmware/version.h)
- cp legacy/firmware/trezor.bin trezor-$VERSION-$CI_COMMIT_SHORT_SHA.bin
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- legacy/firmware/trezor.bin
- trezor-*.*.*-$CI_COMMIT_SHORT_SHA.bin
expire_in: 1 week
build legacy firmware debug:
@ -141,10 +148,12 @@ build legacy firmware bitcoinonly:
- mv firmware/trezor.bin firmware/trezor-bitcoinonly.bin
- cd ..
- pipenv run ./tools/check-bitcoin-only legacy/firmware/trezor-bitcoinonly.bin
- export VERSION=$(./tools/version.sh legacy/firmware/version.h)
- cp legacy/firmware/trezor-bitcoinonly.bin trezor-$VERSION-$CI_COMMIT_SHORT_SHA-bitcoinonly.bin
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- legacy/firmware/trezor-bitcoinonly.bin
- trezor-*.*.*-$CI_COMMIT_SHORT_SHA-bitcoinonly.bin
expire_in: 1 week
build legacy emu:

View File

@ -20,9 +20,7 @@
#ifndef __BOOTLOADER_H__
#define __BOOTLOADER_H__
#define VERSION_MAJOR 1
#define VERSION_MINOR 8
#define VERSION_PATCH 1
#include "version.h"
#define STR(X) #X
#define VERSTR(X) STR(X)

View File

@ -0,0 +1,3 @@
#define VERSION_MAJOR 1
#define VERSION_MINOR 8
#define VERSION_PATCH 1

7
tools/version.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
if [ -z "$1" ]; then
echo "Usage: version.sh path/to/version.h"
exit 1
fi
echo "VERSION_MAJOR.VERSION_MINOR.VERSION_PATCH" | cpp -include $1 -nostdinc -P | tr -d " "