Skip to content

New update 1.2.0.0 build and reflections in markdown; fixes for regul… #16

New update 1.2.0.0 build and reflections in markdown; fixes for regul…

New update 1.2.0.0 build and reflections in markdown; fixes for regul… #16

Workflow file for this run

name: Main Build
on:
push:
paths:
- '**.cpp'
- '**.h'
- '**.sln'
- '**.yml'
- '*.yml'
- '**.ps1'
env:
VS_PROGRAM: 1
VS_FILE: 1
VS_EPOCH:
VS_FULL:
RELEASE_TITLE: "Hosts Compress"
RELEASE_FILE: "./docs/md/release.md"
BIN_DEFAULT: "hostscompress"
PRERELEASE: False
jobs:
build_windows:
name: Build Windows Project
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: microsoft/setup-msbuild@v1.3.1
- id: make_hosts_compress
run: |
cd scripts
./build.ps1
if ($LASTEXITCODE -gt 0)
{
Write-Host "[$LASTEXITCODE] - Error in build script."
Exit $LASTEXITCODE
}
cd ../
$epoch = [decimal] [datetimeoffset]::UtcNow.ToUnixTimeMilliseconds()
echo "VS_FULL=${{ env.VS_PROGRAM }}.${{ env.VS_FILE }}.$epoch" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
$hostscompress_x86_md5_text = @'
{
"schemaVersion": 1,
"color": "2E9778",
"label": "hostscompress-x86.exe MD5",
"message": "PLACEHOLDER",
"labelColor": "1d1d1d",
"style": "for-the-badge",
"namedLogo": "windows"
}
'@
New-Item -ItemType Directory -Force -Path '.\docs\json'
Write-Output "$hostscompress_x86_md5_text" > .\docs\json\hostscompress_x86_md5.json
$file = ".\docs\json\hostscompress_x86_md5.json"
$md5 = New-Object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
$(Get-FileHash -Path "build\windows\x86\hostscompress-x86.exe" -Algorithm MD5).Hash
$hash = $(Get-FileHash -Path "build\windows\x86\hostscompress-x86.exe" -Algorithm MD5).Hash
((Get-Content -path $file -Raw) -replace 'PLACEHOLDER',$hash) | Set-Content -Path "$file"
$hostscompress_x64_md5_text = @'
{
"schemaVersion": 1,
"color": "2E9778",
"label": "hostscompress-x64.exe MD5",
"message": "PLACEHOLDER",
"labelColor": "1d1d1d",
"style": "for-the-badge",
"namedLogo": "windows"
}
'@
Write-Output "$hostscompress_x64_md5_text" > .\docs\json\hostscompress_x64_md5.json
$file = ".\docs\json\hostscompress_x64_md5.json"
$md5 = New-Object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
$hash = $(Get-FileHash -Path "build\windows\x64\hostscompress-x64.exe" -Algorithm MD5).Hash
((Get-Content -path $file -Raw) -replace 'PLACEHOLDER',$hash) | Set-Content -Path "$file"
git add .\docs\json\*
git config --global user.name 'Lateralus138'
git config --global user.email 'Lateralus138@users.noreply.github.com'
git commit --allow-empty -am "Pushed .\docs\json\* to master. - $(Get-Date ([datetime]::UtcNow)) UTC"
git push --force origin master
- uses: ncipollo/release-action@v1
if: steps.make_hosts_compress.conclusion == 'success'
with:
allowUpdates: True
tag: ${{ env.VS_FULL }}
name: ${{ env.RELEASE_TITLE }} - v${{ env.VS_FULL }}
bodyFile: ${{ env.RELEASE_FILE }}
prerelease: ${{ env.PRERELEASE }}
artifacts: build\windows\x86\${{ env.BIN_DEFAULT }}-x86.exe,build\windows\x64\${{ env.BIN_DEFAULT }}-x64.exe
token: ${{ secrets.GITHUB_TOKEN }}