-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (47 loc) · 1.48 KB
/
build-and-test.yml
File metadata and controls
58 lines (47 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: build and test
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
env:
DOTNET_VERSION: '9.0.x' # The .NET SDK version to use
jobs:
build-and-pack:
name: build-and-pack
runs-on: windows-latest
env:
Solution_Name: AdvancedSharpAdbClient.WinRT/AdvancedSharpAdbClient.WinRT.csproj
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET Core App
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64
- name: Setup NuGet.exe
uses: NuGet/setup-nuget@v2
- 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 == 'main' }}
run: dotnet nuget push nugets/**.nupkg --source $env:NUGET_SOURCE --skip-duplicate --api-key $env:GITHUB_TOKEN
env:
NUGET_SOURCE: https://nuget.pkg.github.com/SharpAdb/index.json
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Nuget Package
path: nugets/**