automate release build with github actions
This commit is contained in:
parent
0353001ac5
commit
cbc5641316
2 changed files with 33 additions and 6 deletions
30
.github/workflows/create-release.yaml
vendored
Normal file
30
.github/workflows/create-release.yaml
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
name: Create release on tag push
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'release/*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build VoiceAttack-EliteScreenshots
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup .Net
|
||||
uses: actions/setup-dotnet@v1.1
|
||||
|
||||
- name: Build
|
||||
run: dotnet build -c release
|
||||
|
||||
- name: Draft release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
artifacts: "VoiceAttack-EliteScreenshots.zip"
|
||||
bodyFile: "CHANGELOG.md"
|
||||
draft: true
|
|
@ -61,10 +61,7 @@
|
|||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>powershell if (Test-Path '$(SolutionDir)VoiceAttack-EliteScreenshots.zip') { Remove-Item -Path '$(SolutionDir)VoiceAttack-EliteScreenshots.zip' }</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>if $(ConfigurationName) == Release (powershell Compress-Archive -Path '$(TargetDir)' -DestinationPath '$(SolutionDir)VoiceAttack-EliteScreenshots.zip' -Force)</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<Target Name="AfterBuild" Condition=" '$(Configuration)' == 'Release' ">
|
||||
<ZipDirectory SourceDirectory="bin" DestinationFile="VoiceAttack-EliteScreenshots.zip" Overwrite="true" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
Loading…
Reference in a new issue