[packaging] Excluded binary index from installers

This commit is contained in:
Alexandr Stelnykovych
2025-03-14 00:07:26 +02:00
parent 5c38035f14
commit 8a0aacd446
6 changed files with 45 additions and 33 deletions

View File

@@ -535,31 +535,44 @@ release-prep:
# Build update manager
COPY (+go-build/output/updatemgr --GOARCH=amd64 --GOOS=linux --CMDS=updatemgr) ./updatemgr
# Get binary artifacts from current release
RUN mkdir -p ./output/download/windows_amd64 && ./updatemgr download https://updates.safing.io/stable.v3.json --platform windows_amd64 ./output/download/windows_amd64
# Create new binary index from artifacts
RUN ./updatemgr scan --dir "./output/binary" > ./output/binary/index.json
# Get intel index and assets
# Get "portmaster-kext.sys" and "portmaster-core.dll" from current stable release
RUN mkdir -p ./output/downloaded/windows_amd64 && ./updatemgr download https://updates.safing.io/stable.v3.json --platform windows_amd64 ./output/downloaded/windows_amd64
RUN find ./output/downloaded/windows_amd64 -type f ! -name "portmaster-kext.sys" ! -name "portmaster-core.dll" -delete # We are only interested in the KEXT and core DLL. Remove the rest.
# Get intel artifacts
RUN mkdir -p ./output/intel && ./updatemgr download https://updates.safing.io/intel.v3.json ./output/intel
# Save all artifacts to output folder
SAVE ARTIFACT --if-exists --keep-ts "output/binary/index.json" AS LOCAL "${outputDir}/binary/index.json"
SAVE ARTIFACT --if-exists --keep-ts "output/binary/all/*" AS LOCAL "${outputDir}/binary/all/"
SAVE ARTIFACT --if-exists --keep-ts "output/binary/linux_amd64/*" AS LOCAL "${outputDir}/binary/linux_amd64/"
SAVE ARTIFACT --if-exists --keep-ts "output/binary/windows_amd64/*" AS LOCAL "${outputDir}/binary/windows_amd64/"
SAVE ARTIFACT --if-exists --keep-ts "output/intel/*" AS LOCAL "${outputDir}/intel/"
SAVE ARTIFACT --if-exists --keep-ts "output/download/windows_amd64/portmaster-kext.*" AS LOCAL "${outputDir}/download/windows_amd64/" # precompiled (downloaded) KEXT binary
# Save all artifacts to output folder (on host)
SAVE ARTIFACT --keep-ts "output/binary/all/*" AS LOCAL "${outputDir}/binary/all/"
SAVE ARTIFACT --keep-ts "output/binary/linux_amd64/*" AS LOCAL "${outputDir}/binary/linux_amd64/"
SAVE ARTIFACT --keep-ts "output/binary/windows_amd64/*" AS LOCAL "${outputDir}/binary/windows_amd64/"
SAVE ARTIFACT --keep-ts "output/intel/*" AS LOCAL "${outputDir}/intel/"
SAVE ARTIFACT --keep-ts "output/downloaded/*" AS LOCAL "${outputDir}/downloaded/" # KEXT and core DLL: artifacts from the current stable release
# Save all artifacts to the container output folder so other containers can access it.
SAVE ARTIFACT --if-exists --keep-ts "output/binary/index.json" "output/binary/index.json"
SAVE ARTIFACT --if-exists --keep-ts "output/binary/all/*" "output/binary/all/"
SAVE ARTIFACT --if-exists --keep-ts "output/binary/linux_amd64/*" "output/binary/linux_amd64/"
SAVE ARTIFACT --if-exists --keep-ts "output/binary/windows_amd64/*" "output/binary/windows_amd64/"
SAVE ARTIFACT --if-exists --keep-ts "output/intel/*" "output/intel/"
SAVE ARTIFACT --if-exists --keep-ts "output/download/*" "output/download/"
SAVE ARTIFACT --keep-ts "output/binary/all/*" "output/binary/all/"
SAVE ARTIFACT --keep-ts "output/binary/linux_amd64/*" "output/binary/linux_amd64/"
SAVE ARTIFACT --keep-ts "output/binary/windows_amd64/*" "output/binary/windows_amd64/"
SAVE ARTIFACT --keep-ts "output/intel/*" "output/intel/"
SAVE ARTIFACT --keep-ts "output/downloaded/*" "output/downloaded/"
# IMPORTANT: COPYING PRECOMPILED LOCAL FILES!
# If "packaging/_precompiled" foledr exists, it's contents has priority to be used; it's files will overwrite the ones from the build!
# Expected structure:
# - packaging/_precompiled/binary/...
# - packaging/_precompiled/intel
# Careful! If there are any files in the '_precompiled/intel' folder, the final 'intel/index.json' may be broken due to incorrect hash values!
COPY --if-exists --keep-ts ./packaging/_precompiled/binary ./packaging/precompiled/binary
COPY --if-exists --keep-ts ./packaging/_precompiled/intel ./packaging/precompiled/intel
IF --no-cache [ -d ./packaging/precompiled ]
RUN --no-cache echo "[ !!! ATTENTION !!! ] PRECOMPILED FILES IN USE:" && find ./packaging/precompiled -type f;
IF --no-cache [ -d ./packaging/precompiled/intel ]
RUN --no-cache echo "[!!! ATTENTION !!!] ENSURE THAT 'intel/index.json' CONTAINS THE CORRECT HASHES!"
END
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/intel/*" "output/intel/" # save to container (so other containers can access it)
SAVE ARTIFACT --if-exists --keep-ts "packaging/precompiled/binary/*" "output/binary/" # save to container (so other containers can access it)
END
installer-linux:
FROM +rust-base
@@ -582,7 +595,6 @@ installer-linux:
COPY (+release-prep/output/binary/linux_amd64/portmaster) ./target/${target}/release/portmaster
RUN mkdir -p binary
COPY (+release-prep/output/binary/index.json) ./binary/index.json
COPY (+release-prep/output/binary/linux_amd64/portmaster-core) ./binary/portmaster-core
COPY (+release-prep/output/binary/all/portmaster.zip) ./binary/portmaster.zip
COPY (+release-prep/output/binary/all/assets.zip) ./binary/assets.zip