Skip to content

Commit 4230739

Browse files
committed
Add pack and publish
1 parent 5041ae7 commit 4230739

File tree

2 files changed

+40
-16
lines changed

2 files changed

+40
-16
lines changed
Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,57 @@
11
name: build and test
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- winrt
7+
pull_request:
8+
branches:
9+
- winrt
10+
workflow_dispatch:
411

512
env:
6-
DOTNET_VERSION: '6.0.x' # The .NET SDK version to use
13+
DOTNET_VERSION: '8.0.x' # The .NET SDK version to use
714

815
jobs:
9-
build-and-test:
10-
11-
name: build-and-test
16+
build-and-pack:
17+
name: build-and-pack
1218
runs-on: windows-latest
13-
1419
env:
15-
Solution_Name: AdvancedSharpAdbClient.WinRT\AdvancedSharpAdbClient.WinRT.csproj
20+
Nuget_Source: https://nuget.pkg.github.com/yungd1plomat
21+
Solution_Name: AdvancedSharpAdbClient.WinRT/AdvancedSharpAdbClient.WinRT.csproj
1622

1723
steps:
18-
- uses: actions/checkout@v3
19-
- name: Setup .NET Core
24+
- name: Checkout
25+
uses: actions/checkout@v3
26+
with:
27+
fetch-depth: 0
28+
29+
- name: Setup .NET Core App
2030
uses: actions/setup-dotnet@v3
2131
with:
22-
dotnet-version: ${{env.DOTNET_VERSION}}
32+
dotnet-version: ${{ env.DOTNET_VERSION }}
33+
dotnet-quality: 'preview'
2334

2435
- name: Setup MSBuild.exe
2536
uses: microsoft/setup-msbuild@v1
2637
with:
2738
msbuild-architecture: x64
2839

29-
- name: Install dependencies
30-
run: msbuild $env:Solution_Name /t:Restore
31-
32-
- name: Build
33-
run: msbuild $env:Solution_Name
40+
- name: Setup NuGet.exe
41+
uses: NuGet/setup-nuget@v1
42+
43+
- name: Install Dependencies
44+
run: nuget restore $env:Solution_Name
45+
46+
- name: Build & Pack
47+
run: msbuild $env:Solution_Name /t:Pack /p:Configuration=Release /p:PackageOutputPath=../nugets /p:VersionSuffix=build.${{ github.run_number }}.${{ github.run_attempt }}
48+
49+
- name: Publish
50+
if: ${{ github.event_name == 'push' && github.ref_name == 'winrt' }}
51+
run: dotnet nuget push nugets/**.nupkg --source "$env:Nuget_Source" --skip-duplicate --api-key ${{ secrets.NUGET_KEY }}
52+
53+
- name: Upload
54+
uses: actions/upload-artifact@v3
55+
with:
56+
name: Nuget Package
57+
path: nugets/**

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<PublishRepositoryUrl>True</PublishRepositoryUrl>
2323
<RepositoryUrl>https://github.com/yungd1plomat/AdvancedSharpAdbClient/tree/winrt</RepositoryUrl>
2424
<Title>.NET client for adb, Android Debug Bridge (AdvancedSharpAdbClient)</Title>
25-
<VersionPrefix>0.0.1</VersionPrefix>
25+
<VersionPrefix>0.0.0</VersionPrefix>
2626
</PropertyGroup>
2727

2828
<PropertyGroup>

0 commit comments

Comments
 (0)