diff --git a/.github/workflows/build-all-on-macos.yml b/.github/workflows/build-all-on-macos.yml index da0f9a3..d6db7b7 100644 --- a/.github/workflows/build-all-on-macos.yml +++ b/.github/workflows/build-all-on-macos.yml @@ -1,7 +1,7 @@ -name: Build all on macos +name: macOS on: [push] jobs: - clone-to-OF_ROOT: + clone-macos: runs-on: [self-hosted, macOS] environment: RUNNER-MACOS steps: @@ -18,39 +18,77 @@ jobs: echo "Directory does not already exist" fi - name: checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v4 - name: move fresh clone to OF_ROOT run: cp -r ../$(echo ${{ github.repository }} | cut -d '/' -f 2) ${{ vars.ADDONS_DIR }} - build-oscilloscope: - needs: clone-to-OF_ROOT + build-oscilloscope-macos: + needs: clone-macos runs-on: [self-hosted, macOS] environment: RUNNER-MACOS - steps: + steps: - name: build using xcode working-directory: ${{ vars.OFXEMOTIBIT_DIR }} run: | echo "current working directory" && pwd cd EmotiBitOscilloscope xcodebuild -project EmotiBitOscilloscope.xcodeproj -scheme Release-x86_64 - build-dataparser: - needs: clone-to-OF_ROOT + build-dataparser-macos: + needs: clone-macos runs-on: [self-hosted, macOS] environment: RUNNER-MACOS - steps: + steps: - name: build using xcode working-directory: ${{ vars.OFXEMOTIBIT_DIR }} run: | echo "current working directory" && pwd cd EmotiBitDataParser xcodebuild -project EmotiBitDataParser.xcodeproj -scheme Release - build-firmwareinstaller: - needs: clone-to-OF_ROOT + build-firmwareinstaller-macos: + needs: clone-macos runs-on: [self-hosted, macOS] environment: RUNNER-MACOS - steps: + steps: - name: build using xcode working-directory: ${{ vars.OFXEMOTIBIT_DIR }} run: | echo "current working directory" && pwd cd EmotiBitFirmwareInstaller xcodebuild -project EmotiBitFirmwareInstaller.xcodeproj -scheme Release + upload-artifact-macos: + needs: [build-oscilloscope-macos, build-dataparser-macos, build-firmwareinstaller-macos] + if: github.ref == 'refs/heads/dev' + runs-on: [self-hosted, macOS] + environment: RUNNER-MACOS + steps: + - name: get version for artifact name + id: get_version + working-directory: ${{ vars.OFXEMOTIBIT_DIR }} + run: | + version=$(grep ./src/ofxEmotiBitVersion.h -e "string ofxEmotiBitVersion" | cut -d '"' -f 2) + echo "version=$version" >> $GITHUB_OUTPUT + echo "Staging release for version: $version" + - name: create stage-release + working-directory: ${{ vars.OFXEMOTIBIT_DIR }} + run: mkdir -p stageRelease/EmotiBitSoftware-macos-${{ steps.get_version.outputs.version }} + - name: Move application binaries + working-directory: ${{ vars.OFXEMOTIBIT_DIR }} + run: | + mv EmotiBitOscilloscope/bin/EmotiBitOscilloscope.app stageRelease/EmotiBitSoftware-macos-${{ steps.get_version.outputs.version }} + mv EmotiBitDataParser/bin/EmotiBitDataParser.app stageRelease/EmotiBitSoftware-macos-${{ steps.get_version.outputs.version }} + mv EmotiBitFirmwareInstaller/bin/EmotiBitFirmwareInstaller.app stageRelease/EmotiBitSoftware-macos-${{ steps.get_version.outputs.version }} + - name: copy SiLabs drivers + working-directory: ${{ vars.ADDONS_DIR }} + run: | + silabsDriverPath="../../drivers/macOS_VCP_Driver" + if [ -d "$silabsDriverPath" ]; then + echo "copying drivers!" + cp -r "$silabsDriverPath/" "ofxEmotiBit/stageRelease/EmotiBitSoftware-macos-${{ steps.get_version.outputs.version }}" + else + echo "drivers not found! proceeding without drivers!" + exit 1 + fi + - name: upload artifact + uses: actions/upload-artifact@v4 + with: + name: EmotiBitSoftware_v${{ steps.get_version.outputs.version }}-macOS + path: ${{ vars.OFXEMOTIBIT_DIR }}/stageRelease/EmotiBitSoftware-macos-${{ steps.get_version.outputs.version }}/ diff --git a/.github/workflows/build-all-on-win.yaml b/.github/workflows/build-all-on-win.yaml index ab33212..202cdca 100644 --- a/.github/workflows/build-all-on-win.yaml +++ b/.github/workflows/build-all-on-win.yaml @@ -1,7 +1,7 @@ -name: Build all on Windows +name: Windows on: [push] jobs: - clone-to-OF_ROOT: + clone-windows: runs-on: [self-hosted, Windows] environment: RUNNER-WINDOWS steps: @@ -19,29 +19,29 @@ jobs: echo "Directory does not already exist" fi - name: checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v4 - name: move fresh clone to OF_ROOT shell: bash run: | echo ${{ github.repository }} | cut -d '/' -f 2 cp -r ..\\$(echo ${{ github.repository }} | cut -d '/' -f 2) ${{ vars.ADDONS_DIR }} - build-oscilloscope: - needs: clone-to-OF_ROOT + build-oscilloscope-windows: + needs: clone-windows runs-on: [self-hosted, Windows] environment: RUNNER-WINDOWS - steps: + steps: - name: build using MSBuild shell: cmd working-directory: ${{ vars.OFXEMOTIBIT_DIR }} run: | echo "current working directory" && pwd cd EmotiBitOscilloscope - MSBuild EmotiBitOscilloscope.sln -t:Build -p:Configuration=Release - build-dataparser: - needs: clone-to-OF_ROOT + MSBuild EmotiBitOscilloscope.sln -t:Build -p:Configuration=Release + build-dataparser-windows: + needs: clone-windows runs-on: [self-hosted, Windows] environment: RUNNER-WINDOWS - steps: + steps: - name: build using MSBuild shell: cmd working-directory: ${{ vars.OFXEMOTIBIT_DIR }} @@ -49,15 +49,102 @@ jobs: echo "current working directory" && pwd cd EmotiBitDataParser MSBuild EmotiBitDataParser.sln -t:Build -p:Configuration=Release - build-firmwareinstaller: - needs: clone-to-OF_ROOT + build-firmwareinstaller-windows: + needs: clone-windows runs-on: [self-hosted, Windows] environment: RUNNER-WINDOWS - steps: + steps: - name: build using MSBuild shell: cmd working-directory: ${{ vars.OFXEMOTIBIT_DIR }} run: | echo "current working directory" && pwd cd EmotiBitFirmwareInstaller - MSBuild EmotiBitFirmwareInstaller.sln -t:Build -p:Configuration=Release \ No newline at end of file + MSBuild EmotiBitFirmwareInstaller.sln -t:Build -p:Configuration=Release + build-installer-windows: + needs: [build-oscilloscope-windows, build-dataparser-windows, build-firmwareinstaller-windows] + if: github.ref == 'refs/heads/dev' + runs-on: [self-hosted, Windows] + environment: RUNNER-WINDOWS + steps: + - name: check INNO Setup installation + shell: powershell -ExecutionPolicy Bypass -File {0} + run: | + $innoPath = "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" + if (-not (Test-Path $innoPath)) { + Write-Host "INNO Setup 6 not found at $innoPath" + Write-Host "Downloading INNO Setup 6..." + $innoUrl = "https://files.jrsoftware.org/is/6/innosetup-6.3.3.exe" + $innoInstaller = "$env:TEMP\innosetup-6.3.3.exe" + Invoke-WebRequest -Uri $innoUrl -OutFile $innoInstaller + Write-Host "Installing INNO Setup 6..." + Start-Process -FilePath $innoInstaller -Args "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-" -Wait + Write-Host "INNO Setup 6 installed successfully" + } else { + Write-Host "INNO Setup 6 found at $innoPath" + } + - name: Download VC++ Redistributable + shell: powershell -ExecutionPolicy Bypass -File {0} + working-directory: ${{ vars.OFXEMOTIBIT_DIR }} + run: | + $redistPath = "EmotiBitInstaller\redist" + $redistFile = "$redistPath\vc_redist.x64.exe" + if (-not (Test-Path $redistFile)) { + Write-Host "VC++ Redistributable not found, downloading..." + New-Item -ItemType Directory -Force -Path $redistPath | Out-Null + $url = "https://aka.ms/vs/17/release/vc_redist.x64.exe" + Invoke-WebRequest -Uri $url -OutFile $redistFile + Write-Host "Downloaded VC++ Redistributable to $redistFile" + } else { + Write-Host "VC++ Redistributable already exists at $redistFile" + } + - name: build installer with INNO Setup + shell: cmd + working-directory: ${{ vars.OFXEMOTIBIT_DIR }} + run: | + cd EmotiBitInstaller + "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" EmotiBitInstaller.iss + upload-artifact-windows: + needs: build-installer-windows + if: github.ref == 'refs/heads/dev' + runs-on: [self-hosted, Windows] + environment: RUNNER-WINDOWS + steps: + - name: populate stage release + shell: bash + working-directory: ${{ vars.OFXEMOTIBIT_DIR }} + run: | + version=$(grep ./src/ofxEmotiBitVersion.h -e "string ofxEmotiBitVersion" | cut -d '"' -f 2) + releaseFolder="EmotiBitSoftware-Windows-${version}" + echo "Staging release for version: $version" + echo "Release folder: $releaseFolder" + mkdir -p "stageRelease/$releaseFolder" + installerPath="./EmotiBitInstaller/Output/EmotiBitInstaller-${version}.exe" + if [ -f "$installerPath" ]; then + echo "INNO Setup installer found: $installerPath" + echo "copying installer" + cp "$installerPath" "./stageRelease/$releaseFolder/" + echo "copying drivers" + for i in $(find ../../../drivers -maxdepth 1 -mindepth 1 -name '*CP210x*' -type d); do + dirname=$(basename "$i") + worktree="../../../drivers/$dirname" + echo "copying $dirname" + cp -r "$worktree" "./stageRelease/$releaseFolder" + done + echo "Release staged successfully in: stageRelease/$releaseFolder" + else + echo "ERROR: Installer not found at $installerPath" + exit 1 + fi + - name: get version for artifact name + id: get_version + shell: bash + working-directory: ${{ vars.OFXEMOTIBIT_DIR }} + run: | + version=$(grep ./src/ofxEmotiBitVersion.h -e "string ofxEmotiBitVersion" | cut -d '"' -f 2) + echo "version=$version" >> $GITHUB_OUTPUT + - name: upload artifact + uses: actions/upload-artifact@v4 + with: + name: EmotiBitSoftware_v${{ steps.get_version.outputs.version }}-Windows + path: ${{ vars.OFXEMOTIBIT_DIR }}\\stageRelease\\EmotiBitSoftware-Windows-${{ steps.get_version.outputs.version }} \ No newline at end of file diff --git a/.github/workflows/create-draft-release.yml b/.github/workflows/create-draft-release.yml index 5161af7..9c6aebd 100644 --- a/.github/workflows/create-draft-release.yml +++ b/.github/workflows/create-draft-release.yml @@ -26,8 +26,8 @@ jobs: - name: Download Mac artifacts uses: dawidd6/action-download-artifact@v6 with: - workflow: upload-build-artifact-mac.yml - branch: master + workflow: build-all-on-macos.yml + branch: dev name: EmotiBitSoftware_v${{ steps.get_version.outputs.version }}-macOS path: ./ skip_unpack: true @@ -36,8 +36,8 @@ jobs: - name: Download Windows artifacts uses: dawidd6/action-download-artifact@v6 with: - workflow: upload-build-artifact-win.yml - branch: master + workflow: build-all-on-win.yaml + branch: dev name: EmotiBitSoftware_v${{ steps.get_version.outputs.version }}-Windows path: ./ skip_unpack: true diff --git a/.github/workflows/linux-workflows.yaml b/.github/workflows/linux-workflows.yaml index f420440..3325726 100644 --- a/.github/workflows/linux-workflows.yaml +++ b/.github/workflows/linux-workflows.yaml @@ -1,7 +1,7 @@ -name: Linux workflows +name: Linux on: [push] jobs: - clone-to-OF_ROOT: + clone-linux: runs-on: [self-hosted, Linux] environment: RUNNER-LINUX steps: @@ -18,21 +18,21 @@ jobs: echo "Directory does not already exist" fi - name: checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v4 - name: move fresh clone to OF_ROOT run: cp -r ../$(echo ${{ github.repository }} | cut -d '/' -f 2) ${{ vars.ADDONS_DIR }} - build-oscilloscope: - needs: clone-to-OF_ROOT + build-oscilloscope-linux: + needs: clone-linux uses: ./.github/workflows/reusable-workflow-build-oscilloscope-linux.yml - build-dataparser: - needs: clone-to-OF_ROOT + build-dataparser-linux: + needs: clone-linux uses: ./.github/workflows/reusable-workflow-build-dataParser-linux.yml - test-oscilloscope: - needs: build-oscilloscope + test-oscilloscope-linux: + needs: build-oscilloscope-linux uses: ./.github/workflows/reusable-workflow-test-oscilloscope-linux.yml - test-dataParser: - needs: build-dataparser + test-dataparser-linux: + needs: build-dataparser-linux uses: ./.github/workflows/reusable-workflow-test-dataParser-linux.yml diff --git a/.github/workflows/reusable-workflow-build-dataParser-linux.yml b/.github/workflows/reusable-workflow-build-dataParser-linux.yml index 6babf1a..bd103fe 100644 --- a/.github/workflows/reusable-workflow-build-dataParser-linux.yml +++ b/.github/workflows/reusable-workflow-build-dataParser-linux.yml @@ -1,8 +1,8 @@ -name: Build DataParser on linux +name: Build DataParser on Linux (reusable) on: workflow_call: jobs: - build-dataparser: + build-dataparser-linux: runs-on: [self-hosted, Linux] environment: RUNNER-LINUX steps: diff --git a/.github/workflows/reusable-workflow-build-oscilloscope-linux.yml b/.github/workflows/reusable-workflow-build-oscilloscope-linux.yml index e688fdd..434873a 100644 --- a/.github/workflows/reusable-workflow-build-oscilloscope-linux.yml +++ b/.github/workflows/reusable-workflow-build-oscilloscope-linux.yml @@ -1,8 +1,8 @@ -name: Build Oscilloscope on linux +name: Build Oscilloscope on Linux (reusable) on: workflow_call: jobs: - build-oscilloscope: + build-oscilloscope-linux: runs-on: [self-hosted, Linux] environment: RUNNER-LINUX steps: diff --git a/.github/workflows/reusable-workflow-test-dataParser-linux.yml b/.github/workflows/reusable-workflow-test-dataParser-linux.yml index ec10222..d53b8b8 100644 --- a/.github/workflows/reusable-workflow-test-dataParser-linux.yml +++ b/.github/workflows/reusable-workflow-test-dataParser-linux.yml @@ -1,8 +1,8 @@ -name: Test DataParser +name: Test DataParser on Linux (reusable) on: workflow_call: jobs: - test-DataParser: + test-dataparser-linux: runs-on: [self-hosted, Linux] environment: RUNNER-LINUX steps: diff --git a/.github/workflows/reusable-workflow-test-oscilloscope-linux.yml b/.github/workflows/reusable-workflow-test-oscilloscope-linux.yml index 289abd7..f2a34df 100644 --- a/.github/workflows/reusable-workflow-test-oscilloscope-linux.yml +++ b/.github/workflows/reusable-workflow-test-oscilloscope-linux.yml @@ -1,8 +1,8 @@ -name: Test Oscilloscope +name: Test Oscilloscope on Linux (reusable) on: workflow_call: jobs: - test-oscilloscope: + test-oscilloscope-linux: runs-on: [self-hosted, Linux] environment: RUNNER-LINUX steps: diff --git a/.github/workflows/upload-build-artifact-mac.yml b/.github/workflows/upload-build-artifact-mac.yml deleted file mode 100644 index afbf35c..0000000 --- a/.github/workflows/upload-build-artifact-mac.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: upload build artifact mac -on: - workflow_run: - workflows: ["Build all on macos"] - types: - - completed - branches: - [dev] -jobs: - upload-artifact: - runs-on: [self-hosted, macOS] - environment: RUNNER-MACOS - steps: - - name: get version for artifact name - id: get_version - working-directory: ${{ vars.OFXEMOTIBIT_DIR }} - run: | - version=$(grep ./src/ofxEmotiBitVersion.h -e "string ofxEmotiBitVersion" | cut -d '"' -f 2) - echo "version=$version" >> $GITHUB_OUTPUT - echo "Staging release for version: $version" - - name: create stage-release - working-directory: ${{ vars.OFXEMOTIBIT_DIR }} - run: mkdir -p stageRelease/EmotiBitSoftware-macos-${{ steps.get_version.outputs.version }} - - name: Move application binaries - working-directory: ${{ vars.OFXEMOTIBIT_DIR }} - run: | - mv EmotiBitOscilloscope/bin/EmotiBitOscilloscope.app stageRelease/EmotiBitSoftware-macos-${{ steps.get_version.outputs.version }} - mv EmotiBitDataParser/bin/EmotiBitDataParser.app stageRelease/EmotiBitSoftware-macos-${{ steps.get_version.outputs.version }} - mv EmotiBitFirmwareInstaller/bin/EmotiBitFirmwareInstaller.app stageRelease/EmotiBitSoftware-macos-${{ steps.get_version.outputs.version }} - - name: copy SiLabs drivers - working-directory: ${{ vars.ADDONS_DIR }} - run: | - silabsDriverPath="../../drivers/macOS_VCP_Driver" - if [ -d "$silabsDriverPath" ]; then - echo "copying drivers!" - cp -r "$silabsDriverPath/" "ofxEmotiBit/stageRelease/EmotiBitSoftware-macos-${{ steps.get_version.outputs.version }}" - else - echo "drivers not found! proceeding without drivers!" - exit 1 - fi - - name: upload artifact - uses: actions/upload-artifact@v4 - with: - name: EmotiBitSoftware_v${{ steps.get_version.outputs.version }}-macOS - path: ${{ vars.OFXEMOTIBIT_DIR }}/stageRelease/EmotiBitSoftware-macos-${{ steps.get_version.outputs.version }}/ \ No newline at end of file diff --git a/.github/workflows/upload-build-artifact-win.yml b/.github/workflows/upload-build-artifact-win.yml deleted file mode 100644 index 23c2cc1..0000000 --- a/.github/workflows/upload-build-artifact-win.yml +++ /dev/null @@ -1,106 +0,0 @@ -name: upload build artifact Windows -on: - - #workflow_dispatch: - workflow_run: - workflows: ["Build all on Windows"] - types: - - completed - branches: - [dev] - # Note: Removed "check Installer project version" - no longer needed with INNO Setup auto-version -jobs: - build-installer: - runs-on: [self-hosted, Windows] - environment: RUNNER-WINDOWS - steps: - - name: check INNO Setup installation - shell: powershell -ExecutionPolicy Bypass -File {0} - run: | - $innoPath = "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" - if (-not (Test-Path $innoPath)) { - Write-Host "INNO Setup 6 not found at $innoPath" - Write-Host "Downloading INNO Setup 6..." - $innoUrl = "https://files.jrsoftware.org/is/6/innosetup-6.3.3.exe" - $innoInstaller = "$env:TEMP\innosetup-6.3.3.exe" - Invoke-WebRequest -Uri $innoUrl -OutFile $innoInstaller - Write-Host "Installing INNO Setup 6..." - Start-Process -FilePath $innoInstaller -Args "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-" -Wait - Write-Host "INNO Setup 6 installed successfully" - } else { - Write-Host "INNO Setup 6 found at $innoPath" - } - - - name: Download VC++ Redistributable - shell: powershell -ExecutionPolicy Bypass -File {0} - working-directory: ${{ vars.OFXEMOTIBIT_DIR }} - run: | - $redistPath = "EmotiBitInstaller\redist" - $redistFile = "$redistPath\vc_redist.x64.exe" - - if (-not (Test-Path $redistFile)) { - Write-Host "VC++ Redistributable not found, downloading..." - New-Item -ItemType Directory -Force -Path $redistPath | Out-Null - $url = "https://aka.ms/vs/17/release/vc_redist.x64.exe" - Invoke-WebRequest -Uri $url -OutFile $redistFile - Write-Host "Downloaded VC++ Redistributable to $redistFile" - } else { - Write-Host "VC++ Redistributable already exists at $redistFile" - } - - - name: build installer with INNO Setup - shell: cmd - working-directory: ${{ vars.OFXEMOTIBIT_DIR }} - run: | - cd EmotiBitInstaller - "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" EmotiBitInstaller.iss - - upload-artifact: - needs: build-installer - runs-on: [self-hosted, Windows] - environment: RUNNER-WINDOWS - steps: - - name: populate stage release - shell: bash - working-directory: ${{ vars.OFXEMOTIBIT_DIR }} - run: | - version=$(grep ./src/ofxEmotiBitVersion.h -e "string ofxEmotiBitVersion" | cut -d '"' -f 2) - releaseFolder="EmotiBitSoftware-Windows-${version}" - echo "Staging release for version: $version" - echo "Release folder: $releaseFolder" - - mkdir -p "stageRelease/$releaseFolder" - - installerPath="./EmotiBitInstaller/Output/EmotiBitInstaller-${version}.exe" - - if [ -f "$installerPath" ]; then - echo "INNO Setup installer found: $installerPath" - echo "copying installer" - cp "$installerPath" "./stageRelease/$releaseFolder/" - - echo "copying drivers" - for i in $(find ../../../drivers -maxdepth 1 -mindepth 1 -name '*CP210x*' -type d); do - dirname=$(basename "$i") - worktree="../../../drivers/$dirname" - echo "copying $dirname" - cp -r "$worktree" "./stageRelease/$releaseFolder" - done - - echo "Release staged successfully in: stageRelease/$releaseFolder" - else - echo "ERROR: Installer not found at $installerPath" - exit 1 - fi - - name: get version for artifact name - id: get_version - shell: bash - working-directory: ${{ vars.OFXEMOTIBIT_DIR }} - run: | - version=$(grep ./src/ofxEmotiBitVersion.h -e "string ofxEmotiBitVersion" | cut -d '"' -f 2) - echo "version=$version" >> $GITHUB_OUTPUT - - - name: upload artifact - uses: actions/upload-artifact@v4 - with: - name: EmotiBitSoftware_v${{ steps.get_version.outputs.version }}-Windows - path: ${{ vars.OFXEMOTIBIT_DIR }}\\stageRelease\\EmotiBitSoftware-Windows-${{ steps.get_version.outputs.version }} diff --git a/.github/workflows/validate-version-linux.yml b/.github/workflows/validate-version-linux.yml index c9b376d..a147db3 100644 --- a/.github/workflows/validate-version-linux.yml +++ b/.github/workflows/validate-version-linux.yml @@ -1,4 +1,4 @@ -name: Validate Version on Linux +name: Validate Version on: push: