Release #21
Workflow file for this run
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
# This workflow now builds T3000Controls and BACnetStackLibrary components | |
name: Release | |
on: | |
release: | |
types: [published] | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
release: | |
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 | |
shell: pwsh | |
run: | | |
$version = '${{ github.event.release.tag_name }}' | |
$version = $version -replace "[^0-9]" | |
if (-not $version) { | |
$version = (Get-Date).ToString('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 file to the release assets | |
id: releaseFile | |
uses: shogo82148/actions-upload-release-asset@v1 | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ${{ github.workspace }}\setup\T3000-setup.msi | |
asset_name: T3000-setup.msi | |
asset_content_type: application/x-ms-installer | |
- 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: Zip the installer file | |
run: Compress-Archive -Path ".\setup\T3000-setup.msi" -CompressionLevel Optimal -DestinationPath .\09T3000Software.zip | |
- name: Set up SSH Key with Correct Permissions | |
run: | | |
mkdir -p $HOME\.ssh | |
echo "${{ secrets.SSH_PRIVATE_KEY }}" > $HOME\.ssh\id_rsa | |
chmod 600 $HOME\.ssh\id_rsa # Correct permissions for SSH key | |
shell: bash | |
- name: Upload the update file via SCP | |
run: | | |
scp -i $HOME\.ssh\id_rsa -o StrictHostKeyChecking=no -P 22 ./20T3000Update.zip ${{ secrets.FTP_USER }}@${{ vars.FTP_HOST }}:/home/bravoftp/software/ | |
shell: bash | |
- name: Upload the software installer file via SCP | |
run: | | |
scp -i $HOME\.ssh\id_rsa -o StrictHostKeyChecking=no -P 22 ./09T3000Software.zip ${{ secrets.FTP_USER }}@${{ vars.FTP_HOST }}:/home/bravoftp/software/ | |
shell: bash | |
- name: Update T3000 version in the INI file | |
id: webhookRequest | |
uses: fjogeleit/http-request-action@v1 | |
with: | |
url: "${{ vars.T3_VERSION_UPDATER_WEBHOOK_URL }}" | |
method: "POST" | |
customHeaders: '{"Content-Type": "application/json", "X-Secret-Key": "${{ secrets.T3_VERSION_UPDATER_WEBHOOK_SECRET }}"}' | |
data: '{"version": "${{ steps.version.outputs.version }}", "url": "${{ steps.releaseFile.outputs.browser_download_url }}"}' |