<commit_before>#!/bin/bash
RELEASE="v$1"
CURRENT="$(git tag | tail -n1)"
echo "Creating release $1..."

#go get golang.org/x/tools/cmd/cover
go test -v -cover ./lib

# go get github.com/mitchellh/gox
# gox -build-toolchain
gox -osarch="linux/amd64 darwin/amd64" ./...

git tag "$RELEASE"
git push origin "$RELEASE"

LOG="$(git log --pretty=oneline --abbrev-commit "$CURRENT"..HEAD)"

# go get github.com/aktau/github-release
github-release release \
  --user caarlos0 \
  --repo antibody \
  --tag "$RELEASE" \
  --name "$2" \
  --description "$LOG" \
  --pre-release

if [ "$(uname -s)" = "Darwin" ]; then
  alias tar="gtar"
fi

for platform in Darwin Linux; do
  filename="antibody-$RELEASE-$platform.tar.gz"
  platform_lower="$(echo $platform | tr '[:upper:]' '[:lower:]')"
  tar \
    --transform="s/_${platform_lower}_amd64//" \
    -cvzf "$filename" \
    "antibody_${platform_lower}_amd64" antibody.zsh
  github-release upload \
    --user caarlos0 \
    --repo antibody \
    --tag "$RELEASE" \
    --name "$filename" \
    --file "$filename"
done<commit_msg>fixed osx path to use gnu tar<commit_after>#!/bin/bash
RELEASE="v$1"
CURRENT="$(git tag | tail -n1)"
echo "Creating release $1..."

#go get golang.org/x/tools/cmd/cover
go test -v -cover ./lib

# go get github.com/mitchellh/gox
# gox -build-toolchain
gox -osarch="linux/amd64 darwin/amd64" ./...

git tag "$RELEASE"
git push origin "$RELEASE"

LOG="$(git log --pretty=oneline --abbrev-commit "$CURRENT"..HEAD)"

# go get github.com/aktau/github-release
github-release release \
  --user caarlos0 \
  --repo antibody \
  --tag "$RELEASE" \
  --name "$2" \
  --description "$LOG" \
  --pre-release

if [ "$(uname -s)" = "Darwin" ]; then
  PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"
fi

for platform in Darwin Linux; do
  filename="antibody-$RELEASE-$platform.tar.gz"
  platform_lower="$(echo $platform | tr '[:upper:]' '[:lower:]')"
  tar \
    --transform="s/_${platform_lower}_amd64//" \
    -cvzf "$filename" \
    "antibody_${platform_lower}_amd64" antibody.zsh
  github-release upload \
    --user caarlos0 \
    --repo antibody \
    --tag "$RELEASE" \
    --name "$filename" \
    --file "$filename"
done
{'fraction_non_alphanumeric': 0.19093406593406592, 'fraction_numerical': 0.01282051282051282, 'mean_word_length': 3.0091743119266057, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7513825', 'n_tokens_mistral': 844, 'n_tokens_neox': 780, 'n_words': 190}