From 072a81930aa2017b4228e51dd14840b14756375e Mon Sep 17 00:00:00 2001 From: Ben Knight Date: Mon, 29 Nov 2021 16:40:33 +0000 Subject: [PATCH 1/8] replace DEV_BRANCH with SHOW_CONSOLE option --- scripts/build.bat | 4 ++-- stereo_vision_toolkit.pro | 11 ++--------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/scripts/build.bat b/scripts/build.bat index bc530a92..71cc63ad 100644 --- a/scripts/build.bat +++ b/scripts/build.bat @@ -16,10 +16,10 @@ call "%visual_studio_path%\VC\Auxiliary\Build\vcvars64.bat" mkdir build cd build :: release build -qmake.exe "CONFIG+=qtquickcompiler CONFIG+=DEV_BRANCH CONFIG+=WITH_I3DRSGM" ..\stereo_vision_toolkit.pro -spec win32-msvc +qmake.exe "CONFIG+=qtquickcompiler CONFIG+=WITH_I3DRSGM" ..\stereo_vision_toolkit.pro -spec win32-msvc %qt_creator_path%\jom.exe :: debug build -qmake.exe "CONFIG+=debug CONFIG+=qml_debug CONFIG+=qtquickcompiler CONFIG+=DEV_BRANCH CONFIG+=WITH_I3DRSGM" ..\stereo_vision_toolkit.pro -spec win32-msvc +qmake.exe "CONFIG+=debug CONFIG+=qml_debug CONFIG+=qtquickcompiler CONFIG+=WITH_I3DRSGM" ..\stereo_vision_toolkit.pro -spec win32-msvc %qt_creator_path%\jom.exe :: reset working directory diff --git a/stereo_vision_toolkit.pro b/stereo_vision_toolkit.pro index 400abaeb..162e840c 100644 --- a/stereo_vision_toolkit.pro +++ b/stereo_vision_toolkit.pro @@ -35,15 +35,8 @@ CONFIG -= debug_and_release_target # Define if doing development build # !! ONLY USE WHEN ON DEVELOPMENT BRANCH !! # !! MAKE SURE TO REMOVE THIS BUILD OPTION WHEN DOING RELEASE !! -DEV_BRANCH { - message("Development build") - message("!! MAKE SURE TO REMOVE [CONFIG+=DEV_BRANCH] BUILD OPTION WHEN DOING MAIN RELEASE !!") - DEFINES += DEV_BRANCH - - CONFIG(debug, debug|release) { #debug - }else { # release - CONFIG += console - } +SHOW_CONSOLE { + CONFIG += console } # Setup FERVOR defines From 1143e240293e9b580993a32126a6fa3cb88e494e Mon Sep 17 00:00:00 2001 From: Ben Knight Date: Mon, 29 Nov 2021 17:16:44 +0000 Subject: [PATCH 2/8] add new release procedure to README --- README.md | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 6cbaa240..41bb7516 100644 --- a/README.md +++ b/README.md @@ -85,15 +85,11 @@ There is an issue where QT doesn't use the generic vc redist package and instead Arduino code for controlling Phobos cameras is provided in src/camera/camera_control. This is for the serial communication between the arduino and this toolkit. See [issue](https://github.com/i3drobotics/stereo-vision-toolkit/issues/54) for more information. -### Procedure for new main release -1. Update version number manually in version.txt and in ReleaseNotesDev.html. Then run update_appcast.bat to update the appcast (**DO NOT PUSH THESE CHANGES YET**). Use a or b in version number to denote alpha and beta releases. (e.g. v1.3.1a.19). -2. Update ReleaseNotes.html with improvements, bug fixes, and known issues. -3. Build new version (Make sure to use the build arguments: 'CONFIG+=WITH_I3DRSGM') -4. Create installer using inno setup (right click 'installer.iss' and click 'compile') -6. Update Appcast.xml enclosure length with the file size of the installer -5. On [GitHub](https://github.com/i3drobotics/stereo-vision-toolkit/releases) create new release -a. Tag should match version number of toolkit (e.g. v1.3.1) and target 'main' branch. - b. Title should have the program name and version (e.g. 'Stereo Vision Toolkit v1.3.1') - d. Description should list improvements, bug fixes, and known issues (which should match release notes). - e. Upload stereo toolkit installer -6. Once installer is uploaded to release, push the repository file changes, check the changes have been pushed to the GitHub repository and then publish the release. It is important to do this quickly and in the correct order to make sure the updater remains valid. +### Procedure for new release +1. To make changes create a branch of the main repository with the name SVTK-XXX where XXX is the issue number of the task you are working on. If you are working on a code changing task (e.g. a task that will need building / testing of code) then you should create a feature branch e.g. feature/SVTK-XXX so that it is picked up by the automatic build process. +2. Make your changes to the new branch. +2. Update version number in version.txt. Then run update_version.bat to update the version number across repo. +3. Update ReleaseNotes.html with improvements, bug fixes, and known issues. +4. Update the changelog.txt file with the changes the changes you have made and the associated GitHub issue number. +6. Create a pull request on GitHub for merging your branch to the main branch. +7. Once the code has been tested and approved, merge the branch to the main branch. This will automatically create a new release. \ No newline at end of file From 221b2f8125534393f38dd08015d58819e6cc6e05 Mon Sep 17 00:00:00 2001 From: Ben Knight Date: Mon, 29 Nov 2021 17:17:15 +0000 Subject: [PATCH 3/8] remove DEV_BRANCH comments --- stereo_vision_toolkit.pro | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stereo_vision_toolkit.pro b/stereo_vision_toolkit.pro index 162e840c..bc136689 100644 --- a/stereo_vision_toolkit.pro +++ b/stereo_vision_toolkit.pro @@ -32,9 +32,7 @@ CONFIG += doc CONFIG -= debug_and_release CONFIG -= debug_and_release_target -# Define if doing development build -# !! ONLY USE WHEN ON DEVELOPMENT BRANCH !! -# !! MAKE SURE TO REMOVE THIS BUILD OPTION WHEN DOING RELEASE !! +# Option to build with console window SHOW_CONSOLE { CONFIG += console } From 8f94f3403da6e6ac8d2a5a643e51b6afcb78b0a3 Mon Sep 17 00:00:00 2001 From: Ben Knight Date: Mon, 29 Nov 2021 17:17:33 +0000 Subject: [PATCH 4/8] update version, changelog & release notes --- Appcast.xml | 10 +++++----- ReleaseNotes.html | 2 +- changelog.md | 6 ++++++ docs/index.html | 4 ++-- release.md | 2 +- version.txt | 2 +- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Appcast.xml b/Appcast.xml index dbf71051..4cd83d5e 100644 --- a/Appcast.xml +++ b/Appcast.xml @@ -1,6 +1,6 @@ - Version 1.3.4 - Mon, 29 November 2021 13:15 +0000 + Version 1.3.5 + Mon, 29 November 2021 17:15 +0000 https://github.com/i3drobotics/stereo-vision-toolkit/releases/latest/download/ReleaseNotes.html @@ -28,8 +28,8 @@ diff --git a/ReleaseNotes.html b/ReleaseNotes.html index d4c9246e..3b4ef018 100644 --- a/ReleaseNotes.html +++ b/ReleaseNotes.html @@ -1,7 +1,7 @@ # Stereo Vision Toolkit Changes: -- Deployment process improvements +- Removed development releases. Single main release is now sole release version to reduce complexity. Known issues: - Requires manual restart after installation. diff --git a/changelog.md b/changelog.md index b73db815..26d8226f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,12 @@ # Stereo Vision Toolkit Changelog Each change is tied to a GitHub issue see [issues](https://github.com/i3drobotics/stereo-vision-toolkit/issues) for details +# v1.3.5 +## New Features +- Add SHOW_CONSOLE build option for debugging release build [#107](https://github.com/i3drobotics/stereo-vision-toolkit/issues/107) +## Update +- Remove DEV_BRANCH from build options due to no longer being used [#107](https://github.com/i3drobotics/stereo-vision-toolkit/issues/107) + # v1.3.4 ## Updates - Improve GitHub review and build process [#97](https://github.com/i3drobotics/stereo-vision-toolkit/issues/97) [#99](https://github.com/i3drobotics/stereo-vision-toolkit/issues/99) diff --git a/docs/index.html b/docs/index.html index adae1e1e..753c91d0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -7,8 +7,8 @@

Industrial 3D Robotics

Stereo Vision Toolkit

-

Latest release: 1.3.4

- diff --git a/release.md b/release.md index e50bea02..1cb08a78 100644 --- a/release.md +++ b/release.md @@ -1,7 +1,7 @@ # Stereo Vision Toolkit Changes: -- Deployment process improvements +- Removed development releases. Single main release is now sole release version to reduce complexity. Known issues: - Requires manual restart after installation. diff --git a/version.txt b/version.txt index 8c9698aa..aaf8be71 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.3.4 \ No newline at end of file +1.3.5 \ No newline at end of file From 920f42333160538a900b24d87e46a6edc5f5db95 Mon Sep 17 00:00:00 2001 From: Ben Knight Date: Mon, 29 Nov 2021 17:52:00 +0000 Subject: [PATCH 5/8] remove I3DRSGM from debug in build script --- scripts/build.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.bat b/scripts/build.bat index 71cc63ad..21e1435b 100644 --- a/scripts/build.bat +++ b/scripts/build.bat @@ -19,7 +19,7 @@ cd build qmake.exe "CONFIG+=qtquickcompiler CONFIG+=WITH_I3DRSGM" ..\stereo_vision_toolkit.pro -spec win32-msvc %qt_creator_path%\jom.exe :: debug build -qmake.exe "CONFIG+=debug CONFIG+=qml_debug CONFIG+=qtquickcompiler CONFIG+=WITH_I3DRSGM" ..\stereo_vision_toolkit.pro -spec win32-msvc +qmake.exe "CONFIG+=debug CONFIG+=qml_debug CONFIG+=qtquickcompiler" ..\stereo_vision_toolkit.pro -spec win32-msvc %qt_creator_path%\jom.exe :: reset working directory From e450cbbc448147628f03b49838c363e1bdd142eb Mon Sep 17 00:00:00 2001 From: Ben Knight Date: Mon, 29 Nov 2021 17:52:23 +0000 Subject: [PATCH 6/8] change feed link for fevor updator --- src/svtkwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/svtkwindow.cpp b/src/svtkwindow.cpp index 1c271f62..1979d82b 100644 --- a/src/svtkwindow.cpp +++ b/src/svtkwindow.cpp @@ -292,7 +292,7 @@ void SVTKWindow::checkUpdates(){ // Set the Fervor appcast url //TODO fix developer version update system - FvUpdater::sharedUpdater()->SetFeedURL("https://raw.githubusercontent.com/i3drobotics/stereo-vision-toolkit/main/Appcast.xml"); + FvUpdater::sharedUpdater()->SetFeedURL("https://github.com/i3drobotics/stereo-vision-toolkit/releases/latest/download/Appcast.xml"); // Print current version to debug qDebug() << FV_APP_NAME << FV_APP_VERSION; From 60ae507115b316c8bdc45eb204a2abedf0294ee5 Mon Sep 17 00:00:00 2001 From: Ben Knight Date: Tue, 30 Nov 2021 10:47:13 +0000 Subject: [PATCH 7/8] add version check to workflows --- .github/workflows/deploy.yml | 24 ++++++++++++ .github/workflows/pull_request.yml | 24 ++++++++++++ scripts/version-check.sh | 59 ++++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+) create mode 100644 scripts/version-check.sh diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index bd78516e..ac171b81 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,6 +20,30 @@ jobs: # Checkout submodules (required for fever module used in app update system) - name: Checkout submodules run: git submodule update --init --recursive + + # Get project version + - name: Get project version + shell: bash + run: | + PROJ_VER=$(cat version.txt) + echo "SVTK_VERSION=$PROJ_VER" >> $GITHUB_ENV + # Get latest released version + - uses: oprypin/find-latest-tag@v1 + with: + repository: i3drobotics/stereo-vision-toolkit # The repository to scan. + releases-only: true # All relevant tags have a GitHub release for them. + id: latest-svtk # The step ID to refer to later. + - name: Get latest released version + shell: bash + run: | + LATEST_SVTK_VERSION=${{steps.latest-svtk.outputs.tag}} + LATEST_SVTK_VERSION=${LATEST_SVTK_VERSION:1} + echo "LATEST_SVTK_VERSION=$LATEST_SVTK_VERSION" >> $GITHUB_ENV + # Check build version is greater than latest released version + - name: Version check + shell: bash + run: ./scripts/version-check.sh $SVTK_VERSION $LATEST_SVTK_VERSION + # Setup build environment - name: Install Qt uses: jurplel/install-qt-action@v2 diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 80ec74eb..6d55bf3f 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -25,6 +25,30 @@ jobs: # Checkout submodules (required for fever module used in app update system) - name: Checkout submodules run: git submodule update --init --recursive + + # Get project version + - name: Get project version + shell: bash + run: | + PROJ_VER=$(cat version.txt) + echo "SVTK_VERSION=$PROJ_VER" >> $GITHUB_ENV + # Get latest released version + - uses: oprypin/find-latest-tag@v1 + with: + repository: i3drobotics/stereo-vision-toolkit # The repository to scan. + releases-only: true # All relevant tags have a GitHub release for them. + id: latest-svtk # The step ID to refer to later. + - name: Get latest released version + shell: bash + run: | + LATEST_SVTK_VERSION=${{steps.latest-svtk.outputs.tag}} + LATEST_SVTK_VERSION=${LATEST_SVTK_VERSION:1} + echo "LATEST_SVTK_VERSION=$LATEST_SVTK_VERSION" >> $GITHUB_ENV + # Check build version is greater than latest released version + - name: Version check + shell: bash + run: ./scripts/version-check.sh $SVTK_VERSION $LATEST_SVTK_VERSION + # Setup build environment - name: Install Qt uses: jurplel/install-qt-action@v2 diff --git a/scripts/version-check.sh b/scripts/version-check.sh new file mode 100644 index 00000000..9554cc0d --- /dev/null +++ b/scripts/version-check.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +BUILD_VERSION=$1 +LATEST_VERSION=$2 + +# modified from: https://stackoverflow.com/a/4025065 + +# compare version strings +vercomp () { + if [[ $1 == $2 ]] + then + return 0 + fi + local IFS=. + local i ver1=($1) ver2=($2) + # fill empty fields in ver1 with zeros + for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)) + do + ver1[i]=0 + done + for ((i=0; i<${#ver1[@]}; i++)) + do + if [[ -z ${ver2[i]} ]] + then + # fill empty fields in ver2 with zeros + ver2[i]=0 + fi + if ((10#${ver1[i]} > 10#${ver2[i]})) + then + return 1 + fi + if ((10#${ver1[i]} < 10#${ver2[i]})) + then + return 2 + fi + done + return 0 +} + +# check arg1 version is greater than arg2 version +vergt () { + vercomp $1 $2 + res=$? + # case $? in + # 0) op='=';; + # 1) op='>';; + # 2) op='<';; + # esac + if [[ $res != 1 ]] + then + echo "ERROR: Build Version must be greater than currently released version." + else + echo "Build version is valid." + fi +} + +echo "BUILD_VERSION: $BUILD_VERSION" +echo "LATEST_VERSION: $LATEST_VERSION" +vergt $BUILD_VERSION $LATEST_VERSION \ No newline at end of file From 2c82f639d3293495ff9af353f3b49d1372b08cda Mon Sep 17 00:00:00 2001 From: Ben Knight Date: Tue, 30 Nov 2021 10:51:57 +0000 Subject: [PATCH 8/8] update changelog --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index 26d8226f..e121c06b 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ Each change is tied to a GitHub issue see [issues](https://github.com/i3drobotic # v1.3.5 ## New Features - Add SHOW_CONSOLE build option for debugging release build [#107](https://github.com/i3drobotics/stereo-vision-toolkit/issues/107) +- Add version check to workflows [#111](https://github.com/i3drobotics/stereo-vision-toolkit/issues/111) ## Update - Remove DEV_BRANCH from build options due to no longer being used [#107](https://github.com/i3drobotics/stereo-vision-toolkit/issues/107)