build-release #14
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-release | |
on: [workflow_dispatch] | |
jobs: | |
create_release: | |
runs-on: windows-2019 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get version | |
id: version | |
run: | | |
$m = Select-String -path Source\Properties\AssemblyInfo.cs 'AssemblyVersion\(\"([\d\.]+)\"\)' | |
echo "version=$($m.Matches.Groups[1].Value)" >> $env:GITHUB_OUTPUT | |
echo "version_sanitized=$($m.Matches.Groups[1].Value.Replace('.','_'))" >> $env:GITHUB_OUTPUT | |
- name: Setup MSBuild | |
uses: microsoft/setup-msbuild@v1 | |
- name: Setup Nuget | |
uses: Nuget/[email protected] | |
- name: Restore Nuget packages | |
run: nuget restore .\Source\Conduit.sln | |
- name: Build Release | |
run: msbuild .\Source\Conduit.sln /t:build /p:Configuration=Release | |
- name: Create NSIS installer | |
uses: joncloud/[email protected] | |
with: | |
script-file: ./Source/bin/Release/Conduit.nsi | |
- name: Rename installer | |
run: | | |
Rename-Item -Path ./Source/bin/Release/conduit_setup.exe -NewName conduit_setup_${{ steps.version.outputs.version_sanitized }}.exe | |
- name: Create and Upload Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: v${{ steps.version.outputs.version }} | |
tag_name: v${{ steps.version.outputs.version }} | |
draft: true | |
files: ./Source/bin/Release/conduit_setup_${{ steps.version.outputs.version_sanitized }}.exe |