Skip to content

Add version to the binary during build #12

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

Merged
merged 2 commits into from
May 13, 2022
Merged
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
12 changes: 10 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,14 @@ jobs:
uses: actions/checkout@v3
with:
path: ${{ env.IMGTOOL_PACKING_PATH }}

- name: Set the version
working-directory: ${{ env.IMGTOOL_PACKING_PATH }}/patches/
run: perl -pi -e "s/ARDUINO_VERSION_PLACEHOLDER/${GITHUB_REF/refs\/tags\//}/g" 0008-Imgtool-Append-arduino-to-version-string.patch

- name: Apply patches
working-directory: ${{ env.MCUBOOT_PATH }}/scripts/
run: git apply -v "${{ env.IMGTOOL_PACKING_PATH }}/patches/"*
run: git apply -v "${{ env.IMGTOOL_PACKING_PATH }}/patches/"*.patch

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v3
Expand Down Expand Up @@ -134,9 +138,13 @@ jobs:
with:
path: ${{ env.IMGTOOL_PACKING_PATH }}

- name: Set the version
working-directory: ${{ env.IMGTOOL_PACKING_PATH }}/patches/
run: perl -pi -e "s/ARDUINO_VERSION_PLACEHOLDER/${GITHUB_REF/refs\/tags\//}/g" 0008-Imgtool-Append-arduino-to-version-string.patch

- name: Apply patches
working-directory: ${{ env.MCUBOOT_PATH }}/scripts/
run: git apply -v "${{ env.IMGTOOL_PACKING_PATH }}/patches/"*
run: git apply -v "${{ env.IMGTOOL_PACKING_PATH }}/patches/"*.patch

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand Down
4 changes: 2 additions & 2 deletions patches/0008-Imgtool-Append-arduino-to-version-string.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From bc65a76a48fe688bf9e9ce3efe90973976cf400a Mon Sep 17 00:00:00 2001
From: pennam <[email protected]>
Date: Mon, 18 Oct 2021 09:41:39 +0200
Subject: [PATCH] Imgtool: Append -arduino to version string
Subject: [PATCH] Imgtool: Add version placeholder, can be customized during build

---
scripts/imgtool/__init__.py | 2 +-
Expand All @@ -16,7 +16,7 @@ index ca43b8d..20769a4 100644
# limitations under the License.

-imgtool_version = "1.8.0"
+imgtool_version = "1.8.0-arduino"
+imgtool_version = "ARDUINO_VERSION_PLACEHOLDER"
--
2.30.2