mirror of
https://github.com/EyeTrackVR/OpenIris.git
synced 2025-11-04 15:39:42 +08:00
fix: release version out of sync
This commit is contained in:
parent
e567a948ea
commit
65ffbbd038
5
.github/workflows/build_release_bins.yml
vendored
5
.github/workflows/build_release_bins.yml
vendored
@ -84,6 +84,11 @@ jobs:
|
|||||||
release-openiris:
|
release-openiris:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [build]
|
needs: [build]
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
target_name: [esp32AIThinker, esp32M5Stack, esp32Cam, esp_eye, wrover, wrovers3]
|
||||||
|
target_build_type: ["", _release]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|||||||
@ -148,8 +148,8 @@
|
|||||||
[
|
[
|
||||||
"@semantic-release/exec",
|
"@semantic-release/exec",
|
||||||
{
|
{
|
||||||
"prepareCmd": "sed -i 's/\"version\": \"[0-9\\.]*\",/\"version\": \"${nextRelease.version}\",/g' ./ESP/lib/library.json",
|
"prepareCmd": "./repo-tools/scripts/prepareCMD.sh ${nextRelease.version}",
|
||||||
"publishCmd": "ls -l"
|
"publishCmd": "echo Publishing ${nextRelease.version}"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@ -168,6 +168,7 @@
|
|||||||
{
|
{
|
||||||
"assets": [
|
"assets": [
|
||||||
"ESP/lib/library.json",
|
"ESP/lib/library.json",
|
||||||
|
"ESP/ini/dev_config.ini",
|
||||||
"LICENSE*",
|
"LICENSE*",
|
||||||
"CHANGELOG.md"
|
"CHANGELOG.md"
|
||||||
],
|
],
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
platform = espressif32
|
platform = espressif32
|
||||||
framework = arduino
|
framework = arduino
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
|
custom_firmware_version = 0.0.0
|
||||||
monitor_rts = 0
|
monitor_rts = 0
|
||||||
monitor_dtr = 0
|
monitor_dtr = 0
|
||||||
monitor_filters =
|
monitor_filters =
|
||||||
@ -24,6 +25,7 @@ extra_scripts =
|
|||||||
pre:tools/customname.py
|
pre:tools/customname.py
|
||||||
post:tools/createzip.py
|
post:tools/createzip.py
|
||||||
build_flags =
|
build_flags =
|
||||||
|
-DVERSION=${this.custom_firmware_version}
|
||||||
-DENABLE_ADHOC=${wifi.enableadhoc}
|
-DENABLE_ADHOC=${wifi.enableadhoc}
|
||||||
-DADHOC_CHANNEL=${wifi.adhocchannel}
|
-DADHOC_CHANNEL=${wifi.adhocchannel}
|
||||||
-DWIFI_CHANNEL=${wifi.channel}
|
-DWIFI_CHANNEL=${wifi.channel}
|
||||||
|
|||||||
@ -120,11 +120,11 @@ def customName(project, version, commit, branch):
|
|||||||
PROGNAME="%s-%s-%s"
|
PROGNAME="%s-%s-%s"
|
||||||
% (
|
% (
|
||||||
str(env["PIOENV"]),
|
str(env["PIOENV"]),
|
||||||
s(defines.get("PIO_SRC_TAG")),
|
env.GetProjectOption("custom_firmware_version"),
|
||||||
s(defines.get("PIO_SRC_BRH")),
|
s(defines.get("PIO_SRC_BRH")),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# detect if there is a forward slash in the PROGNAME and replace it with an underscore
|
# detect if there is a forward slash in the PROGNAME and replace it with an underscore
|
||||||
if "/" in env["PROGNAME"]:
|
if "/" in env["PROGNAME"]:
|
||||||
|
|||||||
106
repo-tools/scripts/prepareCMD.sh
Normal file
106
repo-tools/scripts/prepareCMD.sh
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# create a vairable to hold a passed in argument
|
||||||
|
# this argument is the next release version
|
||||||
|
# this is passed in from the .releaserc file
|
||||||
|
|
||||||
|
sudo apt-get install -y jq
|
||||||
|
|
||||||
|
nextReleaseVersion=$1
|
||||||
|
|
||||||
|
# parse all letters a-z and A-Z and replace with nothing
|
||||||
|
# this will remove all letters from the version string
|
||||||
|
# this is to ensure that the version string is a valid semver
|
||||||
|
|
||||||
|
# check if there is a letter in the version string
|
||||||
|
# if there is a letter, then remove it
|
||||||
|
# if there is no letter, then do nothing
|
||||||
|
if [[ $nextReleaseVersion =~ [a-zA-Z] ]]; then
|
||||||
|
nextReleaseVersion=$(echo $nextReleaseVersion | sed 's/[a-zA-Z]//g')
|
||||||
|
|
||||||
|
# check if there is a dash in the version string
|
||||||
|
# if there is a dash, then replace it with a dot
|
||||||
|
# if there is no dash, then do nothing
|
||||||
|
if [[ $nextReleaseVersion =~ "-" ]]; then
|
||||||
|
# parse all dashes and replace with dots
|
||||||
|
# this is to ensure that the version string is a valid semver
|
||||||
|
nextReleaseVersion=$(echo $nextReleaseVersion | sed 's/-/./g')
|
||||||
|
|
||||||
|
# remove everything after the third dot and the dot itself
|
||||||
|
# this is to ensure that the version string is a valid semver
|
||||||
|
nextReleaseVersion=$(echo $nextReleaseVersion | sed 's/\.[0-9]*$//g')
|
||||||
|
# remove the last dot
|
||||||
|
nextReleaseVersion=$(echo $nextReleaseVersion | sed 's/\.$//g')
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# print the next release version
|
||||||
|
|
||||||
|
printf "[prepareCMD.sh]: Next version: ${nextReleaseVersion}\n"
|
||||||
|
|
||||||
|
# This script is used to execute the prepareCMD.sh script on the remote host
|
||||||
|
printf "[prepareCMD.sh]: Executing prepareCMD.sh on remote host \n"
|
||||||
|
|
||||||
|
printf "[prepareCMD.sh]: Updating the version in the library.json file \n"
|
||||||
|
|
||||||
|
# make a temp file
|
||||||
|
tmp=$(mktemp)
|
||||||
|
|
||||||
|
jq --arg a "$nextReleaseVersion" '.version = $a' ./ESP/lib/library.json > "$tmp" && mv "$tmp" ./ESP/lib/library.json -f
|
||||||
|
|
||||||
|
printf "[prepareCMD.sh]: Done \n"
|
||||||
|
|
||||||
|
printf "[prepareCMD.sh]: Installing the dependencies for the ini file \n"
|
||||||
|
|
||||||
|
pip3 install yq
|
||||||
|
|
||||||
|
export PATH="~/.local/bin:$PATH"
|
||||||
|
source ~/.bashrc
|
||||||
|
|
||||||
|
tmp=$(mktemp)
|
||||||
|
tomlq -t --arg version "$nextReleaseVersion" '.env.custom_firmware_version |= $version' ./ESP/ini/dev_config.ini > "$tmp" && mv "$tmp" ./ESP/ini/dev_config.ini -f
|
||||||
|
|
||||||
|
printf "[prepareCMD.sh]: Done, continuing with release. \n"
|
||||||
|
|
||||||
|
# mass rename files in the ./build sub folders
|
||||||
|
printf "[prepareCMD.sh]: Mass renaming files in the ./build sub folders \n"
|
||||||
|
|
||||||
|
#create an array of all the sub folders in the build folder
|
||||||
|
buildPaths=($(ls ./build))
|
||||||
|
|
||||||
|
printf "[prepareCMD.sh]: buildPaths: ${buildPaths[@]} \n"
|
||||||
|
|
||||||
|
# loop through all the sub folders in the build folder
|
||||||
|
for buildPath in "${buildPaths[@]}"
|
||||||
|
do
|
||||||
|
# create a variable to hold the path to the sub folder
|
||||||
|
buildPath="./build/${buildPath}"
|
||||||
|
|
||||||
|
# create a vari able to hold the path to the sub folder's files
|
||||||
|
buildPathFiles=($(ls ${buildPath}))
|
||||||
|
|
||||||
|
# loop through all the files in the sub folder and rename them to the next release version
|
||||||
|
for buildPathFile in "${buildPathFiles[@]}"
|
||||||
|
do
|
||||||
|
# create a variable to hold the path to the file
|
||||||
|
buildPathFile="${buildPath}/${buildPathFile}"
|
||||||
|
|
||||||
|
# rename the file to the next release version
|
||||||
|
# parse out the sub folder name and append it to the next release version
|
||||||
|
# this is to ensure that the file name is unique
|
||||||
|
|
||||||
|
#create a variable that holds the current directory
|
||||||
|
currentDir=$(pwd)
|
||||||
|
|
||||||
|
#parse out the parent folder name and store it in a variable
|
||||||
|
buildPathFileSubFolder=$(basename $(dirname ${buildPathFile}))
|
||||||
|
|
||||||
|
# append the sub folder name to the next release version
|
||||||
|
nextReleaseVersion="${buildPathFileSubFolder}-v${nextReleaseVersion}-master"
|
||||||
|
|
||||||
|
mv ${buildPathFile} ${buildPath}/${nextReleaseVersion}.zip
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
printf "[prepareCMD.sh]: Done \n"
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user