10
10
build :
11
11
name : Build
12
12
env :
13
- NUPKG_MAJOR : 3.1
14
- runs-on : windows-latest
13
+ BASE_VERSION : 2.9.99
14
+
15
+ runs-on : windows-2019
15
16
steps :
16
17
- name : Checkout
17
18
uses : actions/checkout@v2
21
22
run : msbuild /r /t:Build /p:Configuration=Release .\ZXing.Net.Mobile.sln
22
23
- name : Package NuGets
23
24
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
+
28
28
New-Item -ItemType Directory -Force -Path .\artifacts
29
29
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
30
30
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:
37
37
publish-nuget :
38
38
name : Publish NuGet Packages
39
39
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')
42
42
steps :
43
43
- name : Download Artifacts
44
44
uses : actions/download-artifact@v1
45
45
with :
46
46
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'
52
47
- name : Push to GitHub Packages
53
48
run : |
54
49
nuget sources add -Name "GPR" -Source "https://nuget.pkg.github.com/Redth/index.json" -UserName Redth -Password ${{ secrets.GITHUB_TOKEN }}
55
50
nuget setApiKey ${{ secrets.NUGET_API_KEY }} --source "GPR" --skip-duplicate
56
51
nuget push NuGet\*.nupkg -Source "GPR"
57
52
- name : Push to NuGet.org
58
- if : github.event_name == 'release'
59
53
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}}
61
56
0 commit comments