From 3dadd6db2b1071d162d390613ff52c3309b947cf Mon Sep 17 00:00:00 2001 From: coldsofttech Date: Thu, 11 Apr 2024 08:21:47 +0100 Subject: [PATCH] Updated Pipeline To Support Multi-OS --- .github/workflows/pipeline.yml | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 0b2a134..8a41826 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -97,22 +97,21 @@ jobs: run: | python setup.py sdist - - name: Get Package Name + - name: Get Package Name (Windows) + if: matrix.os == 'windows-latest' run: | - if [ ${{ matrix.os }} == "windows-latest" ]; then - $path_separator = "\\" - $latestFile = Get-ChildItem -Path "dist\\" | Sort-Object LastWriteTime -Descending | Select-Object -First 1 - Write-Host "Latest file: $latestFile" - Write-Output "PACKAGE_NAME=dist$path_separator$($latestFile.Name)" | Out-File -FilePath $env:GITHUB_ENV -Append - else - if [ ${{ matrix.os }} == "ubuntu-latest" ] || [ ${{ matrix.os }} == "macos-latest" ]; then - path_separator="/" - latestFile=$(ls -t dist/ | head -n 1) - echo "Latest file: $latestFile" - echo "PACKAGE_NAME=dist$path_separator$latestFile" >> $GITHUB_ENV - fi - fi - shell: bash + $path_separator = "\\" + $latestFile = Get-ChildItem -Path "dist\\" | Sort-Object LastWriteTime -Descending | Select-Object -First 1 + Write-Host "Latest file: $latestFile" + Write-Output "PACKAGE_NAME=dist$path_separator$($latestFile.Name)" | Out-File -FilePath $env:GITHUB_ENV -Append + + - name: Get Package Name (Ubuntu and macOS) + if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' + run: | + path_separator="/" + latestFile=$(ls -t dist/ | head -n 1) + echo "Latest file: $latestFile" + echo "PACKAGE_NAME=dist$path_separator$latestFile" >> $GITHUB_ENV - name: Install Package run: |