Skip to content

Commit

Permalink
Added Makefile and release script
Browse files Browse the repository at this point in the history
  • Loading branch information
prologic committed Jan 25, 2020
1 parent 09a9260 commit f4ca24a
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.PHONY: image release clean

all: image

image:
@docker build -t prologic/action-remark-lint .

release:
@./tools/release.sh

clean:
@git clean -f -d -X
30 changes: 30 additions & 0 deletions tools/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh

# Get the highest tag number
VERSION="$(git describe --abbrev=0 --tags)"
VERSION=${VERSION:-'v0.0.0'}

# Strip the v prefix
VERSION="$(echo "$VERSION" | sed -e 's/^v\(.*\)/\1/')"

# Get number parts
MAJOR="${VERSION%%.*}"
VERSION="${VERSION#*.}"
MINOR="${VERSION%%.*}"
VERSION="${VERSION#*.}"
PATCH="${VERSION%%.*}"
VERSION="${VERSION#*.}"

# Increase version
PATCH=$((PATCH + 1))

TAG="${1}"

if [ x"${TAG}" = x"" ]; then
TAG="v${MAJOR}.${MINOR}.${PATCH}"
fi

echo "Releasing ${TAG} ..."

git tag -a -s -m "Release ${TAG}" "${TAG}"
git push --tags

0 comments on commit f4ca24a

Please sign in to comment.