From 77fa7787444c24358a754ef42681306a06f96a48 Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Thu, 17 Sep 2020 01:27:30 +0800 Subject: [PATCH] CI: setup nuget asset upload for the fork --- .github/workflows/build.yml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d295551c7..7cef736f8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: build: name: Build env: - NUPKG_MAJOR: 3.0 + BASE_VERSION: 2.9.9 runs-on: windows-latest steps: - name: Checkout @@ -23,10 +23,8 @@ jobs: run: msbuild /t:Build /p:Configuration=Release .\ZXing.Net.Mobile.sln - name: Package NuGets run: | - $pkgVer = ($env:NUPKG_MAJOR + "-alpha" + $env:GITHUB_RUN_ID) - if ($env:GITHUB_EVENT_NAME -eq "release") { - $pkgVer = $env:GITHUB_REF.Substring($env:GITHUB_REF.LastIndexOf('/') + 1) - } + git clone https://github.com/nblockchain/fsx + $pkgVer = `.\fsx\Tools\fsi.bat fsx\Tools\nugetPush.fsx --output-version $env:BASE_VERSION` New-Item -ItemType Directory -Force -Path .\artifacts msbuild /t:Pack /p:Configuration=Release /p:PackageOutputPath=..\artifacts /p:PackageVersion=$pkgVer /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg .\ZXing.Net.Mobile\ZXing.Net.Mobile.csproj msbuild /t:Pack /p:Configuration=Release /p:PackageOutputPath=..\artifacts /p:PackageVersion=$pkgVer /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg .\ZXing.Net.Mobile.Forms\ZXing.Net.Mobile.Forms.csproj @@ -40,17 +38,12 @@ jobs: name: Publish to NuGet.org needs: build runs-on: windows-latest - if: github.event_name == 'release' steps: - name: Download Artifacts uses: actions/download-artifact@v1 with: name: NuGet - - name: Setup NuGet - uses: nuget/setup-nuget@v1 - with: - nuget-api-key: ${{ secrets.NUGET_API_KEY }} - nuget-version: 'latest' - name: Push NuGet run: | - nuget push NuGet\*.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey ${{ secrets.NUGET_ORG_API_KEY }} + git clone https://github.com/nblockchain/fsx + .\fsx\Tools\fsi.bat fsx\Tools\nugetPush.fsx ${{secrets.NUGET_API_KEY}}