-
Notifications
You must be signed in to change notification settings - Fork 4
62 lines (50 loc) · 1.61 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
name: .NET
on: [ push, pull_request ]
env:
DOTNET_SDK_VERSION: 9
jobs:
build:
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@v4
with:
dotnet-version: ${{ env.DOTNET_SDK_VERSION }}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet publish -c Release -f net8.0 -o out/${{ github.event.repository.name }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}
path: out/${{ github.event.repository.name }}
release:
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/[email protected]
with:
name: ${{ github.event.repository.name }}
path: out/${{ github.event.repository.name }}
- name: Archive release
uses: thedoctor0/zip-release@master
with:
directory: out
path: ${{ github.event.repository.name }}
type: 'zip'
filename: 'generic.zip'
exclusions: '*.json'
- name: Create GitHub release
id: github_release
uses: ncipollo/[email protected]
with:
artifacts: "out/*.zip"
makeLatest: true
name: ${{ github.event.repository.name }} V${{ github.ref_name }}