diff --git a/scripts/build-os-packages/build-os-packages b/scripts/build-os-packages/build-os-packages index 1dc114b6fd..3efaf09de3 100755 --- a/scripts/build-os-packages/build-os-packages +++ b/scripts/build-os-packages/build-os-packages @@ -200,6 +200,16 @@ step_copy_files() { die "Can't find '$pyinstaller_ggshield', maybe 'build' step did not run?" fi + # linux, macOS tgz + # $ARCHIVE_NAME/ggshield + # $ARCHIVE_NAME/internal + + # macOS pkg + # $ARCHIVE_NAME/usr/local/bin/ggshield + # $ARCHIVE_NAME/opt/gitguardian/ggshield-$VERSION/ggshield + # $ARCHIVE_NAME/opt/gitguardian/ggshield-$VERSION/internal + # ------------------------------^ + mkdir -p "$PACKAGES_DIR" case "$HUMAN_OS" in Linux|Windows) @@ -282,29 +292,42 @@ step_create_archive() { tar -czf "$archive_path" "$ARCHIVE_DIR_NAME" popd create_linux_packages + info "Archive created in $archive_path" ;; macOS) - archive_path="$PACKAGES_DIR/$ARCHIVE_DIR_NAME.pkg" + # tar.gz + archive_path="$PACKAGES_DIR/$ARCHIVE_DIR_NAME.tar.gz" + pushd "$PACKAGES_DIR/$ARCHIVE_DIR_NAME/$INSTALL_PREFIX" + tar -czf "$archive_path" --transform "s/^/$ARCHIVE_DIR_NAME/" "$ARCHIVE_DIR_NAME" + popd + + echo "DEBUG" + tar tzvf "$archive_path" + echo "/DEBUG" + + # pkg + pkg_path="$PACKAGES_DIR/$ARCHIVE_DIR_NAME.pkg" pushd "$PACKAGES_DIR" pkgbuild \ --identifier com.gitguardian.ggshield \ --version "$VERSION" \ --root "$PACKAGES_DIR/$ARCHIVE_DIR_NAME" \ - "$archive_path" + "$pkg_path" popd if [ "$DO_SIGN" -eq 1 ] ; then - macos_sign_file "$archive_path" + macos_sign_file "$pkg_path" fi + info "Archive created in $pkg_path & $archive_path" ;; Windows) archive_path="$PACKAGES_DIR/$ARCHIVE_DIR_NAME.zip" pushd "$PACKAGES_DIR" 7z a "$archive_path" "$ARCHIVE_DIR_NAME" popd + info "Archive created in $archive_path" ;; esac - info "Archive created in $archive_path" } steps=""