-
Notifications
You must be signed in to change notification settings - Fork 4
127 lines (104 loc) · 3.93 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: .NET
on: [ push, pull_request ]
env:
DOTNET_SDK_VERSION: 7.0.x
jobs:
build-generic:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_SDK_VERSION }}
- name: Restore dependencies
run: dotnet restore
- name: Build with .NET Core
run: dotnet publish -c Release -f net7.0 -o out/${{ github.event.repository.name }}-generic
- name: Upload generic artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}-generic
path: out/${{ github.event.repository.name }}-generic
build-generic-netf:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_SDK_VERSION }}
- name: Restore dependencies
run: dotnet restore
- name: Disable local packages source
run: dotnet nuget disable source "Microsoft Visual Studio Offline Packages"
- name: Build with .NET Framework
run: dotnet publish -c Release -f net481 -o out/${{ github.event.repository.name }}-generic-netf
- name: Upload generic-netf artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}-generic-netf
path: out/${{ github.event.repository.name }}-generic-netf
release:
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
needs: [build-generic-netf, build-generic]
runs-on: ubuntu-latest
steps:
- name: Download generic artifacts
uses: actions/[email protected]
with:
name: ${{ github.event.repository.name }}-generic
path: out/${{ github.event.repository.name }}-generic
- name: Download generic-netf artifacts
uses: actions/[email protected]
with:
name: ${{ github.event.repository.name }}-generic-netf
path: out/${{ github.event.repository.name }}-generic-netf
- name: Archive generic release
uses: thedoctor0/zip-release@master
with:
directory: out
path: ${{ github.event.repository.name }}-generic
type: 'zip'
filename: 'generic.zip'
exclusions: '*.json'
- name: Archive generic-netf release
uses: thedoctor0/zip-release@master
with:
directory: out
path: ${{ github.event.repository.name }}-generic-netf
type: 'zip'
filename: 'generic-netf.zip'
exclusions: '*.json'
- name: Create GitHub release
id: github_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.event.repository.name }} V${{ github.ref }}
- name: Upload generic artifacts to GitHub release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.github_release.outputs.upload_url }}
asset_path: out/generic.zip
asset_name: generic.zip
asset_content_type: application/zip
- name: Upload generic-netf artifacts to GitHub release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.github_release.outputs.upload_url }}
asset_path: out/generic-netf.zip
asset_name: generic-netf.zip
asset_content_type: application/zip