Merge pull request #10 from yoyos/main #29
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
name: DotNet | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
release: | |
types: [published] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
name: Test | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-nuget- | |
- name: Setup .NET 7 | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '7.0.x' | |
- name: Setup .NET 6 | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '6.0.x' | |
- run: dotnet tool install -g GitVersion.Tool | |
- name: GitVersion | |
run: dotnet gitversion /l console /output buildserver | |
- run: ./build.ps1 | |
shell: pwsh | |
- run: ./test.ps1 | |
shell: pwsh | |
# - name: Push NuGet | |
# if: | | |
# startsWith(github.event.ref, 'refs/tags/') | |
# || endsWith(github.event.ref, '/main') | |
# || github.event.action == 'published' | |
# shell: pwsh | |
# run: dotnet nuget push **/*.nupkg --source $Env:SOURCE --api-key $Env:TOKEN --skip-duplicate | |
# env: | |
# SOURCE: 'https://api.nuget.org/v3/index.json' | |
# TOKEN: ${{ secrets.NUGET_API_KEY }}s |