forked from JasperFx/wolverine
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (59 loc) · 2.11 KB
/
dotnet.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: .NET
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
config: Release
disable_test_parallelization: true
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Setup .NET 7
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
- name: Setup .NET 8
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build Version
run: |
dotnet tool install --global minver-cli --version 4.2.0
version=$(minver --tag-prefix v)
echo "MINVERVERSIONOVERRIDE=$version" >> $GITHUB_ENV
echo "### Version: $version" >> $GITHUB_STEP_SUMMARY
- name: Test
run: ./build.sh --no-color ci
- name: Package
if: github.event_name != 'pull_request'
run: ./build.sh --no-color pack
- name: Publish CI Packages
if: github.event_name != 'pull_request'
run: |
for package in $(find -name "*.nupkg" | grep "minver" -v); do
# GitHub
if [ -n "${{ secrets.GITHUB_TOKEN }}" ]; then
echo "${0##*/}": Pushing $package to GitHub...
dotnet nuget push $package --source https://nuget.pkg.github.com/jasperfx/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
fi
# Feedz (remove once GitHub supports anonymous access)
if [ -n "${{ secrets.FEEDZ_KEY }}" ]; then
echo "${0##*/}": Pushing $package to Feedz...
dotnet nuget push $package --source https://f.feedz.io/jasperfx/wolverine/nuget --api-key ${{ secrets.FEEDZ_KEY }} --skip-duplicate
fi
done
- name: Publish Release Packages
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_API_KEY }} --skip-duplicate
done