Merge pull request #117 from damienfinck/SortAccessControlList #17
Workflow file for this run
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: Release | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
build: | |
runs-on: 'windows-2019' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get tag | |
id: tag | |
uses: devops-actions/[email protected] | |
- id: dlkp | |
name: Download Keepass | |
uses: smorks/[email protected] | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@v1 | |
- name: Extract KeePass and Build | |
run: | | |
mkdir build | |
7z x -o"build" ${{ steps.dlkp.outputs.filename }} KeePass.exe | |
$ainfo = "KeePassNatMsg\Properties\AssemblyInfo.cs" | |
$content = (Get-Content -Path $ainfo) -replace '\[assembly: AssemblyVersion\("([\d.]+?)"\)\]', ('[assembly: AssemblyVersion("' + "${{ steps.tag.outputs.tag }}".substring(1) + '")]') | |
$content | Set-Content -Path $ainfo | |
msbuild /p:Configuration=Release | |
- name: Prepare Release | |
run: | | |
cp -Recurse KeePassNatMsg\bin\Release\ build\ | |
mv build\Release build\KeePassNatMsg | |
$zip = 'KeePassNatMsg-${{ steps.tag.outputs.tag }}-binaries.zip' | |
7z a $zip .\build\KeePassNatMsg\ "-xr!*.pdb" | |
$hash = (Get-FileHash "$zip" sha256).Hash.ToLower() | |
Set-Content -Path 'release.txt' -Value ('### SHA256 Hash',('* '+$zip),(' * '+$hash)) | |
git clean -fx KeePassNatMsg | |
$p = Start-Process -FilePath ".\build\KeePass.exe" -ArgumentList "--plgx-create","$pwd\KeePassNatMsg" -PassThru | |
$p.WaitForExit() | |
$plgx = 'KeePassNatMsg.plgx' | |
$hash = (Get-FileHash "$plgx" sha256).Hash.ToLower() | |
Add-Content -Path 'release.txt' -Value ('* '+$plgx,(' * '+$hash)) | |
- name: Publish Release | |
uses: softprops/[email protected] | |
with: | |
body_path: release.txt | |
files: | | |
KeePassNatMsg-${{ steps.tag.outputs.tag }}-binaries.zip | |
KeePassNatMsg.plgx |