From 6ac5e5d4de04aeb46c04f737b01e3522d9e18d11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tiago=20Concei=C3=A7=C3=A3o?= Date: Mon, 21 Mar 2022 03:49:39 +0000 Subject: [PATCH] Update package-publish.yml --- .github/workflows/package-publish.yml | 58 ++++++++++++++------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/.github/workflows/package-publish.yml b/.github/workflows/package-publish.yml index db2f6ed..1bf820b 100644 --- a/.github/workflows/package-publish.yml +++ b/.github/workflows/package-publish.yml @@ -9,37 +9,39 @@ jobs: winget: name: Winget - Pull request runs-on: windows-latest + timeout-minutes: 10 steps: - - name: Submit package to Windows Package Manager Community Repository - run: | - iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe - $installerUrl = $github.event.release.assets | Where-Object -Property name -match '.+win-x64.+\.msi' | Select -ExpandProperty browser_download_url -First 1 - if($null -eq $installerUrl){ exit 1 } - $version = $github.event.release.tag_name.Replace('v', '') - if($version.Length -lt 5){ exit 2 } - .\wingetcreate.exe update PTRTECH.UVtools --version $version --urls $installerUrl --token ${WINGET_TOKEN} --submit - env: - WINGET_TOKEN: ${{ secrets.WINGET_TOKEN }} + - name: Submit package to Windows Package Manager Community Repository + run: | + iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe + $installerUrl = $github.event.release.assets | Where-Object -Property name -match '.+win-x64.+\.msi' | Select -ExpandProperty browser_download_url -First 1 + if($null -eq $installerUrl){ exit 1 } + $version = $github.event.release.tag_name.Replace('v', '') + if($version.Length -lt 5){ exit 2 } + .\wingetcreate.exe update PTRTECH.UVtools --version $version --urls $installerUrl --token ${WINGET_TOKEN} --submit + env: + WINGET_TOKEN: ${{ secrets.WINGET_TOKEN }} nuget: name: Nuget - Publish package runs-on: ubuntu-latest + timeout-minutes: 15 steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Verify commit exists in origin/main - run: | - git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* - git branch --remote --contains | grep origin/main - - name: Set VERSION variable from tag - run: | - echo "VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV - echo "VERSION=${VERSION:1}" >> $GITHUB_ENV - - name: Build - run: dotnet build --configuration Release - - name: Pack - run: dotnet pack UVtools.Core --configuration Release --no-build --output . - - name: Push nuget.org - run: dotnet nuget push UVtools.Core.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_TOKEN} - env: - NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} + - name: Checkout + uses: actions/checkout@v2 + - name: Verify commit exists in origin/main + run: | + git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* + git branch --remote --contains | grep origin/main + - name: Set VERSION variable from tag + run: | + echo "VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV + echo "VERSION=${VERSION:1}" >> $GITHUB_ENV + - name: Build + run: dotnet build --configuration Release + - name: Pack + run: dotnet pack UVtools.Core --configuration Release --no-build --output . + - name: Push nuget.org + run: dotnet nuget push UVtools.Core.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_TOKEN} + env: + NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}