Skip to content

Add pack and publish #1

Add pack and publish

Add pack and publish #1

Workflow file for this run

name: build and test
on:
push:
branches:
- winrt
pull_request:
branches:
- winrt
workflow_dispatch:
env:
DOTNET_VERSION: '8.0.x' # The .NET SDK version to use
jobs:
build-and-pack:
name: build-and-pack
runs-on: windows-latest
env:
Nuget_Source: https://nuget.pkg.github.com/yungd1plomat
Solution_Name: AdvancedSharpAdbClient.WinRT/AdvancedSharpAdbClient.WinRT.csproj
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET Core App
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
dotnet-quality: 'preview'
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1
with:
msbuild-architecture: x64
- name: Setup NuGet.exe
uses: NuGet/setup-nuget@v1
- name: Install Dependencies
run: nuget restore $env:Solution_Name
- name: Build & Pack
run: msbuild $env:Solution_Name /t:Pack /p:Configuration=Release /p:PackageOutputPath=../nugets /p:VersionSuffix=build.${{ github.run_number }}.${{ github.run_attempt }}
- name: Publish
if: ${{ github.event_name == 'push' && github.ref_name == 'winrt' }}
run: dotnet nuget push nugets/**.nupkg --source "$env:Nuget_Source" --skip-duplicate --api-key ${{ secrets.NUGET_KEY }}
- name: Upload
uses: actions/upload-artifact@v3
with:
name: Nuget Package
path: nugets/**