-
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (73 loc) · 2.37 KB
/
dotnetcore-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
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
name: .NET Core (build)
on:
push:
branches: [ main ]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
BUILD_RERUN_COUNT: ${{ github.run_attempt }}
steps:
- uses: actions/checkout@main
- name: Install latest .NET SDK
uses: Elskom/setup-latest-dotnet@main
with:
SDK_VERSION: '8.0.100'
RUNTIME_VERSIONS: ''
- name: Restore, Build, and pack
uses: Elskom/build-dotnet@main
with:
RESTORE: false
PACK: true
PUSH: false
- name: Clean up temp installer files.
run: |
del artifacts/packages/Release/Shipping/*.wixpdb
del artifacts/packages/Release/Shipping/*-runtime-*.*
del artifacts/packages/Release/Shipping/*-targeting-pack-*.*
shell: pwsh
- name: Upload artifacts
uses: actions/upload-artifact@main
with:
name: Shipping-${{ runner.os }}
path: artifacts/packages/Release/Shipping/*
- name: Upload binlog on failure.
uses: actions/upload-artifact@main
if: ${{ failure() }}
with:
name: msbuild.binlog
path: msbuild.binlog
create_release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@main
- name: Download artifacts
uses: actions/download-artifact@main
with:
pattern: Shipping-*
path: artifacts/packages/Release/Shipping/
merge-multiple: true
- name: Push nuget Packages to nuget.org.
run: dotnet nuget push **/*.nupkg -s nuget.org -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate
- name: Extract version from version.txt.
id: read_file
uses: andstor/file-reader-action@master
with:
path: "artifacts/packages/Release/Shipping/version.txt"
- uses: ncipollo/release-action@main
with:
artifacts: "artifacts/packages/Release/Shipping/*.exe,artifacts/packages/Release/Shipping/*.*pkg,artifacts/packages/Release/Shipping/*.zip,artifacts/packages/Release/Shipping/*.tar.gz"
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: true
tag: ${{ steps.read_file.outputs.contents }}
commit: ${{ github.sha }}