-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
75 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Build MSI | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
# since this is being triggered manually on branch but we should use our regular git tags when we're back on the normal flow | ||
msi_version: | ||
description: "MSI package version (e.g., 1.0.0)" | ||
required: true | ||
|
||
jobs: | ||
build-msi: | ||
runs-on: windows-2019 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.23.1' | ||
|
||
- name: Install Make | ||
run: choco install make --yes | ||
|
||
- name: Install WiX CLI | ||
run: dotnet tool install --global wix | ||
|
||
- name: Install WiX Extensions | ||
run: | | ||
wix extension add -g WixToolset.Firewall.wixext/5.0.2 | ||
wix extension add -g WixToolset.Util.wixext/5.0.2 | ||
- name: Build Go binary | ||
run: make windows | ||
|
||
- name: Build MSI | ||
run: | | ||
wix build agent.wxs -define GoBinDir="${{ github.workspace }}\bin" -define MSIProductVersion="${{ github.event.inputs.msi_version }}" -ext WixToolset.Util.wixext -ext WixToolset.Firewall.wixext -o agent-${{ github.event.inputs.msi_version }}.msi | ||
- name: Upload MSI artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: agent-${{ github.event.inputs.msi_version }}.msi | ||
path: agent-${{ github.event.inputs.msi_version }}.msi |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" | ||
xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util" | ||
xmlns:fire="http://wixtoolset.org/schemas/v4/wxs/firewall"> | ||
<Package Name="viam-agent" Manufacturer="viam" Version="$(var.MSIProductVersion)" UpgradeCode="d3b5bca3-4bec-46cb-a063-ca6315de7de4" Language="1033" Scope="perMachine"> | ||
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" /> | ||
|
||
<StandardDirectory Id="TARGETDIR"> | ||
<Directory Id="CustomInstallPath" Name="opt"> | ||
<Directory Id="ViamFolder" Name="viam"> | ||
<Directory Id="INSTALLFOLDER" Name="bin"> | ||
<Component Id="MainServiceComponent" Guid="d478ceba-537c-4e49-9262-bf24ccfe4909"> | ||
<File Id="ViamExe" Source="$(var.GoBinDir)\viam-agent.exe" KeyPath="yes" /> | ||
<ServiceInstall Id="InstallAgentervice" Name="viam-agent" DisplayName="viam-agent Service" Description="viam-agent Windows service" Start="auto" Type="ownProcess" ErrorControl="normal" Account="LocalSystem" Interactive="yes" /> | ||
<ServiceControl Id="ControlAgentService" Name="viam-agent" Start="install" Stop="both" Remove="uninstall" Wait="yes" /> | ||
<fire:FirewallException Id="AllowAllTCP" Name="viam-agent" Profile="all" Protocol="tcp" Scope="any" /> | ||
<fire:FirewallException Id="AllowAllUDP" Name="viam-agent" Profile="all" Protocol="tcp" Scope="any" /> | ||
</Component> | ||
</Directory> | ||
</Directory> | ||
</Directory> | ||
</StandardDirectory> | ||
|
||
<Feature Id="MainFeature" Title="Main Feature" Level="1"> | ||
<ComponentRef Id="MainServiceComponent" /> | ||
</Feature> | ||
</Package> | ||
</Wix> |