tools/github_workflows/run-publisher-with-env.yaml [65:108]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        run: |
          Set-StrictMode -Version Latest
          $ErrorActionPreference = "Stop"
          $VerbosePreference = "Continue"
          $InformationPreference = "Continue"

          Write-Information "Setting name variables..."
          $releaseFileName = "publisher-linux-x64.zip"
          $executableFileName = "publisher"

          if ("${{ runner.os }}" -like "*win*") {
            $releaseFileName = "publisher-win-x64.zip"
            $executableFileName = "publisher.exe"
          }
          elseif ("${{ runner.os }}" -like "*mac*" -and "${{ runner.arch }}" -like "*arm*") {
            $releaseFileName = "publisher-osx-arm64.zip"
          }
          elseif ("${{ runner.os }}" -like "*mac*" -and "${{ runner.arch }}" -like "*x86_64*") {
            $releaseFileName = "publisher-osx-x64.zip"
          }

          Write-Information "Downloading release..."
          $uri = "https://github.com/Azure/apiops/releases/download/${{ env.apiops_release_version }}/$releaseFileName"
          $downloadFilePath = Join-Path "${{ runner.temp }}" $releaseFileName
          Invoke-WebRequest -Uri "$uri" -OutFile "$downloadFilePath"

          Write-Information "Extracting release..."
          $executableFolderPath = Join-Path "${{ runner.temp }}" "publisher"
          Expand-Archive -Path "$downloadFilePath" -DestinationPath "$executableFolderPath"
          $executableFilePath = Join-Path "$executableFolderPath" $executableFileName

          Write-Information "Setting file permissions..."
          if ("${{ runner.os }}" -like "*linux*")
          {
            & chmod +x "$executableFilePath"
            if ($LASTEXITCODE -ne 0) { throw "Setting file permissions failed."}
          }

          Write-Information "Running publisher..."
          & "$executableFilePath"              
          if ($LASTEXITCODE -ne 0) { throw "Running publisher failed."}

          Write-Information "Execution complete."
        shell: pwsh
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



tools/github_workflows/run-publisher-with-env.yaml [120:163]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        run: |
          Set-StrictMode -Version Latest
          $ErrorActionPreference = "Stop"
          $VerbosePreference = "Continue"
          $InformationPreference = "Continue"

          Write-Information "Setting name variables..."
          $releaseFileName = "publisher-linux-x64.zip"
          $executableFileName = "publisher"

          if ("${{ runner.os }}" -like "*win*") {
            $releaseFileName = "publisher-win-x64.zip"
            $executableFileName = "publisher.exe"
          }
          elseif ("${{ runner.os }}" -like "*mac*" -and "${{ runner.arch }}" -like "*arm*") {
            $releaseFileName = "publisher-osx-arm64.zip"
          }
          elseif ("${{ runner.os }}" -like "*mac*" -and "${{ runner.arch }}" -like "*x86_64*") {
            $releaseFileName = "publisher-osx-x64.zip"
          }

          Write-Information "Downloading release..."
          $uri = "https://github.com/Azure/apiops/releases/download/${{ env.apiops_release_version }}/$releaseFileName"
          $downloadFilePath = Join-Path "${{ runner.temp }}" $releaseFileName
          Invoke-WebRequest -Uri "$uri" -OutFile "$downloadFilePath"

          Write-Information "Extracting release..."
          $executableFolderPath = Join-Path "${{ runner.temp }}" "publisher"
          Expand-Archive -Path "$downloadFilePath" -DestinationPath "$executableFolderPath"
          $executableFilePath = Join-Path "$executableFolderPath" $executableFileName

          Write-Information "Setting file permissions..."
          if ("${{ runner.os }}" -like "*linux*")
          {
            & chmod +x "$executableFilePath"
            if ($LASTEXITCODE -ne 0) { throw "Setting file permissions failed."}
          }

          Write-Information "Running publisher..."
          & "$executableFilePath"              
          if ($LASTEXITCODE -ne 0) { throw "Running publisher failed."}

          Write-Information "Execution complete."
        shell: pwsh
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



