<commit_before>#!/bin/bash
set -e

# to be called with
# GOOS=linux GOARCH=amd64 bash ./scripts/release.sh

BIN_NAME=digo

# revision and version
PROJECT_ROOT=$(grealpath $(dirname $0)/../)
GIT_COMMIT=$(git rev-parse --short HEAD)
GIT_STATUS=$(test -n "`git status --porcelain`" && echo "+CHANGES" || echo "")
GIT_REV=$GIT_COMMIT$GIT_STATUS
VERSION=$(grep VERSION $PROJECT_ROOT/constants.go | cut -d '"' -f 2)

# dirs and paths
RELEASE_PATH=$PROJECT_ROOT/releases/$GIT_REV
NAME=$BIN_NAME-v$VERSION.$GOOS.$GOARCH
RELEASE_TMP_DIR=$RELEASE_PATH/$NAME
RELEASE_BIN=$RELEASE_TMP_DIR/$BIN_NAME

cd digo
echo "building in $RELEASE_PATH"
mkdir -p $RELEASE_TMP_DIR
go build -a -ldflags "-X main.GITCOMMIT $GIT_REV" -o $RELEASE_BIN
chmod a+x $RELEASE_BIN<commit_msg>update release scrip<commit_after>#!/bin/bash
set -e

# to be called with
# GOOS=linux GOARCH=amd64 bash ./scripts/release.sh

BIN_NAME=digo

# revision and version
PROJECT_ROOT=$(grealpath $(dirname $0)/../)
GIT_COMMIT=$(git rev-parse --short HEAD)
GIT_STATUS=$(test -n "`git status --porcelain`" && echo "+CHANGES" || echo "")
GIT_REV=$GIT_COMMIT$GIT_STATUS
VERSION=$(grep VERSION $PROJECT_ROOT/constants.go | cut -d '"' -f 2)

# dirs and paths
RELEASE_PATH=/tmp/$BIN_NAME/releases/$GIT_REV
NAME=$BIN_NAME-v$VERSION.$GOOS.$GOARCH
RELEASE_TMP_DIR=$RELEASE_PATH/$NAME
RELEASE_BIN=$RELEASE_TMP_DIR/$BIN_NAME

cd digo
echo "building in $RELEASE_PATH"
mkdir -p $RELEASE_TMP_DIR
go build -a -ldflags "-X main.GITCOMMIT $GIT_REV" -o $RELEASE_BIN
chmod a+x $RELEASE_BIN
{'fraction_non_alphanumeric': 0.14756258234519104, 'fraction_numerical': 0.005270092226613966, 'mean_word_length': 5.575757575757576, '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': '2532620', 'n_tokens_mistral': 620, 'n_tokens_neox': 590, 'n_words': 133}