Here are two solutions, one where n files are added to a single archive and one where all the files are first concatenated and then zipped.
Common steps to both approaches are:
# Generate a list of files to be zipped
find . -type f > filelist
# Loop to process n files stepwise
n=50000
fileno=1
for i in $(seq 1 $n $(wc -l < filelist)); do
# compression code goes here, see below
done
Zip files individually
# automatic name generation
zipfile=$(printf "%04d" $((fileno++)))
# extract lines $i to $i+$n-1 from filelist
sed -n "$i,$((i+n-1))p" filelist | zip $zipfile -@
Concatenate and zip
If you wanted to do this with gzip (and other compressors) it would be quite simple:
zipfile=$(printf "%04d" $((fileno++)))
sed -n "$i,$((i+n-1))p" filelist | xargs cat | gzip > $zipfile.gz
As zip doesn't support this mode (at least not the one I have), you need a different approach. zip supports named pipes (-FI) where the file inside the archive gets the name of the named pipe, so doing something like this inside the loop should work:
zipfile=$(printf "%04d" $((fileno++)))
mkfifo $zipfile
zip -FI $zipfile $zipfile &
sed -n "$i,$((i+n-1))p" filelist | xargs cat > $zipfile
rm $zipfile