Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 44 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ env:

jobs:
build-and-test:

name: build-and-test-${{matrix.os}}
runs-on: ${{matrix.os}}
strategy:
Expand All @@ -22,10 +21,51 @@ jobs:
dotnet-version: ${{env.DOTNET_VERSION}}

- name: Install dependencies
run: dotnet restore -p:FullTargets=false
run: dotnet restore -p:FullTargets=False

- name: Build
run: dotnet build --no-restore -p:FullTargets=false
run: dotnet build --no-restore -p:FullTargets=False

- name: Test
run: dotnet test --no-restore -p:FullTargets=false
run: dotnet test --no-restore -p:FullTargets=False

build-and-publish:
name: build-and-publish
runs-on: ubuntu-latest
needs: build-and-test
if: github.ref == 'refs/heads/main'
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v3
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{env.DOTNET_VERSION}}

- name: Install dependencies
run: dotnet restore -p:FullTargets=True

- name: Build
run: dotnet build --no-restore -c Release -p:FullTargets=True

- name: Pack
run: dotnet pack -c Release --no-build

- name: Publish
run: dotnet nuget push ./AdvancedSharpAdbClient/bin/Release/*.nupkg --source "github" --skip-duplicate --api-key ${{ secrets.GITHUB_TOKEN }}

- name: Get version
id: get_version
shell: pwsh
run: |
$version=(Select-Xml -Path ./Directory.Build.props -XPath 'Project/PropertyGroup/VersionPrefix').Node.InnerText
echo "version=$version" >> $env:GITHUB_OUTPUT

- name: Upload
uses: actions/upload-artifact@v3
with:
name: v${{ steps.get_version.outputs.version }}
path: ./AdvancedSharpAdbClient/bin/Release/
8 changes: 8 additions & 0 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="github" value="https://nuget.pkg.github.com/yungd1plomat/index.json" />
</packageSources>
</configuration>