Merge pull request #220 from wowtrack/main #85
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: build | |
on: push | |
env: | |
DOTNET_NOLOGO: 1 # Disable the .NET welcome message | |
DOTNET_CLI_TELEMETRY_OPTOUT: 1 # Opt out of the .NET SDK telemetry feature | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 | |
with: | |
fetch-depth: 0 # avoid shallow clone so nbgv can do its work. | |
- name: Install .NET 7 SDK | |
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3 | |
with: | |
dotnet-version: 7.0.103 | |
- name: Build | |
run: dotnet build --configuration Release --verbosity minimal | |
- name: Test | |
run: dotnet test --no-build --configuration Release --verbosity minimal | |
env: | |
BLIZZARD_CLIENT_ID: ${{ secrets.BLIZZARD_CLIENT_ID }} | |
BLIZZARD_CLIENT_SECRET: ${{ secrets.BLIZZARD_CLIENT_SECRET }} | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 | |
with: | |
name: NuGet packages | |
path: | | |
artifacts/*.nupkg | |
artifacts/*.snupkg | |
- name: Push NuGet packages to NuGet | |
if: ${{ startsWith(github.ref, 'refs/tags/v') }} # Only for a tag | |
run: dotnet nuget push "artifacts/**.nupkg" --skip-duplicate --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json | |
- name: Create GitHub Release | |
if: ${{ startsWith(github.ref, 'refs/tags/v') }} # Only for a tag | |
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false |