Skip to content

Commit

Permalink
Create zip (EyeTrackVR#39)
Browse files Browse the repository at this point in the history
* feat: testing craetezip script

* feat: testing craetezip script

* feat: testing craetezip script

* feat: testing craetezip script

* feat: testing createzip script

* feat: testing createzip script

* chore(minor): 1.4.0-create-zip.1 [skip ci]

## [1.4.0-create-zip.1](EyeTrackVR/OpenIris@v1.3.0...v1.4.0-create-zip.1) (2023-01-31)

### 🍕 Features

* testing craetezip script ([7db8063](EyeTrackVR@7db8063))
* testing craetezip script ([2584e37](EyeTrackVR@2584e37))
* testing craetezip script ([174e9ae](EyeTrackVR@174e9ae))
* testing craetezip script ([0d2b56e](EyeTrackVR@0d2b56e))
* testing createzip script ([c7d3ed7](EyeTrackVR@c7d3ed7))
* testing createzip script ([4eb4758](EyeTrackVR@4eb4758))

* feat: testing createzip script

* chore(minor): 1.4.0-create-zip.2 [skip ci]

## [1.4.0-create-zip.2](EyeTrackVR/OpenIris@v1.4.0-create-zip.1...v1.4.0-create-zip.2) (2023-01-31)

### 🍕 Features

* testing createzip script ([fb9c35d](EyeTrackVR@fb9c35d))

* feat: testing createzip script

* feat: testing createzip script

* feat: testing createzip script

* feat: testing createzip script

* feat: testing createzip script

* feat: testing createzip script

* feat: testing createzip script

* feat: testing createzip script

* feat: testing createzip script

* feat: testing createzip script

* feat: testing createzip script

* chore(minor): 1.4.0-create-zip.3 [skip ci]

## [1.4.0-create-zip.3](EyeTrackVR/OpenIris@v1.4.0-create-zip.2...v1.4.0-create-zip.3) (2023-01-31)

### 🍕 Features

* testing createzip script ([1a3ba1b](EyeTrackVR@1a3ba1b))
* testing createzip script ([3094c29](EyeTrackVR@3094c29))
* testing createzip script ([af89d4d](EyeTrackVR@af89d4d))
* testing createzip script ([35bb0f2](EyeTrackVR@35bb0f2))
* testing createzip script ([ab196c5](EyeTrackVR@ab196c5))
* testing createzip script ([c63e223](EyeTrackVR@c63e223))
* testing createzip script ([9d3fd65](EyeTrackVR@9d3fd65))
* testing createzip script ([ef652f4](EyeTrackVR@ef652f4))
* testing createzip script ([bcef340](EyeTrackVR@bcef340))
* testing createzip script ([8d4d5cc](EyeTrackVR@8d4d5cc))
* testing createzip script ([fd6ccdc](EyeTrackVR@fd6ccdc))

* fix offset order bug

* fix: firmware binary bundling bug

* chore(patch): 1.4.0-create-zip.4 [skip ci]

## [1.4.0-create-zip.4](EyeTrackVR/OpenIris@v1.4.0-create-zip.3...v1.4.0-create-zip.4) (2023-02-01)

### 🐛 Bug Fixes

* firmware binary bundling bug ([6004cdf](EyeTrackVR@6004cdf))

* no-release: cleanup script

* refactor: cleanup script

* chore(patch): 1.4.0-create-zip.5 [skip ci]

## [1.4.0-create-zip.5](EyeTrackVR/OpenIris@v1.4.0-create-zip.4...v1.4.0-create-zip.5) (2023-02-02)

### 🧑‍💻 Code Refactoring

* cleanup script ([a2202d6](EyeTrackVR@a2202d6))

* feat: add detection of environment variable

* chore(minor): 1.4.0-create-zip.6 [skip ci]

## [1.4.0-create-zip.6](EyeTrackVR/OpenIris@v1.4.0-create-zip.5...v1.4.0-create-zip.6) (2023-02-02)

### 🍕 Features

* add detection of environment variable ([ca8080e](EyeTrackVR@ca8080e))

* refactor: prepare for merge

---------

Co-authored-by: semantic-release-bot <[email protected]>
  • Loading branch information
ZanzyTHEbar and semantic-release-bot authored Feb 2, 2023
1 parent 8932767 commit 8229a3a
Show file tree
Hide file tree
Showing 8 changed files with 183 additions and 67 deletions.
120 changes: 59 additions & 61 deletions .github/workflows/build_release_bins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,19 @@ on:
push:
branches:
- "master"
- "main"
pull_request:
branches:
- "master"
- "main"
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
target_name: [
esp32AIThinker,
esp32M5Stack,
esp32Cam,
esp_eye,
wrover,
]
target_build_type: [
"",
_release,
_OTA,
]
matrix:
target_name: [esp32AIThinker, esp32M5Stack, esp32Cam, esp_eye, wrover]
target_build_type: ["", _release, _OTA]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -40,78 +32,84 @@ jobs:
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
restore-keys: |
${{ runner.os }}-pio-
- name: Setup Python install
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: "3.x"
- name: Install PlatformIO with Pip
run: |
python -m pip install --upgrade pip
pip install distro
pip install --upgrade platformio
pio upgrade --dev
pio pkg update --global
- name: Update build command
working-directory: ./ESP
run: |
sed -i '/\[env\]/p; s/\[env\]/upload_protocol = custom/' platformio.ini
- name: Build OpenIris Firmware
working-directory: ./ESP
run: |
export OPENIRIS_CI_BUILD=1
mkdir build
mkdir build/${{ matrix.target_name }}${{ matrix.target_build_type }}
echo "::group::platformio.ini"
cat platformio.ini
echo "::endgroup::"
echo "::group::pio run"
pio run --environment ${{ matrix.target_name }}${{ matrix.target_build_type }}
#- name: Archive Version File
# uses: actions/upload-artifact@v3
# with:
# name: version
# path: ./ESP/tools/version.txt
echo "::endgroup::"
unzip -l './build/${{ matrix.target_name }}${{ matrix.target_build_type }}/*.zip'
- name: Archive Firmware name File
# create an environment variable with the name of the firmware file by catting the firmware_name.txt file
run: |
echo "FIRMWARE_NAME=$(cat ./ESP/tools/firmware_name.txt)" >> $GITHUB_ENV
- name: Archive Firmware Files
- name: Archive Firmware Binaries
uses: actions/upload-artifact@v3
with:
with:
name: ${{ matrix.target_name }}${{ matrix.target_build_type }}-firmware
path: "./ESP/.pio/build/${{ matrix.target_name }}${{ matrix.target_build_type }}/${{ env.FIRMWARE_NAME }}.bin"
#path: "./ESP/.pio/build/${{ matrix.target_name }}${{ matrix.target_build_type }}/${{ env.FIRMWARE_NAME }}.bin"
path: "./ESP/build/${{ matrix.target_name }}${{ matrix.target_build_type }}/${{ env.FIRMWARE_NAME }}.zip"
retention-days: 5
if-no-files-found: error
release-openiris:
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Create Directory
run: mkdir -p build
- name: Download Firmware Files
uses: actions/download-artifact@v2
with:
path: build/
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install -g conventional-changelog-conventionalcommits
- run: npm install -g [email protected]
- run: npm install -g @semantic-release/exec
- run: npm install -g @semantic-release/git
- run: npm install -g @semantic-release/release-notes-generator
- run: npm install -g @semantic-release/changelog
- run: npm install -g @semantic-release/github
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: semantic-release
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Create Directory
run: mkdir -p build
- name: Download Firmware Files
uses: actions/download-artifact@v2
with:
path: build/
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install -g conventional-changelog-conventionalcommits
- run: npm install -g [email protected]
- run: npm install -g @semantic-release/exec
- run: npm install -g @semantic-release/git
- run: npm install -g @semantic-release/release-notes-generator
- run: npm install -g @semantic-release/changelog
- run: npm install -g @semantic-release/github
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: semantic-release
cleanup:
strategy:
fail-fast: false
matrix:
target_name: [
esp32AIThinker,
esp32M5Stack,
esp32Cam,
esp_eye,
wrover,
]
target_build_type: [
"",
_release,
_OTA,
]
matrix:
target_name: [esp32AIThinker, esp32M5Stack, esp32Cam, esp_eye, wrover]
target_build_type: ["", _release, _OTA]
name: Cleanup actions
needs:
- release-openiris
Expand All @@ -121,4 +119,4 @@ jobs:
- name: "♻️ remove build artifacts"
uses: geekyeggo/delete-artifact@v1
with:
name: ${{ matrix.target_name }}${{ matrix.target_build_type }}-firmware
name: ${{ matrix.target_name }}${{ matrix.target_build_type }}-firmware
2 changes: 1 addition & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
"addReleases": "bottom",
"assets": [
{
"path": "./build/**/*.bin"
"path": "./build/**/*.zip"
}
]
}
Expand Down
57 changes: 57 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,63 @@
[![semantic versioning](https://img.shields.io/badge/semantic%20versioning-2.0.0-green.svg)](https://semver.org)
> All notable changes to this project will be documented in this file
## [1.4.0-create-zip.6](https://github.com/lorow/OpenIris/compare/v1.4.0-create-zip.5...v1.4.0-create-zip.6) (2023-02-02)


### 🍕 Features

* add detection of environment variable ([ca8080e](https://github.com/lorow/OpenIris/commit/ca8080e7f1727d273f4d135414a1e17d11eaddc8))

## [1.4.0-create-zip.5](https://github.com/lorow/OpenIris/compare/v1.4.0-create-zip.4...v1.4.0-create-zip.5) (2023-02-02)


### 🧑‍💻 Code Refactoring

* cleanup script ([a2202d6](https://github.com/lorow/OpenIris/commit/a2202d6288a76ab195d7cfb8fc14245d1a4715f9))

## [1.4.0-create-zip.4](https://github.com/lorow/OpenIris/compare/v1.4.0-create-zip.3...v1.4.0-create-zip.4) (2023-02-01)


### 🐛 Bug Fixes

* firmware binary bundling bug ([6004cdf](https://github.com/lorow/OpenIris/commit/6004cdf9b7c97d7f604f62077751926919059774))

## [1.4.0-create-zip.3](https://github.com/lorow/OpenIris/compare/v1.4.0-create-zip.2...v1.4.0-create-zip.3) (2023-01-31)


### 🍕 Features

* testing createzip script ([1a3ba1b](https://github.com/lorow/OpenIris/commit/1a3ba1b47ff9b948e69e1ce03119fe1aea65e62e))
* testing createzip script ([3094c29](https://github.com/lorow/OpenIris/commit/3094c29d1fde5d3b16dd7150f9784e07d0093cc3))
* testing createzip script ([af89d4d](https://github.com/lorow/OpenIris/commit/af89d4d38062947fef578970787d1b90e3cea188))
* testing createzip script ([35bb0f2](https://github.com/lorow/OpenIris/commit/35bb0f2935832b2e65a3f0870c8f084daee5fde1))
* testing createzip script ([ab196c5](https://github.com/lorow/OpenIris/commit/ab196c56ac61932144e27d69b181e7c0b25aedc6))
* testing createzip script ([c63e223](https://github.com/lorow/OpenIris/commit/c63e22300215103321b4be6821d9f3902c9dd128))
* testing createzip script ([9d3fd65](https://github.com/lorow/OpenIris/commit/9d3fd65d6f13f22f522d840ce50dad74663891c2))
* testing createzip script ([ef652f4](https://github.com/lorow/OpenIris/commit/ef652f4a923f59134a697ed6dc0228a31b978826))
* testing createzip script ([bcef340](https://github.com/lorow/OpenIris/commit/bcef34014d37b3b974bdd8209b67ae6e9f30cfaf))
* testing createzip script ([8d4d5cc](https://github.com/lorow/OpenIris/commit/8d4d5cc1705628c38b0046201b4ff146f9ba9e20))
* testing createzip script ([fd6ccdc](https://github.com/lorow/OpenIris/commit/fd6ccdcae140dd2fdfd8a4b439cba84282a9832c))

## [1.4.0-create-zip.2](https://github.com/lorow/OpenIris/compare/v1.4.0-create-zip.1...v1.4.0-create-zip.2) (2023-01-31)


### 🍕 Features

* testing createzip script ([fb9c35d](https://github.com/lorow/OpenIris/commit/fb9c35dda9b8447e74673ffb7ed793bd57d9c39e))

## [1.4.0-create-zip.1](https://github.com/lorow/OpenIris/compare/v1.3.0...v1.4.0-create-zip.1) (2023-01-31)


### 🍕 Features

* testing craetezip script ([7db8063](https://github.com/lorow/OpenIris/commit/7db8063291e24926929450ebf8b40778f82a9d97))
* testing craetezip script ([2584e37](https://github.com/lorow/OpenIris/commit/2584e37ffacb2aa2ed915842c03657b85c4dd881))
* testing craetezip script ([174e9ae](https://github.com/lorow/OpenIris/commit/174e9aebe74fdff6fdbe88cf6555c6d1d2ba8555))
* testing craetezip script ([0d2b56e](https://github.com/lorow/OpenIris/commit/0d2b56e62fbd4c7694ee40a06ccfa2ac0dba8eab))
* testing createzip script ([c7d3ed7](https://github.com/lorow/OpenIris/commit/c7d3ed7b79d4da68052b08bc9c9489a7925883b7))
* testing createzip script ([4eb4758](https://github.com/lorow/OpenIris/commit/4eb4758147e021e7e2447eb98a663bd8b4d5de3e))

## [1.3.0](https://github.com/lorow/OpenIris/compare/v1.2.0...v1.3.0) (2023-01-31)


Expand Down
4 changes: 2 additions & 2 deletions ESP/lib/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"include": "/lib/src"
},
"dependencies": {},
"version": "1.3.0",
"version": "1.4.0",
"frameworks": "arduino",
"platforms": "espressif32"
}
}
2 changes: 1 addition & 1 deletion ESP/lib/src/data/StateManager/StateManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ StateManager<WebServerState_e> webServerStateManager;
StateManager<MDNSState_e> mdnsStateManager;
StateManager<CameraState_e> cameraStateManager;
StateManager<LEDStates_e> ledStateManager;
StateManager<StreamState_e> streamStateManager;
StateManager<StreamState_e> streamStateManager;
2 changes: 1 addition & 1 deletion ESP/lib/src/data/StateManager/StateManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ extern StateManager<CameraState_e> cameraStateManager;
extern StateManager<LEDStates_e> ledStateManager;
extern StateManager<StreamState_e> streamStateManager;

#endif // STATEMANAGER_HPP
#endif // STATEMANAGER_HPP
4 changes: 3 additions & 1 deletion ESP/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,6 @@ lib_deps =
https://github.com/me-no-dev/AsyncTCP.git

build_type = debug
extra_scripts = pre:tools/customname.py
extra_scripts =
pre:tools/customname.py
post:tools/createzip.py
59 changes: 59 additions & 0 deletions ESP/tools/createzip.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/usr/bin/env python3
Import("env")

import sys
import os
from ntpath import basename
from zipfile import ZipFile
import json


def createZip(source, target, env):
if os.getenv("OPENIRIS_CI_BUILD", False):
if sys.platform.lower().startswith(("ubuntu", "linux")):
print("Program has been built, creating zip archive!")
program_path = target[0].get_abspath()

array_args = [env["FLASH_EXTRA_IMAGES"]]

for offset, image in env["FLASH_EXTRA_IMAGES"]:
print("\nImage: %s" % str(image))
array_args.extend([str(offset), str(image)])

array_args.append(env["ESP32_APP_OFFSET"])
array_args.append(program_path)

n = 2
partitions_arg = array_args[1:]
print(f"partitions_args: {partitions_arg}")
partitions = final = [
partitions_arg[i * n : (i + 1) * n]
for i in range((len(partitions_arg) + n - 1) // n)
]
print(f"partitions: {partitions}")
file_name = "./build/{0}/{1}.zip".format(
str(env["PIOENV"]), env["PROGNAME"]
)
with ZipFile(file_name, "w") as archive:
print('\nCreating "' + archive.filename + '"', end="\n")
parts = []
for [offset, path] in partitions:
filename = basename(path)
archive.write(path, filename)
partition = {
"path": filename,
"offset": int(offset, 16),
}
parts.append(partition)
manifest = {
"chipFamily": "ESP32",
"parts": parts,
}
archive.writestr("manifest.json", json.dumps(manifest))
else:
print("Not running on Linux, skipping zip creation")
else:
print("CI build not detected, skipping zip creation")


env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", createZip)

0 comments on commit 8229a3a

Please sign in to comment.