-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de4e59a
commit 2872880
Showing
3 changed files
with
73 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,41 @@ | ||
name: NuGet Push | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_run: | ||
workflows: [Tests] | ||
types: | ||
- completed | ||
|
||
defaults: | ||
run: | ||
working-directory: src | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 8.0.x | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore ./src | ||
|
||
- name: Build | ||
run: dotnet build ./src --no-restore --configuration Release | ||
|
||
- name: Pack NuGet Package(s) | ||
run: dotnet pack ./src --no-restore --no-build --configuration Release --output ./nuget-packages | ||
|
||
- name: Upload Build Artifact(s) | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: nuget-packages | ||
path: ./nuget-packages | ||
|
||
- name: Push NuGet Package(s) | ||
run: dotnet nuget push ./nuget-packages/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate | ||
env: | ||
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | ||
- uses: actions/checkout@v4 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: | | ||
8.0.x | ||
9.0.x | ||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Build | ||
run: dotnet build --no-restore --configuration Release | ||
|
||
- name: Pack NuGet Package(s) | ||
run: dotnet pack --no-restore --no-build --configuration Release --output ~/nuget-packages | ||
|
||
- name: Upload Build Artifact(s) | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: nuget-packages | ||
path: ~/nuget-packages | ||
|
||
- name: Push NuGet Package(s) | ||
run: dotnet nuget push ~/nuget-packages/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
defaults: | ||
run: | ||
working-directory: src | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
dotnet: [ '8.0.x', '9.0.x' ] | ||
name: .NET ${{ matrix.dotnet }} Test | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup dotnet | ||
uses: actions/setup-dotnet@v4 | ||
id: stepid | ||
with: | ||
dotnet-version: ${{ matrix.dotnet }} | ||
|
||
- name: Create temporary global.json | ||
run: echo '{"sdk":{"version":"${{ steps.stepid.outputs.dotnet-version }}"}}' > ./global.json | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Build | ||
run: dotnet build --no-restore --configuration Release | ||
|
||
- name: Run Tests | ||
run: dotnet test --no-build --configuration Release --verbosity normal |