diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 9b204c4e..497b1987 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -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-pr... PR_HEAD_SHA is the branch @@ -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' @@ -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 }} @@ -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 diff --git a/msi/Package.wxs b/msi/Package.wxs index 938148d0..b62d522a 100644 --- a/msi/Package.wxs +++ b/msi/Package.wxs @@ -19,7 +19,6 @@ - @@ -38,7 +37,10 @@ - + @@ -49,18 +51,6 @@ - see https://docs.firegiant.com/wix/tools/wixext/quietexec/#quiet-running-as-deferred-custom-actions --> - - - - - + Text="(Advanced user option. Not recommended for production deployments.) If checked, the service runs with minimal privileges using a virtual service account. If unchecked, the service runs as Local System." /> @@ -325,7 +313,6 @@ Value="ServiceAccountDlg" Order="10" Condition="1" /> - diff --git a/msi/en-US.wxl b/msi/en-US.wxl new file mode 100644 index 00000000..00b1187f --- /dev/null +++ b/msi/en-US.wxl @@ -0,0 +1,4 @@ + + + +