-
-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (68 loc) · 2.11 KB
/
main.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
name: Compile Program
on:
release:
types:
- created
push:
pull_request:
jobs:
lint-and-compile:
strategy:
matrix:
configuration: [Debug, Release]
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: "6.0.x"
- name: Restore NuGet Packages
run: dotnet restore ${{ github.event.repository.name }}.sln
- name: Patch csproj version
uses: justalemon/[email protected]
with:
version: 2.8.0.${{ github.run_number }}
use-tag: true
csproj-files: "**/**.csproj"
- name: Compile
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: dotnet build ${{ github.event.repository.name }}.sln -c ${{ matrix.configuration }}
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}.${{ matrix.configuration }}
path: bin/${{ matrix.configuration }}
deploy:
runs-on: ubuntu-22.04
if: ${{ github.event_name == 'release' }}
needs:
- lint-and-compile
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: "6.0.x"
- name: Download the Artifact
uses: actions/download-artifact@v3
with:
name: ${{ github.event.repository.name }}.Release
path: bin/Release
- name: List Everything
run: ls -R
working-directory: bin/Release
- name: Repackage Files
run: 7z a ${{ github.event.repository.name }}.zip ${{ github.workspace }}/bin/Release/*
- name: Create Release
uses: ncipollo/[email protected]
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: ${{ github.event.repository.name }}.zip
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true