-
-
Notifications
You must be signed in to change notification settings - Fork 142
59 lines (57 loc) · 2.11 KB
/
build-windows.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
50
51
52
53
54
55
56
57
58
59
name: Build Windows
on: [push, pull_request]
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Setup .NET Core 6
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.x
- name: Setup .NET Core 8
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.x
- name: Build Reason
run: "echo ref: ${{github.ref}} event: ${{github.event_name}}"
- name: Build Version
shell: bash
run: |
dotnet tool install --global minver-cli --version 4.3.0
version=$(minver --tag-prefix v)
echo "MINVERVERSIONOVERRIDE=$version" >> $GITHUB_ENV
- name: Build
run: dotnet build --configuration Release Exceptionless.Net.Windows.sln
- name: Run Tests
run: dotnet test --configuration Release --no-build Exceptionless.Net.Windows.sln
- name: Package
if: github.event_name != 'pull_request'
run: dotnet pack --configuration Release --no-build Exceptionless.Net.Windows.sln
- name: Install GitHub Package Tool
if: github.event_name != 'pull_request'
run: dotnet tool install gpr -g
- name: Publish CI Packages
shell: bash
if: github.event_name != 'pull_request'
run: |
for package in $(find -name "*.nupkg" | grep "minver" -v); do
echo "${0##*/}": Pushing $package...
# GitHub
gpr push $package -k ${{ secrets.GITHUB_TOKEN }} || true
# Feedz (remove once GitHub supports anonymous access)
dotnet nuget push $package --source https://f.feedz.io/exceptionless/exceptionless/nuget --api-key ${{ secrets.FEEDZ_KEY }} --skip-duplicate
done
- name: Publish Release Packages
shell: bash
if: startsWith(github.ref, 'refs/tags/v')
run: |
for package in $(find -name "*.nupkg" | grep "minver" -v); do
echo "${0##*/}": Pushing $package...
dotnet nuget push $package --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_KEY }} --skip-duplicate
done