From 28cd878fa4e3904ef183a55856495873c3f9b594 Mon Sep 17 00:00:00 2001 From: Steve VandenBush Date: Mon, 29 Jan 2024 08:38:50 -0600 Subject: [PATCH 1/9] Update create_github_release.yaml Add osx-arm64 and removing exe from non-windows binaries --- .github/workflows/create_github_release.yaml | 30 +++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/create_github_release.yaml b/.github/workflows/create_github_release.yaml index f41c4e02..c08317bd 100644 --- a/.github/workflows/create_github_release.yaml +++ b/.github/workflows/create_github_release.yaml @@ -13,9 +13,9 @@ jobs: name: Generate extractor artifacts strategy: matrix: - dotnet-runtime: [linux-x64, linux-arm64, win-x64] + dotnet-runtime: [linux-x64, linux-arm64, win-x64, osx-arm64] # Dynamically set the runner OS based on the .NET runtime - runs-on: ${{ fromJSON('{"linux-x64":"ubuntu-latest", "linux-arm64":"ubuntu-latest", "win-x64":"windows-latest"}')[matrix.dotnet-runtime] }} + runs-on: ${{ fromJSON('{"linux-x64":"ubuntu-latest", "linux-arm64":"ubuntu-latest", "win-x64":"windows-latest", "osx-arm64":"macos-latest"}')[matrix.dotnet-runtime] }} steps: - name: Checkout repository uses: actions/checkout@v3 @@ -39,9 +39,9 @@ jobs: & dotnet publish "$sourcePath" --self-contained --runtime "${{ matrix.dotnet-runtime }}" -p:PublishSingleFile=true --output "$outputFolderPath" if ($LASTEXITCODE -ne 0) { throw "Generating extractor failed."} - $exeFileName = "${{ matrix.dotnet-runtime }}".Contains("win") ? "extractor.exe" : "extractor" - $exeFolderPath = Join-Path "$outputFolderPath" "$exeFileName" - Rename-Item -Path "$exeFolderPath" -NewName "${{ format('extractor.{0}.exe', matrix.dotnet-runtime) }}" + $exeFileExt = "${{ matrix.dotnet-runtime }}".Contains("win") ? ".exe" : "" + $exeFolderPath = Join-Path "$outputFolderPath" "extractor" "$exeFileExt" + Rename-Item -Path "$exeFolderPath" -NewName "${{ format('extractor.{0}.exe', matrix.dotnet-runtime) }}$exeFileExt" Write-Information "Execution complete." shell: pwsh @@ -55,9 +55,9 @@ jobs: name: Generate publisher artifacts strategy: matrix: - dotnet-runtime: [linux-x64, linux-arm64, win-x64] + dotnet-runtime: [linux-x64, linux-arm64, win-x64, osx-arm64] # Dynamically set the runner OS based on the .NET runtime - runs-on: ${{ fromJSON('{"linux-x64":"ubuntu-latest", "linux-arm64":"ubuntu-latest", "win-x64":"windows-latest"}')[matrix.dotnet-runtime] }} + runs-on: ${{ fromJSON('{"linux-x64":"ubuntu-latest", "linux-arm64":"ubuntu-latest", "win-x64":"windows-latest", "osx-arm64":"macos-latest"}')[matrix.dotnet-runtime] }} steps: - name: Checkout repository uses: actions/checkout@v3 @@ -81,9 +81,9 @@ jobs: & dotnet publish "$sourcePath" --self-contained --runtime "${{ matrix.dotnet-runtime }}" -p:PublishSingleFile=true --output "$outputFolderPath" if ($LASTEXITCODE -ne 0) { throw "Generating publisher failed."} - $exeFileName = "${{ matrix.dotnet-runtime }}".Contains("win") ? "publisher.exe" : "publisher" - $exeFolderPath = Join-Path "$outputFolderPath" "$exeFileName" - Rename-Item -Path "$exeFolderPath" -NewName "${{ format('publisher.{0}.exe', matrix.dotnet-runtime) }}" + $exeFileExt = "${{ matrix.dotnet-runtime }}".Contains("win") ? ".exe" : "" + $exeFolderPath = Join-Path "$outputFolderPath" "publisher" "$exeFileExt" + Rename-Item -Path "$exeFolderPath" -NewName "${{ format('publisher.{0}', matrix.dotnet-runtime) }}$exeFileExt" Write-Information "Execution complete." shell: pwsh @@ -223,11 +223,13 @@ jobs: with: files: | ${{github.workspace}}/artifact/extractor.win-x64.exe - ${{github.workspace}}/artifact/extractor.linux-x64.exe - ${{github.workspace}}/artifact/extractor.linux-arm64.exe + ${{github.workspace}}/artifact/extractor.linux-x64 + ${{github.workspace}}/artifact/extractor.linux-arm64 + ${{github.workspace}}/artifact/extractor.osx-arm64 ${{github.workspace}}/artifact/publisher.win-x64.exe - ${{github.workspace}}/artifact/publisher.linux-x64.exe - ${{github.workspace}}/artifact/publisher.linux-arm64.exe + ${{github.workspace}}/artifact/publisher.linux-x64 + ${{github.workspace}}/artifact/publisher.linux-arm64 + ${{github.workspace}}/artifact/publisher.osx-arm64 ${{github.workspace}}/artifact/Github.zip ${{github.workspace}}/artifact/Azure_DevOps.zip name: APIOps Toolkit for Azure APIM ${{ github.event.inputs.Release_Version }} From dace753bcc27308184212724a181f1604695fe77 Mon Sep 17 00:00:00 2001 From: stevevandenbush Date: Mon, 29 Jan 2024 09:28:21 -0600 Subject: [PATCH 2/9] Update create_github_release.yaml --- .github/workflows/create_github_release.yaml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/create_github_release.yaml b/.github/workflows/create_github_release.yaml index c08317bd..d6316d8f 100644 --- a/.github/workflows/create_github_release.yaml +++ b/.github/workflows/create_github_release.yaml @@ -41,15 +41,19 @@ jobs: $exeFileExt = "${{ matrix.dotnet-runtime }}".Contains("win") ? ".exe" : "" $exeFolderPath = Join-Path "$outputFolderPath" "extractor" "$exeFileExt" - Rename-Item -Path "$exeFolderPath" -NewName "${{ format('extractor.{0}.exe', matrix.dotnet-runtime) }}$exeFileExt" + $exeFileNameFinal = "${{ format('extractor.{0}', matrix.dotnet-runtime) }}$exeFileExt" + Rename-Item -Path "$exeFolderPath" -NewName $exeFileNameFinal + echo "EXTRACTOR_FILENAME=$exeFileNameFinal" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append Write-Information "Execution complete." shell: pwsh + env: + EXTRACTOR_FILENAME: - name: Upload artifact uses: actions/upload-artifact@v3 with: - path: ${{ format('{0}/extractor.{1}.exe', runner.temp, matrix.dotnet-runtime) }} + path: ${{ format('{0}/{1}}', runner.temp, $env:EXTRACTOR_FILENAME) }} generate_publisher_artifacts: name: Generate publisher artifacts @@ -82,16 +86,20 @@ jobs: if ($LASTEXITCODE -ne 0) { throw "Generating publisher failed."} $exeFileExt = "${{ matrix.dotnet-runtime }}".Contains("win") ? ".exe" : "" - $exeFolderPath = Join-Path "$outputFolderPath" "publisher" "$exeFileExt" - Rename-Item -Path "$exeFolderPath" -NewName "${{ format('publisher.{0}', matrix.dotnet-runtime) }}$exeFileExt" + $exeFolderPath = Join-Path "$outputFolderPath" "publisher" "$exeFileExt" + $exeFileNameFinal = "${{ format('publisher.{0}', matrix.dotnet-runtime) }}$exeFileExt" + Rename-Item -Path "$exeFolderPath" -NewName $exeFileNameFinal + echo "PUBLISHER_FILENAME=$exeFileNameFinal" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append Write-Information "Execution complete." shell: pwsh - + env: + PUBLISHER_FILENAME: + - name: Upload artifact uses: actions/upload-artifact@v3 with: - path: ${{ format('{0}/publisher.{1}.exe', runner.temp, matrix.dotnet-runtime) }} + path: ${{ format('{0}/{1}}', runner.temp, $env:PUBLISHER_FILENAME) }} generate_github_pipeline_artifacts: name: Generate GitHub artifacts From 55d930e5db1e92464292ca855672251a72c67f18 Mon Sep 17 00:00:00 2001 From: stevevandenbush Date: Mon, 29 Jan 2024 09:30:19 -0600 Subject: [PATCH 3/9] Update create_github_release.yaml --- .github/workflows/create_github_release.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create_github_release.yaml b/.github/workflows/create_github_release.yaml index d6316d8f..fefa7381 100644 --- a/.github/workflows/create_github_release.yaml +++ b/.github/workflows/create_github_release.yaml @@ -53,7 +53,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v3 with: - path: ${{ format('{0}/{1}}', runner.temp, $env:EXTRACTOR_FILENAME) }} + path: ${{ format('{0}/{1}}', runner.temp, env.EXTRACTOR_FILENAME) }} generate_publisher_artifacts: name: Generate publisher artifacts @@ -95,11 +95,11 @@ jobs: shell: pwsh env: PUBLISHER_FILENAME: - + - name: Upload artifact uses: actions/upload-artifact@v3 with: - path: ${{ format('{0}/{1}}', runner.temp, $env:PUBLISHER_FILENAME) }} + path: ${{ format('{0}/{1}}', runner.temp, env.PUBLISHER_FILENAME) }} generate_github_pipeline_artifacts: name: Generate GitHub artifacts From 0ff09e62582d713aeaa4beb43af5aef276043fee Mon Sep 17 00:00:00 2001 From: stevevandenbush Date: Mon, 29 Jan 2024 09:34:08 -0600 Subject: [PATCH 4/9] Update create_github_release.yaml --- .github/workflows/create_github_release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create_github_release.yaml b/.github/workflows/create_github_release.yaml index fefa7381..64848325 100644 --- a/.github/workflows/create_github_release.yaml +++ b/.github/workflows/create_github_release.yaml @@ -40,7 +40,7 @@ jobs: if ($LASTEXITCODE -ne 0) { throw "Generating extractor failed."} $exeFileExt = "${{ matrix.dotnet-runtime }}".Contains("win") ? ".exe" : "" - $exeFolderPath = Join-Path "$outputFolderPath" "extractor" "$exeFileExt" + $exeFolderPath = [IO.Path]::Combine($outputFolderPath, 'extractor', $exeFileExt) $exeFileNameFinal = "${{ format('extractor.{0}', matrix.dotnet-runtime) }}$exeFileExt" Rename-Item -Path "$exeFolderPath" -NewName $exeFileNameFinal echo "EXTRACTOR_FILENAME=$exeFileNameFinal" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append @@ -86,7 +86,7 @@ jobs: if ($LASTEXITCODE -ne 0) { throw "Generating publisher failed."} $exeFileExt = "${{ matrix.dotnet-runtime }}".Contains("win") ? ".exe" : "" - $exeFolderPath = Join-Path "$outputFolderPath" "publisher" "$exeFileExt" + $exeFolderPath = [IO.Path]::Combine($outputFolderPath, 'publisher', $exeFileExt) $exeFileNameFinal = "${{ format('publisher.{0}', matrix.dotnet-runtime) }}$exeFileExt" Rename-Item -Path "$exeFolderPath" -NewName $exeFileNameFinal echo "PUBLISHER_FILENAME=$exeFileNameFinal" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append From ffbd198a2ea52d42e14d122c81f56f71d6dd7175 Mon Sep 17 00:00:00 2001 From: stevevandenbush Date: Mon, 29 Jan 2024 09:35:27 -0600 Subject: [PATCH 5/9] Update create_github_release.yaml --- .github/workflows/create_github_release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create_github_release.yaml b/.github/workflows/create_github_release.yaml index 64848325..d9f7e0b3 100644 --- a/.github/workflows/create_github_release.yaml +++ b/.github/workflows/create_github_release.yaml @@ -53,7 +53,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v3 with: - path: ${{ format('{0}/{1}}', runner.temp, env.EXTRACTOR_FILENAME) }} + path: ${{ format('{0}/{1}', runner.temp, env.EXTRACTOR_FILENAME) }} generate_publisher_artifacts: name: Generate publisher artifacts @@ -99,7 +99,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v3 with: - path: ${{ format('{0}/{1}}', runner.temp, env.PUBLISHER_FILENAME) }} + path: ${{ format('{0}/{1}', runner.temp, env.PUBLISHER_FILENAME) }} generate_github_pipeline_artifacts: name: Generate GitHub artifacts From c7e6eefa4183a88933f9a6252fdc5e56248c39f9 Mon Sep 17 00:00:00 2001 From: stevevandenbush Date: Mon, 29 Jan 2024 09:42:45 -0600 Subject: [PATCH 6/9] Update create_github_release.yaml --- .github/workflows/create_github_release.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create_github_release.yaml b/.github/workflows/create_github_release.yaml index d9f7e0b3..9c71dbd9 100644 --- a/.github/workflows/create_github_release.yaml +++ b/.github/workflows/create_github_release.yaml @@ -41,7 +41,9 @@ jobs: $exeFileExt = "${{ matrix.dotnet-runtime }}".Contains("win") ? ".exe" : "" $exeFolderPath = [IO.Path]::Combine($outputFolderPath, 'extractor', $exeFileExt) - $exeFileNameFinal = "${{ format('extractor.{0}', matrix.dotnet-runtime) }}$exeFileExt" + Write-Information "Current exe location: $exeFolderPath" + $exeFileNameFinal = "${{ format('publisher.{0}', matrix.dotnet-runtime) }}$exeFileExt" + Write-Information "Final file name: $exeFileNameFinal" Rename-Item -Path "$exeFolderPath" -NewName $exeFileNameFinal echo "EXTRACTOR_FILENAME=$exeFileNameFinal" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append @@ -87,7 +89,9 @@ jobs: $exeFileExt = "${{ matrix.dotnet-runtime }}".Contains("win") ? ".exe" : "" $exeFolderPath = [IO.Path]::Combine($outputFolderPath, 'publisher', $exeFileExt) + Write-Information "Current exe location: $exeFolderPath" $exeFileNameFinal = "${{ format('publisher.{0}', matrix.dotnet-runtime) }}$exeFileExt" + Write-Information "Final file name: $exeFileNameFinal" Rename-Item -Path "$exeFolderPath" -NewName $exeFileNameFinal echo "PUBLISHER_FILENAME=$exeFileNameFinal" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append From 905cc92f56e4eeae7dc7ace8a5e463e583cac6a6 Mon Sep 17 00:00:00 2001 From: stevevandenbush Date: Mon, 29 Jan 2024 09:46:51 -0600 Subject: [PATCH 7/9] Update create_github_release.yaml --- .github/workflows/create_github_release.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create_github_release.yaml b/.github/workflows/create_github_release.yaml index 9c71dbd9..7e3fc5be 100644 --- a/.github/workflows/create_github_release.yaml +++ b/.github/workflows/create_github_release.yaml @@ -40,9 +40,9 @@ jobs: if ($LASTEXITCODE -ne 0) { throw "Generating extractor failed."} $exeFileExt = "${{ matrix.dotnet-runtime }}".Contains("win") ? ".exe" : "" - $exeFolderPath = [IO.Path]::Combine($outputFolderPath, 'extractor', $exeFileExt) + $exeFolderPath = Join-Path "$outputFolderPath" "extractor$exeFileExt" Write-Information "Current exe location: $exeFolderPath" - $exeFileNameFinal = "${{ format('publisher.{0}', matrix.dotnet-runtime) }}$exeFileExt" + $exeFileNameFinal = "${{ format('extractor.{0}', matrix.dotnet-runtime) }}$exeFileExt" Write-Information "Final file name: $exeFileNameFinal" Rename-Item -Path "$exeFolderPath" -NewName $exeFileNameFinal echo "EXTRACTOR_FILENAME=$exeFileNameFinal" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append @@ -88,7 +88,7 @@ jobs: if ($LASTEXITCODE -ne 0) { throw "Generating publisher failed."} $exeFileExt = "${{ matrix.dotnet-runtime }}".Contains("win") ? ".exe" : "" - $exeFolderPath = [IO.Path]::Combine($outputFolderPath, 'publisher', $exeFileExt) + $exeFolderPath = Join-Path "$outputFolderPath" "publisher$exeFileExt" Write-Information "Current exe location: $exeFolderPath" $exeFileNameFinal = "${{ format('publisher.{0}', matrix.dotnet-runtime) }}$exeFileExt" Write-Information "Final file name: $exeFileNameFinal" From 24c4521e15912f34a3e2f49f762a4a5d8b7433be Mon Sep 17 00:00:00 2001 From: stevevandenbush Date: Mon, 29 Jan 2024 12:51:26 -0600 Subject: [PATCH 8/9] Update create_github_release.yaml --- .github/workflows/create_github_release.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/create_github_release.yaml b/.github/workflows/create_github_release.yaml index 7e3fc5be..241b7dc8 100644 --- a/.github/workflows/create_github_release.yaml +++ b/.github/workflows/create_github_release.yaml @@ -41,9 +41,7 @@ jobs: $exeFileExt = "${{ matrix.dotnet-runtime }}".Contains("win") ? ".exe" : "" $exeFolderPath = Join-Path "$outputFolderPath" "extractor$exeFileExt" - Write-Information "Current exe location: $exeFolderPath" $exeFileNameFinal = "${{ format('extractor.{0}', matrix.dotnet-runtime) }}$exeFileExt" - Write-Information "Final file name: $exeFileNameFinal" Rename-Item -Path "$exeFolderPath" -NewName $exeFileNameFinal echo "EXTRACTOR_FILENAME=$exeFileNameFinal" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append @@ -89,9 +87,7 @@ jobs: $exeFileExt = "${{ matrix.dotnet-runtime }}".Contains("win") ? ".exe" : "" $exeFolderPath = Join-Path "$outputFolderPath" "publisher$exeFileExt" - Write-Information "Current exe location: $exeFolderPath" $exeFileNameFinal = "${{ format('publisher.{0}', matrix.dotnet-runtime) }}$exeFileExt" - Write-Information "Final file name: $exeFileNameFinal" Rename-Item -Path "$exeFolderPath" -NewName $exeFileNameFinal echo "PUBLISHER_FILENAME=$exeFileNameFinal" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append From 78edbf155632febf07a699347811774edea06132 Mon Sep 17 00:00:00 2001 From: stevevandenbush Date: Wed, 31 Jan 2024 12:36:52 -0600 Subject: [PATCH 9/9] updated gh/azdo workflows --- tools/azdo_pipelines/run-extractor.yaml | 12 ++++- .../run-publisher-with-env.yaml | 13 ++++- tools/github_workflows/run-extractor.yaml | 13 ++++- .../run-publisher-with-env.yaml | 52 ++++++++++++++++--- 4 files changed, 76 insertions(+), 14 deletions(-) diff --git a/tools/azdo_pipelines/run-extractor.yaml b/tools/azdo_pipelines/run-extractor.yaml index a1bac686..524366b4 100644 --- a/tools/azdo_pipelines/run-extractor.yaml +++ b/tools/azdo_pipelines/run-extractor.yaml @@ -92,9 +92,17 @@ stages: $InformationPreference = "Continue" Write-Information "Downloading extractor..." - $extractorFileName = "$(Agent.OS)" -like "*win*" ? "extractor.win-x64.exe" : "extractor.linux-x64.exe" + $extractorFileName = "extractor.linux-x64" + $extractorFinalFileName = "extractor" + if("$(Agent.OS)" -like "*win*"){ + $extractorFileName = "extractor.win-x64.exe" + $extractorFinalFileName = "extractor.exe" + } + else if("$(Agent.OS)" -like "*mac*" && "$(Agent.OSArchitecture)" -like "*arm*"){ + $extractorFileName = "extractor.osx-arm64" + } $uri = "https://github.com/Azure/apiops/releases/download/$(apiops_release_version)/$extractorFileName" - $destinationFilePath = Join-Path "$(Agent.TempDirectory)" "extractor.exe" + $destinationFilePath = Join-Path "$(Agent.TempDirectory)" $extractorFinalFileName Invoke-WebRequest -Uri "$uri" -OutFile "$destinationFilePath" if ("$(Agent.OS)" -like "*linux*") diff --git a/tools/azdo_pipelines/run-publisher-with-env.yaml b/tools/azdo_pipelines/run-publisher-with-env.yaml index 1a29de4d..019cc01f 100644 --- a/tools/azdo_pipelines/run-publisher-with-env.yaml +++ b/tools/azdo_pipelines/run-publisher-with-env.yaml @@ -88,9 +88,18 @@ steps: $InformationPreference = "Continue" Write-Information "Downloading publisher..." - $publisherFileName = "$(Agent.OS)" -like "*win*" ? "publisher.win-x64.exe" : "publisher.linux-x64.exe" + $publisherFileName = "publisher.linux-x64" + $publisherFinalFileName = "publisher" + if("$(Agent.OS)" -like "*win*"){ + $publisherFileName = "publisher.win-x64.exe" + $publisherFinalFileName = "publisher.exe" + } + else if("$(Agent.OS)" -like "*mac*" && "$(Agent.OSArchitecture)" -like "*arm*"){ + $publisherFileName = "publisher.osx-arm64" + } + $uri = "https://github.com/Azure/apiops/releases/download/$(apiops_release_version)/$publisherFileName" - $destinationFilePath = Join-Path "$(Agent.TempDirectory)" "publisher.exe" + $destinationFilePath = Join-Path "$(Agent.TempDirectory)" $publisherFinalFileName Invoke-WebRequest -Uri "$uri" -OutFile "$destinationFilePath" if ("$(Agent.OS)" -like "*linux*") diff --git a/tools/github_workflows/run-extractor.yaml b/tools/github_workflows/run-extractor.yaml index f222854b..a0f64c60 100644 --- a/tools/github_workflows/run-extractor.yaml +++ b/tools/github_workflows/run-extractor.yaml @@ -48,9 +48,18 @@ jobs: $InformationPreference = "Continue" Write-Information "Downloading extractor..." - $extractorFileName = "${{ runner.os }}" -like "*win*" ? "extractor.win-x64.exe" : "extractor.linux-x64.exe" + $extractorFileName = "extractor.linux-x64" + $extractorFinalFileName = "extractor" + if("${{ runner.os }}" -like "*win*"){ + $extractorFileName = "extractor.win-x64.exe" + $extractorFinalFileName = "extractor.exe" + } + else if("${{ runner.os }}" -like "*mac*" && "${{ runner.arch }}" -like "*arm*"){ + $extractorFileName = "extractor.osx-arm64" + } + $uri = "https://github.com/Azure/apiops/releases/download/${{ env.apiops_release_version }}/$extractorFileName" - $destinationFilePath = Join-Path "${{ runner.temp }}" "extractor.exe" + $destinationFilePath = Join-Path "${{ runner.temp }}" $extractorFinalFileName Invoke-WebRequest -Uri "$uri" -OutFile "$destinationFilePath" if ("${{ runner.os }}" -like "*linux*") diff --git a/tools/github_workflows/run-publisher-with-env.yaml b/tools/github_workflows/run-publisher-with-env.yaml index c6c2423f..622443a4 100644 --- a/tools/github_workflows/run-publisher-with-env.yaml +++ b/tools/github_workflows/run-publisher-with-env.yaml @@ -69,9 +69,18 @@ jobs: $InformationPreference = "Continue" Write-Information "Downloading publisher..." - $publisherFileName = "${{ runner.os }}" -like "*win*" ? "publisher.win-x64.exe" : "publisher.linux-x64.exe" + $publisherFileName = "publisher.linux-x64" + $publisherFinalFileName = "publisher" + if("${{ runner.os }}" -like "*win*"){ + $publisherFileName = "publisher.win-x64.exe" + $publisherFinalFileName = "publisher.exe" + } + else if("${{ runner.os }}" -like "*mac*" && "${{ runner.arch }}" -like "*arm*"){ + $publisherFileName = "publisher.osx-arm64" + } + $uri = "https://github.com/Azure/apiops/releases/download/${{ env.apiops_release_version }}/$publisherFileName" - $destinationFilePath = Join-Path "${{ runner.temp }}" "publisher.exe" + $destinationFilePath = Join-Path "${{ runner.temp }}" $publisherFinalFileName Invoke-WebRequest -Uri "$uri" -OutFile "$destinationFilePath" if ("${{ runner.os }}" -like "*linux*") @@ -104,9 +113,18 @@ jobs: $InformationPreference = "Continue" Write-Information "Downloading publisher..." - $publisherFileName = "${{ runner.os }}" -like "*win*" ? "publisher.win-x64.exe" : "publisher.linux-x64.exe" + $publisherFileName = "publisher.linux-x64" + $publisherFinalFileName = "publisher" + if("${{ runner.os }}" -like "*win*"){ + $publisherFileName = "publisher.win-x64.exe" + $publisherFinalFileName = "publisher.exe" + } + else if("${{ runner.os }}" -like "*mac*" && "${{ runner.arch }}" -like "*arm*"){ + $publisherFileName = "publisher.osx-arm64" + } + $uri = "https://github.com/Azure/apiops/releases/download/${{ env.apiops_release_version }}/$publisherFileName" - $destinationFilePath = Join-Path "${{ runner.temp }}" "publisher.exe" + $destinationFilePath = Join-Path "${{ runner.temp }}" $publisherFinalFileName Invoke-WebRequest -Uri "$uri" -OutFile "$destinationFilePath" if ("${{ runner.os }}" -like "*linux*") @@ -141,9 +159,18 @@ jobs: $InformationPreference = "Continue" Write-Information "Downloading publisher..." - $publisherFileName = "${{ runner.os }}" -like "*win*" ? "publisher.win-x64.exe" : "publisher.linux-x64.exe" + $publisherFileName = "publisher.linux-x64" + $publisherFinalFileName = "publisher" + if("${{ runner.os }}" -like "*win*"){ + $publisherFileName = "publisher.win-x64.exe" + $publisherFinalFileName = "publisher.exe" + } + else if("${{ runner.os }}" -like "*mac*" && "${{ runner.arch }}" -like "*arm*"){ + $publisherFileName = "publisher.osx-arm64" + } + $uri = "https://github.com/Azure/apiops/releases/download/${{ env.apiops_release_version }}/$publisherFileName" - $destinationFilePath = Join-Path "${{ runner.temp }}" "publisher.exe" + $destinationFilePath = Join-Path "${{ runner.temp }}" $publisherFinalFileName Invoke-WebRequest -Uri "$uri" -OutFile "$destinationFilePath" if ("${{ runner.os }}" -like "*linux*") @@ -177,9 +204,18 @@ jobs: $InformationPreference = "Continue" Write-Information "Downloading publisher..." - $publisherFileName = "${{ runner.os }}" -like "*win*" ? "publisher.win-x64.exe" : "publisher.linux-x64.exe" + $publisherFileName = "publisher.linux-x64" + $publisherFinalFileName = "publisher" + if("${{ runner.os }}" -like "*win*"){ + $publisherFileName = "publisher.win-x64.exe" + $publisherFinalFileName = "publisher.exe" + } + else if("${{ runner.os }}" -like "*mac*" && "${{ runner.arch }}" -like "*arm*"){ + $publisherFileName = "publisher.osx-arm64" + } + $uri = "https://github.com/Azure/apiops/releases/download/${{ env.apiops_release_version }}/$publisherFileName" - $destinationFilePath = Join-Path "${{ runner.temp }}" "publisher.exe" + $destinationFilePath = Join-Path "${{ runner.temp }}" $publisherFinalFileName Invoke-WebRequest -Uri "$uri" -OutFile "$destinationFilePath" if ("${{ runner.os }}" -like "*linux*")