Skip to content

2.4.0

2.4.0 #120

Workflow file for this run

# adapted from https://patriksvensson.se/2020/03/creating-release-artifacts-with-github-actions/
name: Publish
on:
release:
types: [published]
jobs:
release:
name: Release
strategy:
matrix:
kind: ['windowsx64', 'windowsx86', 'windowsarm64']
include:
- kind: windowsx64
os: windows-2022
target: win-x64
- kind: windowsx86
os: windows-2022
target: win-x86
- kind: windowsarm64
os: windows-2022
target: win-arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BASE64_PFX: ${{ secrets.BASE64_PFX }}
PFX_PASSWORD: ${{ secrets.PFX_PASSWORD }}
shell: bash
run: |
tag=$(git describe --tags --abbrev=0)
release_name="JL-$tag-${{ matrix.target }}"
# Build everything
dotnet publish JL.Windows/JL.Windows.csproj --framework net8.0-windows --runtime "${{ matrix.target }}" --no-self-contained -c Release -o "$release_name" //p:Version=$tag
# Mark JL as LARGEADDRESSAWARE
if [ "${{ matrix.target }}" = "win-x86" ]
then
vswhere_path="C:/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe"
read -r vc_tools_version<"$("$vswhere_path" -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -find "VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt")"
vc_tools_version="${vc_tools_version//$'\r'/}"
editbin_path=$("${vswhere_path}" -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -find "VC/Tools/MSVC/${vc_tools_version}/bin/Hostx64/x64/editbin.exe")
"${editbin_path}" //NOLOGO //LARGEADDRESSAWARE ${release_name}/JL.exe
fi
#Sign with self-signed certificate
pfxCertFilePath=${release_name}/JLCertificate.pfx
echo "${BASE64_PFX}" | base64 --decode > "${pfxCertFilePath}"
pwsh -c '$password = ConvertTo-SecureString -String '"${PFX_PASSWORD}"' -Force -AsPlainText;''$pfx = Get-PfxCertificate -FilePath '"$pfxCertFilePath"' -Password $password -NoPromptForPassword;''Set-AuthenticodeSignature -FilePath '"$release_name"'/JL.exe -Certificate $pfx -HashAlgorithm SHA256;'
rm "${pfxCertFilePath}"
# Pack files
7z a -tzip "${release_name}.zip" "./${release_name}/*"
# Delete output directory
rm -r "$release_name"
- name: Publish
uses: softprops/action-gh-release@v2
with:
files: "JL*.zip"