System.Graphics/.github/workflows/push-release-github-package...

136 строки
4.6 KiB
YAML

name: Build and Release to GitHub Packages
on:
push:
branches: [ release/github-packages ]
jobs:
build-on-windows:
runs-on: windows-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Install NuGet
uses: nuget/setup-nuget@v1
with:
nuget-version: '5.x'
- name: NuGet Restore
run: nuget restore build/Build.Microsoft.Maui.Graphics.Windows.sln
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
# - name: Update project version
# uses: roryprimrose/set-vs-sdk-project-version@v1
# with:
# projectFilter: 'src/*/*.csproj'
# version: '0.1.${{ github.run_number }}'
- name: Build
run: msbuild build/Build.Microsoft.Maui.Graphics.Windows.sln /verbosity:normal /t:Rebuild /p:Configuration=Release
- name: NuGet Pack
run: nuget pack build/JonLipsky.Microsoft.Maui.Graphics.GDI.Winforms.nuspec -Version 0.1.${{ github.run_number }} -OutputDirectory . -BasePath .
- name: NuGet Pack
run: nuget pack build/JonLipsky.Microsoft.Maui.Graphics.SharpDX.UWP.nuspec -Version 0.1.${{ github.run_number }} -OutputDirectory . -BasePath .
- name: NuGet Pack
run: nuget pack build/JonLipsky.Microsoft.Maui.Graphics.SharpDX.UWP.nuspec -Version 0.1.${{ github.run_number }} -OutputDirectory . -BasePath .
- name: NuGet Pack
run: nuget pack build/JonLipsky.Microsoft.Maui.Graphics.Skia.WPF.nuspec -Version 0.1.${{ github.run_number }} -OutputDirectory . -BasePath .
- name: NuGet Pack
run: nuget pack build/JonLipsky.Microsoft.Maui.Graphics.Text.WPF.nuspec -Version 0.1.${{ github.run_number }} -OutputDirectory . -BasePath .
- name: NuGet Pack
run: nuget pack build/JonLipsky.Microsoft.Maui.Graphics.Win2D.UWP.nuspec -Version 0.1.${{ github.run_number }} -OutputDirectory . -BasePath .
- name: NuGet Pack
run: nuget pack build/JonLipsky.Microsoft.Maui.Graphics.Xaml.UWP.nuspec -Version 0.1.${{ github.run_number }} -OutputDirectory . -BasePath .
- name: NuGet Pack
run: nuget pack build/JonLipsky.Microsoft.Maui.Graphics.Xaml.WPF.nuspec -Version 0.1.${{ github.run_number }} -OutputDirectory . -BasePath .
- name: 'Upload Artifacts'
uses: actions/upload-artifact@v2
with:
name: windows-artifacts
path: "*.nupkg"
build-on-mac:
runs-on: macos-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Install NuGet
uses: nuget/setup-nuget@v1
with:
nuget-version: '5.x'
- name: Update project version
uses: roryprimrose/set-vs-sdk-project-version@v1
with:
projectFilter: 'src/*/*.csproj'
version: '0.1.${{ github.run_number }}'
- name: NuGet Restore
run: nuget restore build/Build.Microsoft.Maui.Graphics.Mac.sln
- name: Build
run: msbuild build/Build.Microsoft.Maui.Graphics.Mac.sln /verbosity:normal /t:Rebuild /p:Configuration=Release
- name: NuGet Pack
run: nuget pack build/JonLipsky.Microsoft.Maui.Graphics.nuspec -Version 0.1.${{ github.run_number }} -OutputDirectory . -BasePath .
- name: NuGet Pack
run: nuget pack build/JonLipsky.Microsoft.Maui.Graphics.Skia.nuspec -Version 0.1.${{ github.run_number }} -OutputDirectory . -BasePath .
- name: NuGet Pack
run: nuget pack build/JonLipsky.Microsoft.Maui.Graphics.Forms.nuspec -Version 0.1.${{ github.run_number }} -OutputDirectory . -BasePath .
- name: NuGet Pack
run: nuget pack build/JonLipsky.Microsoft.Maui.Graphics.Skia.Forms.nuspec -Version 0.1.${{ github.run_number }} -OutputDirectory . -BasePath .
- name: NuGet Pack
run: nuget pack build/JonLipsky.Microsoft.Maui.Graphics.Text.Markdig.nuspec -Version 0.1.${{ github.run_number }} -OutputDirectory . -BasePath .
- name: 'Upload Artifacts'
uses: actions/upload-artifact@v2
with:
name: mac-artifacts
path: "*.nupkg"
release:
needs: [build-on-mac, build-on-windows]
runs-on: ubuntu-latest
steps:
- name: Download Mac Artifacts
uses: actions/download-artifact@v2
with:
name: mac-artifacts
- name: Download Windows Artifacts
uses: actions/download-artifact@v2
with:
name: windows-artifacts
- name: Install GPR
run: dotnet tool install -g gpr --no-cache -v q
- name: Publish package to GitHub registry
run: gpr push *.nupkg --api-key ${{ secrets.PACKAGES_TOKEN }}
working-directory: .
- name: Publish package to NuGet
run: dotnet nuget push "*.nupkg" --api-key ${{secrets.NUGET_API_KEY}} --skip-duplicate --source https://api.nuget.org/v3/index.json
working-directory: .