-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (69 loc) · 2.05 KB
/
dotnet-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
name: .NET Build
on:
push:
branches: [ "main", "develop" ]
tags-ignore: [ "**" ]
pull_request:
branches: [ "main", "develop" ]
jobs:
build:
runs-on: windows-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Restore packages
run: dotnet restore
# Get current date for release naming
- name: Get current date
id: date
run: echo "DATE=$(date +'%y.%m.%d')" >> $ENV:GITHUB_OUTPUT
# Build applications
- name: Build for Windows x64
uses: ./.github/actions/app-build
with:
dotnet: 'net8.0'
platform: 'win-x64'
project: 'GameCollector.Server'
artifact: 'windows-x64'
version: '${{ steps.date.outputs.DATE }}.${{ github.run_number }}'
- name: Build for Linux x64
uses: ./.github/actions/app-build
with:
dotnet: 'net8.0'
platform: 'linux-x64'
project: 'GameCollector.Server'
artifact: 'linux-x64'
version: '${{ steps.date.outputs.DATE }}.${{ github.run_number }}'
# Create pre-release
- name: Pre-Release
uses: softprops/action-gh-release@v1
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/develop' }}
with:
tag_name: ${{ steps.date.outputs.DATE }}.${{ github.run_number }}
prerelease: true
body: Pre-release, compare Git commits.
files: |
windows-x64.zip
linux-x64.zip
# Create release
- name: Release
uses: softprops/action-gh-release@v1
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }}
with:
tag_name: ${{ steps.date.outputs.DATE }}.${{ github.run_number }}
prerelease: false
body: Release, compare Git commits.
files: |
windows-x64.zip
linux-x64.zip