-
Notifications
You must be signed in to change notification settings - Fork 31
104 lines (86 loc) · 2.75 KB
/
dotnetcore.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
96
97
98
99
100
101
102
103
104
name: Real Build
on:
push:
branches:
- main
paths-ignore:
- '*.md'
jobs:
build:
runs-on: windows-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v1
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Install workload
run: dotnet workload install wasm-tools
- name: Build Debug
run: dotnet build Trains.NET.sln -p:CI=true -c Debug
- name: Build Release
run: dotnet build Trains.NET.sln -p:CI=true -c Release -bl
- name: Upload binary log
uses: actions/upload-artifact@v2
with:
name: binlog
path: msbuild.binlog
retention-days: 5
- name: Run tests
run: dotnet test
- name: publish
run: dotnet publish -o ./publish -r win-x64 -c Release --no-self-contained -p:PublishSingleFile=true -p:IncludeNativeLibrariesInSingleFile=true -p:IncludeAllContentForSelfExtract=true src/Trains/Trains.csproj
- name: GitVersion
id: nbgv
uses: aarnott/nbgv@master
with:
setAllVars: true
- run: |
echo 'SemVer2: ${{ steps.nbgv.outputs.SemVer2 }}'
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.nbgv.outputs.SemVer2 }}
release_name: Trains.NET v${{ steps.nbgv.outputs.SemVer2 }}
body: Trains.NET v${{ steps.nbgv.outputs.SemVer2 }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./publish/trains.exe
asset_name: trains.exe
asset_content_type: application/exe
build-blazor:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Install workload
run: dotnet workload install wasm-tools
- name: Publish app
run: dotnet publish src/BlazingTrains/BlazingTrains.csproj -c Release -p:PublishIISAssets=false
- name: GitHub Pages
if: success()
uses: crazy-max/[email protected]
with:
target_branch: gh-pages
build_dir: src/BlazingTrains/bin/Release/net8.0/publish/wwwroot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}