Skip to content

Commit

Permalink
Add pack and publish
Browse files Browse the repository at this point in the history
  • Loading branch information
wherewhere committed Sep 27, 2023
1 parent 5041ae7 commit 4230739
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 16 deletions.
54 changes: 39 additions & 15 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,57 @@
name: build and test

on: [push, pull_request]
on:
push:
branches:
- winrt
pull_request:
branches:
- winrt
workflow_dispatch:

env:
DOTNET_VERSION: '6.0.x' # The .NET SDK version to use
DOTNET_VERSION: '8.0.x' # The .NET SDK version to use

jobs:
build-and-test:

name: build-and-test
build-and-pack:
name: build-and-pack
runs-on: windows-latest

env:
Solution_Name: AdvancedSharpAdbClient.WinRT\AdvancedSharpAdbClient.WinRT.csproj
Nuget_Source: https://nuget.pkg.github.com/yungd1plomat
Solution_Name: AdvancedSharpAdbClient.WinRT/AdvancedSharpAdbClient.WinRT.csproj

steps:
- uses: actions/checkout@v3
- name: Setup .NET Core
- 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-version: ${{ env.DOTNET_VERSION }}
dotnet-quality: 'preview'

- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1
with:
msbuild-architecture: x64

- name: Install dependencies
run: msbuild $env:Solution_Name /t:Restore

- name: Build
run: msbuild $env:Solution_Name
- 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/**
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<PublishRepositoryUrl>True</PublishRepositoryUrl>
<RepositoryUrl>https://github.com/yungd1plomat/AdvancedSharpAdbClient/tree/winrt</RepositoryUrl>
<Title>.NET client for adb, Android Debug Bridge (AdvancedSharpAdbClient)</Title>
<VersionPrefix>0.0.1</VersionPrefix>
<VersionPrefix>0.0.0</VersionPrefix>
</PropertyGroup>

<PropertyGroup>
Expand Down

0 comments on commit 4230739

Please sign in to comment.