-
Notifications
You must be signed in to change notification settings - Fork 23
85 lines (73 loc) · 2.35 KB
/
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
81
82
83
84
85
name: Build & Release
on:
push:
branches: "master"
paths-ignore:
- '**/README.md'
tags:
- "v[0-9]+.[0-9]+.[0-9]+.[0-9]+"
pull_request:
branches: "*"
paths-ignore:
- '**/README.md'
env:
DOTNET_NOLOGO: false
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
jobs:
build:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner: [ windows-latest, ubuntu-latest, macos-latest ]
project: [ {name: Server, extraArgs: ' -p:PublishSingleFile=true --self-contained false'}, {name: CentrED, extraArgs: ''} ]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Publish
run: dotnet publish ${{ matrix.project.name }} -c Release -o release_${{ matrix.project.name }} -p:DebugType=None ${{ matrix.project.extraArgs }}
- name: Upload Build Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.project.name }}-${{ runner.os }}-${{ runner.arch }}
path: ${{ github.workspace }}/release_${{ matrix.project.name }}/*
release:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
path: artifacts/
- name: Install zip
uses: montudor/action-zip@v1
- name: Create archives
run: |
mkdir release
for arch in Linux Windows macOS; do
zip -qq -r release/Cedserver-$arch-x64.zip artifacts/Server-$arch-X64/
zip -qq -r release/CentrED-$arch-x64.zip artifacts/CentrED-$arch-X64/
done
- name: Create Release
uses: ncipollo/[email protected]
if: startsWith(github.ref, 'refs/tags/')
with:
artifacts: release/*
generateReleaseNotes: true
skipIfReleaseExists: true
- name: Create Dev Release
uses: ncipollo/[email protected]
if: github.ref == 'refs/heads/master'
with:
allowUpdates: true
artifacts: release/*
generateReleaseNotes: false
makeLatest: true
prerelease: true
replacesArtifacts: true
tag: dev