Skip to content

Commit

Permalink
Do not add version to mkimage image name
Browse files Browse the repository at this point in the history
The CI will take care of this for us.

Signed-off-by: Davide Bettio <[email protected]>
  • Loading branch information
bettio committed Oct 5, 2023
1 parent fc7ecbd commit fb15a82
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 31 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/esp32-mkimage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ jobs:
run: |
./mkimage.sh
ls -l *.img
IMG_FILE=$(echo *.img)
sha256sum $IMG_FILE > "${IMG_FILE}.sha256"
- name: "Upload ${{ matrix.soc }} artifacts"
uses: actions/upload-artifact@v3
Expand All @@ -140,12 +138,21 @@ jobs:
path: ./src/platforms/esp32/build/atomvm-${{ matrix.soc }}-*.img
if-no-files-found: error

- name: "Rename and write sha256sum"
if: startsWith(github.ref, 'refs/tags/')
shell: bash
working-directory: src/platforms/esp32/build
run: |
ATOMVM_IMG="AtomVM-${{ matrix.soc }}-${{ github.ref_name }}.img"
mv atomvm-${{ matrix.soc }}.img "${ATOMVM_IMG}"
sha256sum "${ATOMVM_IMG}" > "${ATOMVM_IMG}.sha256"
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
fail_on_unmatched_files: true
files: |
src/platforms/esp32/build/atomvm-${{ matrix.soc }}-*.img
src/platforms/esp32/build/atomvm-${{ matrix.soc }}-*.img.sha256
src/platforms/esp32/build/AtomVM-${{ matrix.soc }}-${{ github.ref_name }}.img
src/platforms/esp32/build/AtomVM-${{ matrix.soc }}-${{ github.ref_name }}.img.sha256
24 changes: 0 additions & 24 deletions src/platforms/esp32/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,6 @@
cmake_minimum_required (VERSION 3.13)
project (ReleaseEsp32)

## Configure version info for tools
## TODO the following is the contents of AtomVM/CMakeModules/GetVersion.cmake rather than duplicate
## the code here .../GetVersion.cmake and AtomVM/version.cmake should be reworked so they can be used
## here as well as for the "generic_unix" port.

include(${CMAKE_CURRENT_SOURCE_DIR}/../../../../version.cmake)

if (ATOMVM_DEV)
set(ATOMVM_GIT_REVISION "<unknown>")
execute_process(
COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE ATOMVM_GIT_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if (NOT ATOMVM_GIT_REVISION STREQUAL "")
set(ATOMVM_VERSION "${ATOMVM_BASE_VERSION}+git.${ATOMVM_GIT_REVISION}")
else()
set(ATOMVM_VERSION ${ATOMVM_BASE_VERSION})
endif()
else()
set(ATOMVM_VERSION ${ATOMVM_BASE_VERSION})
endif()

## Build image tools for target chip

set(BOOTLOADER_OFFSET "0x1000")
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/esp32/tools/flashimage.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
THIS_DIR="$(cd $(dirname $0) && pwd)"
ROOT_DIR="$(cd "${THIS_DIR}/../../../.." && pwd)"

FLASH_OFFSET="@BOOTLOADER_OFFSET@" ${ROOT_DIR}/src/platforms/esp32/build/flash.sh $@ "${ROOT_DIR}/src/platforms/esp32/build/atomvm-@CONFIG_IDF_TARGET@-@ATOMVM_VERSION@.img"
FLASH_OFFSET="@BOOTLOADER_OFFSET@" ${ROOT_DIR}/src/platforms/esp32/build/flash.sh $@ "${ROOT_DIR}/src/platforms/esp32/build/atomvm-@[email protected]"
4 changes: 2 additions & 2 deletions src/platforms/esp32/tools/mkimage.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
escript "@CMAKE_BINARY_DIR@/mkimage.erl" \
--root_dir "@CMAKE_BINARY_DIR@/../../../.." \
--config "@CMAKE_BINARY_DIR@/mkimage.config" \
--out "@CMAKE_BINARY_DIR@/atomvm-@CONFIG_IDF_TARGET@-@ATOMVM_VERSION@.img" \
--out "@CMAKE_BINARY_DIR@/atomvm-@[email protected]" \
"$@"

echo "============================================="

echo ""
echo "AtomVM @CONFIG_IDF_TARGET@ version @ATOMVM_VERSION@ image written to:"
echo "@CMAKE_BINARY_DIR@/atomvm-@CONFIG_IDF_TARGET@-@ATOMVM_VERSION@.img"
echo "@CMAKE_BINARY_DIR@/atomvm-@[email protected]"

0 comments on commit fb15a82

Please sign in to comment.