Skip to content

Deploy iOS from windows #1

Deploy iOS from windows

Deploy iOS from windows #1

Workflow file for this run

name: Build
on:
pull_request:
push:
release:
types: [published,prereleased]
jobs:
build:
name: Build
env:
NUPKG_MAJOR: 3.1
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.0.2
- name: Build
run: msbuild /r /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)
}
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
- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: NuGet
path: .\artifacts
publish-nuget:
name: Publish NuGet Packages
needs: build
runs-on: windows-latest
if: github.ref == 'refs/heads/master' && (github.event_name == 'push' || 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 to GitHub Packages
run: |
nuget sources add -Name "GPR" -Source "https://nuget.pkg.github.com/Redth/index.json" -UserName Redth -Password ${{ secrets.GITHUB_TOKEN }}
nuget setApiKey ${{ secrets.NUGET_API_KEY }} --source "GPR" --skip-duplicate
nuget push NuGet\*.nupkg -Source "GPR"
- name: Push to NuGet.org
if: github.event_name == 'release'
run: |
nuget push NuGet\*.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey ${{ secrets.NUGET_ORG_API_KEY }}