Skip to content

Commit

Permalink
Merge pull request #55 from ojonathacardoso/master
Browse files Browse the repository at this point in the history
Release: 3.0.2
  • Loading branch information
ojonathacardoso authored Feb 22, 2021
2 parents c27d7a2 + 1d80b99 commit 37a6ea3
Show file tree
Hide file tree
Showing 47 changed files with 2,473 additions and 177 deletions.
46 changes: 46 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env bash

##
## Versioning info: [major].[minor].[patch], example: 3.0.112, 3.1.23
##

VERSION_PATTERN='([0-9]+)\.([0-9]+)\.([0-9]+)?'

LATEST_VERSION=$(git tag --sort=committerdate | egrep $VERSION_PATTERN | tail -1)

LAST_DIGIT=`echo $LATEST_VERSION | cut -f 3 -d '.'`
MAIN_REV=`echo $LATEST_VERSION | cut -f 1,2 -d '.'`
NEXT_NUMBER=$(($LAST_DIGIT + 1))
NEXT_VERSION=$MAIN_REV'.'$NEXT_NUMBER

FINAL_VERSION=

function change_files {

echo "Atualizando de "$LATEST_VERSION" para "$NEXT_VERSION"..."

sed -E -i "s|$LATEST_VERSION|$NEXT_VERSION|g" saap/templates/base.html

sed -E -i "s|$LATEST_VERSION|$NEXT_VERSION|g" saap/settings.py
}

function commit_and_push {
echo "Criando o commit..."

git add .
git commit -m "Release: $NEXT_VERSION"
git tag $NEXT_VERSION

echo "Versão criada e gerada localmente."

echo "Enviando para o GitHub a versão $NEXT_VERSION..."

git push origin master

echo "Concluído"
}

git fetch
echo "Release atual: "$LATEST_VERSION
change_files
commit_and_push
Loading

0 comments on commit 37a6ea3

Please sign in to comment.