Build #46
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: workflow_dispatch | |
jobs: | |
build: | |
runs-on: windows-latest | |
environment: webview_build | |
env: | |
API_URL: ${{ secrets.API_URL }} | |
API_WS_URL: ${{ secrets.API_WS_URL }} | |
LOCAL_API_URL: ${{ vars.LOCAL_API_URL }} | |
LOCAL_API_SECRET_KEY: ${{ secrets.LOCAL_API_SECRET_KEY }} | |
API_SECRET_KEY: ${{ secrets.LOCAL_API_SECRET_KEY }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Update submodules | |
run: | | |
git submodule update --recursive --remote | |
- name: Build webview ui | |
run: | | |
cd T3000Webview | |
npm install | |
npm run build | |
- name: Setup Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: i686-pc-windows-msvc | |
- name: Build webview api | |
run: | | |
cd T3000Webview/api | |
cargo build --target=i686-pc-windows-msvc --release | |
- name: Get T3000 version number | |
id: version | |
run: | | |
$version = Get-Date -Format “yyyyMMdd” | |
Write-Output version=$version >> $Env:GITHUB_OUTPUT | |
- name: Setup MSBuild | |
uses: microsoft/setup-msbuild@v2 | |
- name: Build Solution | |
run: | | |
msbuild "T3000 - VS2019.sln" /p:Platform=x86 /p:Configuration=Release /p:ProjectVersion=${{ steps.version.outputs.version }} | |
- name: Clean & Orgenize Files | |
continue-on-error: true | |
run: | | |
del "T3000 Output\release\*.pdb" | |
del "T3000 Output\release\*.lib" | |
del "T3000 Output\release\*.exp" | |
del "T3000 Output\release\*.ilk" | |
del "T3000 Output\release\ReadSinglePropDescr.xml" | |
del "T3000 Output\release\BacnetExplore.exe.config" | |
xcopy "T3000Webview\dist\spa\" "T3000 Output\release\ResourceFile\webview\www\" /E /H /C /I /y | |
xcopy "T3000Webview\api\target\i686-pc-windows-msvc\release\t3_webview_api.dll" "T3000 Output\release\" /Y | |
xcopy "T3000Webview\api\target\i686-pc-windows-msvc\release\t3_webview_api.dll.lib" "T3000 Output\release\" /Y | |
- name: Set the installer version ( doesn't accept big numbers so we add a point ) | |
id: iversion | |
run: | | |
$iversion = '${{ steps.version.outputs.version }}' | |
$iversion = $iversion.Insert(4,'.') | |
Write-Output iversion=$iversion >> $Env:GITHUB_OUTPUT | |
- name: Build the installer | |
uses: caphyon/advinst-github-action@main | |
with: | |
advinst-version: "20.9" | |
advinst-enable-automation: "true" | |
aip-path: ${{ github.workspace }}\T3000.aip | |
aip-build-name: DefaultBuild | |
aip-package-name: T3000-setup.msi | |
aip-output-dir: ${{ github.workspace }}\setup | |
aip-commands: | | |
AddFolder "APPDIR" ".\T3000 Output\release" -install_in_parent_folder | |
AddFolder "APPDIR" ".\T3000InstallShield\PH_Application" | |
AddFolder "APPDIR" ".\T3000InstallShield\Psychrometry" | |
SetProductCode -langid 1033 | |
SetVersion ${{ steps.iversion.outputs.iversion }} | |
- name: Upload the installer to artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: T3000-setup | |
path: setup/T3000-setup.msi | |
- name: Prepare & zip the update files | |
run: | | |
Rename-Item -Path ".\T3000 Output\release\Update.exe" -NewName "UpdateEng.exe" | |
Compress-Archive -Path ".\T3000 Output\release\*" -CompressionLevel Optimal -DestinationPath .\20T3000Update.zip | |
- name: Upload the update files to artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: 20T3000Update | |
path: T3000 Output/release/* |