Skip to content

Commit

Permalink
release & changelog scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
assafmo committed Jan 20, 2019
1 parent 8b4fc0c commit 2d2c858
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
debug
debug.test
.vscode
*pdf
*pdf
release
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## v1.1.0 (Jan 20, 2019)

- -o flag: extract only selected types

## v1.0.0 (Jan 20, 2019)

- extract ip4, ip6, domain, url, email, md5, sha1, sha256
13 changes: 13 additions & 0 deletions do_changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

echo '# Changelog' > "${ROOT_DIR}/CHANGELOG.md"

git log --decorate |
sed -r 's/.*?tag: ([0-9.v]+).*/## \1/' |
awk '/##/{printf $0} /Date:/{print " ("$3,$4",",$6")"} /^ /{print "-"$0}' |
sed 's/ / /' |
grep -vP '^ \(' |
grep -vP '^[ -]+v' |
sed -r 's/##/\n##/' >> "${ROOT_DIR}/CHANGELOG.md"
19 changes: 19 additions & 0 deletions do_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# build into ./release/
rm -rf release
mkdir -p release

VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))

# https://golang.org/doc/install/source#environment
GOOS=linux GOARCH=amd64 go build -o "release/xioc-linux64-${VERSION}"
GOOS=windows GOARCH=amd64 go build -o "release/xioc-win64-${VERSION}.exe"
GOOS=darwin GOARCH=amd64 go build -o "release/xioc-macos64-${VERSION}"

(
cd release
find -type f |
parallel --bar 'zip "$(echo "{}" | sed "s/.exe//").zip" "{}" && rm -f "{}"'
)

0 comments on commit 2d2c858

Please sign in to comment.