I am setting up an Azure DevOps Pipeline for an electron-forge project on windows.

I have a Squirrel.Windows maker which creates the installer:

      "makers": [
        {
          "name": "@electron-forge/maker-squirrel",
          "config": {
            "name": "MyApplication",
          }
        }
      ]

I want my pipeline to pick up this path, so I can use it in e.g. a PublishPipelineArtifact@1 task.

I figure I can do this by using an azure logging command to print something like

##vso[task.setvariable variable=squirrel;isoutput=true]${INSTALLER_FULL_PATH}

How can I get squirrel to print out that string to stdout? Is there a better approach to this problem with Azure DevOps?

1

There are 1 answers

0
MHebes On

My current solution is a hack which still hardcodes some things like the output path, but I think it should work for the most part:

steps:
  - powershell: |
     $ci_package_json = Get-Content .\package.json | Out-String | ConvertFrom-Json
     Write-Host "##vso[task.setvariable variable=squirrelOutput]$(pwd)\out\make\squirrel.windows\x64\$($ci_package_json.productName)-$($ci_package_json.version) Setup.exe"
  - script: echo $(squirrelOutput)

Would love a more robust solution.