Build scripts refactoring
This commit is contained in:
@@ -555,7 +555,8 @@ release-prep:
|
|||||||
RUN --no-cache echo "[ !!! ATTENTION !!! ] PRECOMPILED FILES IN USE:" && find ./packaging/precompiled -type f;
|
RUN --no-cache echo "[ !!! ATTENTION !!! ] PRECOMPILED FILES IN USE:" && find ./packaging/precompiled -type f;
|
||||||
IF --no-cache [ -d ./packaging/precompiled/intel ]
|
IF --no-cache [ -d ./packaging/precompiled/intel ]
|
||||||
RUN --no-cache echo "[!!! ATTENTION !!!] ENSURE THAT 'intel/index.json' CONTAINS THE CORRECT HASHES!"
|
RUN --no-cache echo "[!!! ATTENTION !!!] ENSURE THAT 'intel/index.json' CONTAINS THE CORRECT HASHES!"
|
||||||
END
|
END
|
||||||
|
RUN --no-cache echo "Script paused. Press Enter to continue..." && read
|
||||||
SAVE ARTIFACT --if-exists --keep-ts "packaging/precompiled/intel/*" AS LOCAL "${outputDir}/intel/" # save to host
|
SAVE ARTIFACT --if-exists --keep-ts "packaging/precompiled/intel/*" AS LOCAL "${outputDir}/intel/" # save to host
|
||||||
SAVE ARTIFACT --if-exists --keep-ts "packaging/precompiled/binary/*" AS LOCAL "${outputDir}/binary/" # save to host
|
SAVE ARTIFACT --if-exists --keep-ts "packaging/precompiled/binary/*" AS LOCAL "${outputDir}/binary/" # save to host
|
||||||
SAVE ARTIFACT --if-exists --keep-ts "packaging/precompiled/intel/*" "output/intel/" # save to container (so other containers can access it)
|
SAVE ARTIFACT --if-exists --keep-ts "packaging/precompiled/intel/*" "output/intel/" # save to container (so other containers can access it)
|
||||||
|
|||||||
@@ -9,6 +9,9 @@
|
|||||||
# 1. Compile Core Binaries (Linux environment)
|
# 1. Compile Core Binaries (Linux environment)
|
||||||
# ```
|
# ```
|
||||||
# earthly +release-prep
|
# earthly +release-prep
|
||||||
|
#
|
||||||
|
# # Or use command to do the same AND build Linux packages:
|
||||||
|
# # earthly +all-artifacts
|
||||||
# ```
|
# ```
|
||||||
# This compiles and places files into the 'dist' folder with the required structure.
|
# This compiles and places files into the 'dist' folder with the required structure.
|
||||||
# Note: Latest KEXT binaries and Intel data will be downloaded from https://updates.safing.io
|
# Note: Latest KEXT binaries and Intel data will be downloaded from https://updates.safing.io
|
||||||
@@ -20,7 +23,7 @@
|
|||||||
#
|
#
|
||||||
# 3. Sign All Binaries (Windows environment)
|
# 3. Sign All Binaries (Windows environment)
|
||||||
# ```
|
# ```
|
||||||
# .\packaging\windows\sign_binaries_in_dist.ps1 -certSha1 <SHA1_of_the_certificate>
|
# .\packaging\windows\sign_binaries_in_dist.ps1 -certSha1 d3bf5973eb1ec3dbd6ec45d77d556881a350acd2
|
||||||
# ```
|
# ```
|
||||||
# This signs all binary files in the dist directory
|
# This signs all binary files in the dist directory
|
||||||
#
|
#
|
||||||
@@ -121,13 +124,14 @@ function Find-And-Copy-File {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
# Print details about the file
|
# Print details about the file
|
||||||
$fileInfo = Get-Item -Path $fullSourcePath
|
$fileInfo = Get-Item -Path $fullSourcePath
|
||||||
$output = "{0,-22}: {1,-29} -> {2,-38} [{3,-20} {4,18}{5}]" -f
|
$fileHash = (Get-FileHash -Path $fullSourcePath -Algorithm SHA256).Hash
|
||||||
|
$hashShort = $fileHash.Substring(0, 4) + "..." + $fileHash.Substring($fileHash.Length - 8)
|
||||||
|
$output = "{0,-22}: {1,-29} -> {2,-38} [{3}{4}]" -f
|
||||||
$File,
|
$File,
|
||||||
$(Split-Path -Path $fullSourcePath -Parent),
|
$(Split-Path -Path $fullSourcePath -Parent),
|
||||||
$(Split-Path -Path $destinationPath -Parent),
|
$(Split-Path -Path $destinationPath -Parent),
|
||||||
"$($fileInfo.LastAccessTime.ToString("yyyy-MM-dd HH:mm:ss"));",
|
"SHA256: $hashShort",
|
||||||
"$($fileInfo.Length) bytes",
|
|
||||||
$(if ($fileInfo.VersionInfo.FileVersion) { "; v$($fileInfo.VersionInfo.FileVersion)" } else { "" })
|
$(if ($fileInfo.VersionInfo.FileVersion) { "; v$($fileInfo.VersionInfo.FileVersion)" } else { "" })
|
||||||
Write-Output "$output"
|
Write-Output "$output"
|
||||||
|
|
||||||
@@ -205,13 +209,13 @@ try {
|
|||||||
# Copying BINARY FILES
|
# Copying BINARY FILES
|
||||||
Write-Output "`n[+] Copying binary files:"
|
Write-Output "`n[+] Copying binary files:"
|
||||||
$filesToCopy = @(
|
$filesToCopy = @(
|
||||||
@{Folder="dist/binary/windows_amd64"; File="portmaster-kext.sys"; Destination=$binaryDir; AlternateSourceDirs=@("dist/downloaded/windows_amd64", "dist")},
|
@{Folder="dist/downloaded/windows_amd64"; File="portmaster-kext.sys"; Destination=$binaryDir; },
|
||||||
@{Folder="dist/binary/windows_amd64"; File="portmaster-core.dll"; Destination=$binaryDir; AlternateSourceDirs=@("dist/downloaded/windows_amd64", "dist")},
|
@{Folder="dist/downloaded/windows_amd64"; File="portmaster-core.dll"; Destination=$binaryDir; },
|
||||||
@{Folder="dist/binary/windows_amd64"; File="portmaster-core.exe"; Destination=$binaryDir; AlternateSourceDirs=@("dist")},
|
@{Folder="dist/binary/windows_amd64"; File="portmaster-core.exe"; Destination=$binaryDir; },
|
||||||
@{Folder="dist/binary/windows_amd64"; File="WebView2Loader.dll"; Destination=$binaryDir; AlternateSourceDirs=@("dist")},
|
@{Folder="dist/binary/windows_amd64"; File="WebView2Loader.dll"; Destination=$binaryDir; },
|
||||||
@{Folder="dist/binary/all"; File="portmaster.zip"; Destination=$binaryDir; AlternateSourceDirs=@("dist")},
|
@{Folder="dist/binary/all"; File="portmaster.zip"; Destination=$binaryDir; },
|
||||||
@{Folder="dist/binary/all"; File="assets.zip"; Destination=$binaryDir; AlternateSourceDirs=@("dist")},
|
@{Folder="dist/binary/all"; File="assets.zip"; Destination=$binaryDir; },
|
||||||
@{Folder="dist/binary/windows_amd64"; File="portmaster.exe"; Destination=$targetDir; AlternateSourceDirs=@("dist")}
|
@{Folder="dist/binary/windows_amd64"; File="portmaster.exe"; Destination=$targetDir; }
|
||||||
)
|
)
|
||||||
foreach ($file in $filesToCopy) {
|
foreach ($file in $filesToCopy) {
|
||||||
Find-And-Copy-File -SourceDir $file.Folder -File $file.File -DestinationDir $file.Destination -AlternateSourceDirs $file.AlternateSourceDirs
|
Find-And-Copy-File -SourceDir $file.Folder -File $file.File -DestinationDir $file.Destination -AlternateSourceDirs $file.AlternateSourceDirs
|
||||||
|
|||||||
Reference in New Issue
Block a user