<commit_before>#!/bin/sh -e
# Copyright 2009 <NAME>.

. "buildtools/Common.sh"

# print warning if current HEAD is not a signed/annotated tag
TAGGED=""

# for signed tags $HEAD will be "2.0" or similar
# for unsigned tags or untagged commits will be "2.0-5-g08867ea" or similar
HEAD=$(git describe)
for TAG in $(git tag)
do
  if [ $TAG = $HEAD ]; then
    TAGGED=$TAG
  fi
done
if [ -z "$TAGGED" ]; then
  warn "current HEAD is not tagged/annotated, but it should be for official releases"
  TAGGED=$HEAD
fi

# prep binary -> zip installer pkg
rm -f "$BUILT_PRODUCTS_DIR/$PROJECT-$TAGGED.zip"
zip -j "$BUILT_PRODUCTS_DIR/$PROJECT-$TAGGED.zip" \
       "$BUILT_PRODUCTS_DIR/WincentIconUtility.pkg"

# prep source archive
git archive $TAGGED > "$BUILT_PRODUCTS_DIR/$PROJECT-$TAGGED-src.tar"

# add submodules to archive
git ls-tree $TAGGED | grep '^160000 ' | \
while read mode type sha1 path
do
  rm -rf "$PROJECT_TEMP_DIR/$PROJECT-$TAGGED-$path-src/$path"
  mkdir -p "$PROJECT_TEMP_DIR/$PROJECT-$TAGGED-$path-src/$path"
  (cd $path && git archive $sha1 | tar -xf - -C "$PROJECT_TEMP_DIR/$PROJECT-$TAGGED-$path-src/$path")
  tar -rf "$BUILT_PRODUCTS_DIR/$PROJECT-$TAGGED-src.tar" \
       -C "$PROJECT_TEMP_DIR/$PROJECT-$TAGGED-$path-src" $path
done
bzip2 -f "$BUILT_PRODUCTS_DIR/$PROJECT-$TAGGED-src.tar"

# prep release notes<commit_msg>distro.sh: distribute package file without zip wrapper<commit_after>#!/bin/sh -e
# Copyright 2009 <NAME>.

. "buildtools/Common.sh"

# print warning if current HEAD is not a signed/annotated tag
TAGGED=""

# for signed tags $HEAD will be "2.0" or similar
# for unsigned tags or untagged commits will be "2.0-5-g08867ea" or similar
HEAD=$(git describe)
for TAG in $(git tag)
do
  if [ $TAG = $HEAD ]; then
    TAGGED=$TAG
  fi
done
if [ -z "$TAGGED" ]; then
  warn "current HEAD is not tagged/annotated, but it should be for official releases"
  TAGGED=$HEAD
fi

# give installer package unique name prior to uploading
mv "$BUILT_PRODUCTS_DIR/WincentIconUtility.pkg" \
   "$BUILT_PRODUCTS_DIR/$PROJECT-$TAGGED.pkg"

# prep source archive
git archive $TAGGED > "$BUILT_PRODUCTS_DIR/$PROJECT-$TAGGED-src.tar"

# add submodules to archive
git ls-tree $TAGGED | grep '^160000 ' | \
while read mode type sha1 path
do
  rm -rf "$PROJECT_TEMP_DIR/$PROJECT-$TAGGED-$path-src/$path"
  mkdir -p "$PROJECT_TEMP_DIR/$PROJECT-$TAGGED-$path-src/$path"
  (cd $path && git archive $sha1 | tar -xf - -C "$PROJECT_TEMP_DIR/$PROJECT-$TAGGED-$path-src/$path")
  tar -rf "$BUILT_PRODUCTS_DIR/$PROJECT-$TAGGED-src.tar" \
       -C "$PROJECT_TEMP_DIR/$PROJECT-$TAGGED-$path-src" $path
done
bzip2 -f "$BUILT_PRODUCTS_DIR/$PROJECT-$TAGGED-src.tar"

# prep release notes
{'fraction_non_alphanumeric': 0.13875419619544946, 'fraction_numerical': 0.017157776948899663, 'mean_word_length': 4.060377358490566, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '587005', 'n_tokens_mistral': 1053, 'n_tokens_neox': 1014, 'n_words': 272}