-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
/.env | ||
/coverage | ||
/dev/mock-curl-output.json | ||
/dev/*.tgz | ||
/dev/inform-slack/** | ||
/test-results.tap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Changelog # | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog][changelog], and this project | ||
adheres to [Semantic Versioning][semver]. | ||
|
||
[changelog]: https://keepachangelog.com/en/1.0.0/ | ||
[semver]: https://semver.org/spec/v2.0.0.html | ||
|
||
## [Unreleased] | ||
|
||
## [v1.0.0] - 2021-10-01 | ||
|
||
- First actual release | ||
|
||
[Unreleased]: https://github.com/jasonk/inform-slack/compare/v1.0.0...HEAD | ||
[v1.0.0]: https://github.com/jasonk/inform-slack/releases/tag/v1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env bash | ||
cd "$(dirname "$0")" | ||
|
||
REPO="https://github.com/jasonk/inform-slack" | ||
|
||
warn() { echo "$@" 1>&2; } | ||
die() { warn "$@"; exit 1; } | ||
|
||
# Executable Version | ||
EV="$(../bin/inform-slack --version)" | ||
# Changelog Info | ||
CI="$(grep -E '^## \[v([0-9\.]+)\]' ../CHANGELOG.md | head -1 | tr -d '\[\]#')" | ||
# Changelog Version | ||
CV="$(awk '{print $1}' <<<"$CI")" | ||
# Changelog Date | ||
CD="$(awk '{print $3}' <<<"$CI")" | ||
# Today's Date | ||
TD="$(date +%F)" | ||
|
||
if [ "$TD" != "$CD" ]; then | ||
die "Today is $TD, but latest Changelog entry is $CD" | ||
fi | ||
if [ "$CV" != "$EV" ]; then | ||
die "Executable version is $EV, but Changelog version is $CV" | ||
fi | ||
|
||
UR="$(grep -E '^\[Unreleased\]:' ../CHANGELOG.md)" | ||
if [ -z "$UR" ]; then die "No [Unreleased] URL in CHANGELOG"; fi | ||
if [ "$(basename "$UR")" != "${EV}...HEAD" ]; then | ||
die "Wrong [Unreleased] URL in CHANGELOG"; | ||
fi | ||
|
||
if ! grep -qE "^\[$EV\]: $REPO/releases/tag/$EV$" ../CHANGELOG.md; then | ||
die "No [$EV] tag in CHANGELOG"; | ||
fi | ||
|
||
if git rev-parse -q --verify "refs/tags/$EV" >/dev/null; then | ||
die "Version $EV is already tagged, did you remember to increment it?" | ||
fi | ||
|
||
if [ -n "$(git status --porcelain=v1 2>/dev/null)" ]; then | ||
die "The repo has uncommitted changes" | ||
fi | ||
|
||
git tag -a "$EV" -m ":shipit: Release $EV" | ||
git push origin "$EV" | ||
|
||
rm -rf inform-slack | ||
mkdir inform-slack | ||
cp -a ../*.md ../LICENSE ../bin ../builders ../lib inform-slack | ||
tar cvfz "inform-slack-${EV}.tgz" inform-slack | ||
gh release create "$EV" "inform-slack-${EV}.tgz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters