forked from immense/Remotely
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (56 loc) · 1.89 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
name: Build
on:
workflow_dispatch:
inputs:
rid:
description: 'Server Runtime Identifier'
required: false
default: "win-x64"
jobs:
build-windows:
runs-on: self-hosted
env:
Solution_Name: Remotely.sln
Configuration: Release
steps:
- name: Checkout
uses: actions/checkout@v3.5.2
with:
submodules: recursive
fetch-depth: 0
- name: Install .NET Core
uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: 7
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1
- name: Execute unit tests
run: dotnet test
- name: Restore the application
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
- name: Set current version
shell: powershell
run: |
$VersionString = git show -s --format=%ci
$VersionDate = [DateTimeOffset]::Parse($VersionString)
$CurrentVersion = $VersionDate.ToString("yyyy.MM.dd.HHmm")
echo "CurrentVersion=$CurrentVersion" >> $env:GITHUB_ENV
Write-Host "Setting current version to $CurrentVersion."
- name: Run Publish script
shell: powershell
run: |
.\Utilities\Publish.ps1 -CurrentVersion $env:CurrentVersion -RID ${{ github.event.inputs.rid }} -OutDir "$env:GITHUB_WORKSPACE\publish"
- name: Upload server build artifact
uses: actions/upload-artifact@v3.1.2
with:
path: ./publish/
name: Server
- name: Build Windows Installer
shell: powershell
run: |
msbuild ./Agent.Installer.Win/Agent.Installer.Win.csproj /p:Configuration=Release
- name: Upload Installer Artifact
uses: actions/upload-artifact@v3.1.2
with:
path: ./Agent.Installer.Win/bin/Release/
name: Windows-Agent-Installer