-
Notifications
You must be signed in to change notification settings - Fork 171
95 lines (77 loc) · 3.46 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Build
# lOOK INTO ADDING RELEASE DRAFTER action
on:
push:
branches:
- main
- develop
- v5
pull_request:
branches:
- main
- develop
- v5
release:
types: [ published ]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
id: cache
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-breaker1-${{ hashFiles('**/packages.lock.json') }}
- uses: nowsprinting/check-version-format-action@v3
id: version
with:
prefix: 'v'
- name: Set the release version (if applicable)
run: |
echo "TAGGED_VERSION=${{ steps.version.outputs.full_without_prefix }}" >> $GITHUB_ENV
echo Set version to ${{ steps.version.outputs.full_without_prefix }}
shell: bash
if: steps.version.outputs.is_valid == 'true' && github.event_name == 'release'
- name: Upload planned for Nuget.org?
run: echo "This runner will upload to Nuget.org if tests pass"
if: matrix.uploader && github.event_name == 'release' && steps.version.outputs.is_valid == 'true'
- name: Clear & clean on release or cache miss
run: |
dotnet clean --configuration Release
dotnet nuget locals all --clear
if: steps.cache.outputs.cache-hit != 'true' || github.event_name == 'release'
- name: Restore packages
run: dotnet restore
- name: Build Solution
run: dotnet build --maxcpucount:1 -c Release ImageResizer.sln
- name: Test Solution AnyCPU (except azure)
run: dotnet test -c Release --filter "FullyQualifiedName!~Azure" ImageResizer.sln --blame --no-build
# - name: Test Solution x86 (except azure)
# run: dotnet test -c Release --filter "FullyQualifiedName!~Azure" ImageResizer.sln --blame --no-build --arch x86
#
# - name: Test Solution x64 (except azure)
# run: dotnet test -c Release --filter "FullyQualifiedName!~Azure" ImageResizer.sln --blame --no-build --arch x64
#
- uses: actions/upload-artifact@v3
if: failure()
with:
name: TestResults-${{matrix.os}}
path: TestResults/
- name: Pack
run: dotnet pack ImageResizer.sln -c Release --include-source --output uploading
- name: Add Azure & Myget Nuget feed
run: |
dotnet nuget add source --name azureimazen "https://pkgs.dev.azure.com/imazenio/_packaging/imazenio/nuget/v3/index.json"
dotnet nuget add source --name mygetimazen "https://www.myget.org/F/imazen-nightlies/api/v2/package"
# NOT uploading .zip to github... yet
- name: Publish nuget packages to MyGet
#&& steps.version.outputs.is_stable != 'true'
if: steps.version.outputs.is_valid == 'true' && github.event_name == 'release'
run: |
dotnet nuget push uploading\*.nupkg --skip-duplicate --api-key ${{ secrets.MYGET_KEY }} --source "mygetimazen"
- name: Publish nuget packages to Nuget.org
# && steps.version.outputs.is_stable == 'true'
if: steps.version.outputs.is_valid == 'true' && github.event_name == 'release'
run: |
dotnet nuget push uploading\*.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source nuget.org