update autorelease #7
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[0-9]+.[0-9]+.[0-9]+"] | |
branches: ["master"] | |
jobs: | |
windows-build: | |
name: MSBuild Build | |
if: startsWith( github.ref, 'refs/tags/v') | |
runs-on: windows-2019 | |
timeout-minutes: 45 | |
steps: | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@v2 | |
- name: Install Visual Studio components | |
run: | | |
$vsPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise" | |
if (!(Test-Path $vsPath)) { | |
$vsPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional" | |
} | |
if (!(Test-Path $vsPath)) { | |
$vsPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" | |
} | |
& "$vsPath\Installer\vs_installer.exe" modify --installPath $vsPath --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.ATL --add Microsoft.VisualStudio.Component.VC.MFC --add Microsoft.VisualStudio.Component.Windows10SDK.17763 --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.VC.v141.xp --quiet --wait | |
shell: pwsh | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Git Fetch Tags | |
run: git fetch --prune --unshallow --tags -f | |
- name: Download Tools | |
run: | | |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
Invoke-WebRequest -Uri https://github.com/stedolan/jq/releases/download/jq-1.6/jq-win64.exe -OutFile jq.exe | |
Invoke-WebRequest -Uri https://github.com/moloch--/minisign/releases/download/v0.2.1/minisign.exe -OutFile minisign.exe | |
pwd | |
ls | |
- name: MSBuild x64 | |
run: | | |
msbuild.exe .\mimikatz.sln /p:Configuration=Release /p:Platform="x64" | |
- name: MSBuild Win32 | |
run: | | |
msbuild.exe .\mimikatz.sln /p:Configuration=Release /p:Platform="Win32" | |
- name: Build Package | |
# Powershell is utter fucking trash. | |
run: | | |
pwd | |
ls | |
mkdir compiled | |
$Version = git.exe describe --tags --abbrev=0 | |
Get-Content -Path extension.json | .\jq.exe --arg ver "$Version" '.version |= $ver' > ./compiled/extension.json | |
Copy-Item -Path .\x64\mimikatz.dll -Destination compiled\mimikatz.x64.dll | |
Copy-Item -Path .\Win32\mimikatz.dll -Destination compiled\mimikatz.x86.dll | |
cd compiled | |
tar.exe -czvf ..\mimikatz.tar.gz . | |
cd .. | |
pwd | |
ls | |
- name: Sign Package | |
run: | | |
Write-Output "${{ secrets.MINISIGN_PRIVATE_KEY }}" > minisign.key | |
$Content1 = Get-Content -Path ./compiled/extension.json | |
$Bytes = [System.Text.Encoding]::UTF8.GetBytes($Content1) | |
$Encoded = [System.Convert]::ToBase64String($Bytes) | |
.\minisign.exe -s minisign.key -S -m mimikatz.tar.gz -t "$Encoded" -x mimikatz.minisig | |
- name: "Publish Release" | |
uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: false | |
files: | | |
mimikatz.minisig | |
mimikatz.tar.gz |