1010 build :
1111 name : Build
1212 env :
13- NUPKG_MAJOR : 3.1
14- runs-on : windows-latest
13+ BASE_VERSION : 2.9.99
14+
15+ runs-on : windows-2019
1516 steps :
1617 - name : Checkout
1718 uses : actions/checkout@v2
2122 run : msbuild /r /t:Build /p:Configuration=Release .\ZXing.Net.Mobile.sln
2223 - name : Package NuGets
2324 run : |
24- $pkgVer = ($env:NUPKG_MAJOR + "-alpha" + $env:GITHUB_RUN_ID)
25- if ($env:GITHUB_EVENT_NAME -eq "release") {
26- $pkgVer = $env:GITHUB_REF.Substring($env:GITHUB_REF.LastIndexOf('/') + 1)
27- }
25+ git clone https://github.com/nblockchain/fsx
26+ $pkgVer = `.\fsx\Tools\fsi.bat fsx\Tools\nugetPush.fsx --output-version $env:BASE_VERSION`
27+
2828 New-Item -ItemType Directory -Force -Path .\artifacts
2929 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
3030 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
@@ -37,25 +37,20 @@ jobs:
3737 publish-nuget :
3838 name : Publish NuGet Packages
3939 needs : build
40- runs-on : windows-latest
41- if : github.ref == 'refs/heads/master' && (github.event_name == 'push' || github.event_name == 'release' )
40+ runs-on : windows-2019
41+ if : github.ref == 'refs/heads/master' && (github.event_name == 'push')
4242 steps :
4343 - name : Download Artifacts
4444 uses : actions/download-artifact@v1
4545 with :
4646 name : NuGet
47- - name : Setup NuGet
48- uses : nuget/setup-nuget@v1
49- with :
50- nuget-api-key : ${{ secrets.NUGET_API_KEY }}
51- nuget-version : ' latest'
5247 - name : Push to GitHub Packages
5348 run : |
5449 nuget sources add -Name "GPR" -Source "https://nuget.pkg.github.com/Redth/index.json" -UserName Redth -Password ${{ secrets.GITHUB_TOKEN }}
5550 nuget setApiKey ${{ secrets.NUGET_API_KEY }} --source "GPR" --skip-duplicate
5651 nuget push NuGet\*.nupkg -Source "GPR"
5752 - name : Push to NuGet.org
58- if : github.event_name == 'release'
5953 run : |
60- nuget push NuGet\*.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey ${{ secrets.NUGET_ORG_API_KEY }}
54+ git clone https://github.com/nblockchain/fsx
55+ .\fsx\Tools\fsi.bat fsx\Tools\nugetPush.fsx ${{secrets.NUGET_API_KEY}}
6156
0 commit comments