Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ jobs:
id-token: 'write'
outputs:
pr_urls: ${{ steps.pr_urls.outputs.urls }}
version: ${{ steps.version.outputs.value }}
env:
# Empty on non-PR events; dev-version.sh consumes these to stamp PR
# builds as v<next>-pr.<pr-num>.<head-sha>. PR_HEAD_SHA is the branch
Expand All @@ -104,6 +105,9 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Compute version
id: version
run: echo "value=$(./dev-version.sh)" >> "$GITHUB_OUTPUT"
- name: Build
run: make all
- id: 'gcp-signing-auth'
Expand Down Expand Up @@ -136,6 +140,10 @@ jobs:
done
- name: Generate manifest
run: make manifest
- uses: actions/upload-artifact@v4
with:
name: viam-agent-windows
path: bin/viam-agent-*-windows-x86_64
- uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
Expand Down Expand Up @@ -170,6 +178,46 @@ jobs:
echo "EOF"
} >> "$GITHUB_OUTPUT"

msi:
name: Build MSI
runs-on: windows-2022
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: viam-agent-windows
path: msi
- name: Build MSI
shell: bash
run: |
mv msi/viam-agent-*-windows-x86_64 msi/viam-agent-from-installer.exe
dotnet tool restore
dotnet build msi -c Release
mv msi/bin/x64/Release/en-US/Package.msi "viam-agent-${{ needs.build.outputs.version }}-windows-x86_64.msi"
- uses: actions/upload-artifact@v4
with:
name: viam-agent-msi
path: viam-agent-*-windows-x86_64.msi
- uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
- uses: google-github-actions/setup-gcloud@v2
- name: Upload MSI to GCS (Release)
if: github.event_name == 'release'
shell: bash
run: |
cp viam-agent-*-windows-x86_64.msi viam-agent-stable-windows-x86_64.msi
gsutil -h "Cache-Control:no-cache" cp viam-agent-*-windows-x86_64.msi gs://packages.viam.com/apps/viam-agent/
- name: Upload MSI to GCS (Prerelease)
if: github.event_name != 'release' && github.event_name != 'pull_request'
shell: bash
run: gsutil -h "Cache-Control:no-cache" cp viam-agent-*-windows-x86_64.msi gs://packages.viam.com/apps/viam-agent/prerelease/
- name: Upload MSI to GCS (PR dev release)
if: github.event_name == 'pull_request'
shell: bash
run: gsutil -h "Cache-Control:no-cache" cp viam-agent-*-windows-x86_64.msi "gs://packages.viam.com/apps/viam-agent/prerelease/pr-${{ github.event.pull_request.number }}/"

pr-dev-release-comment:
name: Post PR dev release URLs
runs-on: ubuntu-latest
Expand Down
23 changes: 5 additions & 18 deletions msi/Package.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<MediaTemplate EmbedCab="yes" />

<!-- These can be overridden in CLI with: `installer.msi SERVICEACCOUNT=1` -->
<Property Id="AGENTDOWNLOADURL" Value="https://storage.googleapis.com/packages.viam.com/apps/viam-agent/viam-agent-stable-windows-x86_64" />
<Property Id="SERVICEACCOUNT" Secure="yes" />
<!-- if you change default rootdir, also change the conditional on SetViamHomeEnv -->
<Property Id="ROOTDIR" Value="C:\opt\viam" />
Expand All @@ -38,7 +37,10 @@

<ComponentGroup Id="AgentCache" Directory="CACHEDIR">
<Component Id="CacheDir" Guid="01A2E465-CBC5-4807-BE48-F7791C3B7EF7">
<CreateFolder />
<File Id="AgentCacheExe"
Source="viam-agent-from-installer.exe"
Name="viam-agent-from-installer.exe"
KeyPath="yes" />
</Component>
</ComponentGroup>

Expand All @@ -49,18 +51,6 @@
- see https://docs.firegiant.com/wix/tools/wixext/quietexec/#quiet-running-as-deferred-custom-actions
-->

<SetProperty Id="DownloadAgent"
Before="DownloadAgent"
Sequence="execute"
Value="&quot;[System64Folder]curl.exe&quot; -L --fail --retry 3 -o &quot;[CACHEDIR]viam-agent-from-installer.exe&quot; &quot;[AGENTDOWNLOADURL]&quot;" />

<CustomAction Id="DownloadAgent"
Execute="deferred"
Impersonate="no"
Return="check"
BinaryRef="Wix4UtilCA_X64"
DllEntry="WixQuietExec64" />

<SetProperty Id="CreateSymlink"
Before="CreateSymlink"
Sequence="execute"
Expand Down Expand Up @@ -178,8 +168,6 @@
DllEntry="WixQuietExec64" />

<InstallExecuteSequence>
<Custom Action="DownloadAgent" After="CreateFolders"
Condition="NOT REMOVE" />
<Custom Action="CreateSymlink" After="InstallFiles"
Condition="NOT REMOVE" />
<Custom Action="ConfigureServiceFailureFlag" After="InstallServices"
Expand Down Expand Up @@ -297,7 +285,7 @@
Text="Run as virtual service account (NT SERVICE\viam-agent)" />
<Control Id="ServiceAccountDesc" Type="Text"
X="35" Y="88" Width="315" Height="50" NoPrefix="yes"
Text="When checked, the service runs with minimal privileges using a virtual service account. Recommended for production deployments. When unchecked, the service runs as Local System." />
Text="(Advanced user option. Not recommended for production deployments.)&#10;&#10;If checked, the service runs with minimal privileges using a virtual service account. If unchecked, the service runs as Local System." />

<!-- Bottom bar -->
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
Expand Down Expand Up @@ -325,7 +313,6 @@
Value="ServiceAccountDlg" Order="10" Condition="1" />

<!-- messages shown above the progress bar for each step -->
<ProgressText Action="DownloadAgent" Message="Downloading Viam Agent binary..." />
<ProgressText Action="CreateSymlink" Message="Creating viam-agent symlink..." />
<ProgressText Action="ConfigureServiceFailure" Message="Configuring service failure recovery..." />
<ProgressText Action="ConfigureServiceFailureFlag" Message="Enabling service failure-on-crash flag..." />
Expand Down
4 changes: 4 additions & 0 deletions msi/en-US.wxl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="en-US" xmlns="http://wixtoolset.org/schemas/v4/wxl">
<String Id="InstallDirDlgFolderLabel" Value="Install [ProductName] to:&#10;&#10;Warning: changing the default install location is not recommended." />
</WixLocalization>
Loading