Skip to content

Commit

Permalink
CI: setup nuget asset upload for the fork
Browse files Browse the repository at this point in the history
  • Loading branch information
knocte committed Sep 16, 2020
1 parent a51cf40 commit 77fa778
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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}}

0 comments on commit 77fa778

Please sign in to comment.