-
Notifications
You must be signed in to change notification settings - Fork 17
49 lines (40 loc) · 1.69 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: Install .NET 8 SDK
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0
with:
dotnet-version: 8.0.204
- 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@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: NuGet packages
path: |
artifacts/package/release/*.nupkg
artifacts/package/release/*.snupkg
- name: Push NuGet packages to NuGet
if: ${{ startsWith(github.ref, 'refs/tags/v') }} # Only for a tag
run: dotnet nuget push "artifacts/package/release/**.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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ github.ref_name }}
run: gh release create "$TAG" --repo="$GITHUB_REPOSITORY" --title="${TAG#v}" --generate-notes