Build #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
workflow_dispatch: | |
inputs: | |
rid: | |
description: 'Server Runtime Identifier' | |
required: false | |
default: "win-x64" | |
jobs: | |
build-windows: | |
runs-on: windows-latest | |
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/Server/ | |
name: Server | |
- name: Publish Windows x64 Agent | |
shell: powershell | |
run: | | |
dotnet publish ./Agent/ -c Release -r win-x64 --self-contained -o "./Agent/bin/publish/" | |
Compress-Archive -Path "./Agent/bin/publish/*" -DestinationPath "./Agent/bin/Remotely-Windows-x64.zip" -Force | |
- name: Upload Windows client build artifact | |
uses: actions/upload-artifact@v3.1.2 | |
with: | |
path: ./Agent/bin/Remotely-Windows-x64.zip | |
name: Windows-Agent-x64 |