mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2024-12-25 06:18:58 +01:00
chore: remove standart-version, add scripts
This commit is contained in:
parent
d5d6b2bf50
commit
0d1a62d655
@ -15,8 +15,7 @@
|
||||
"lint": "concurrently \"yarn run lint:js\" \"yarn run lint:scss\" \"yarn flow\"",
|
||||
"test": "jest --config ./jest/jest-config.js",
|
||||
"test:coverage": "jest --coverage --config ./jest/jest-config.js",
|
||||
"test:watch": "jest --watch --config ./jest/jest-config.js",
|
||||
"release": "standard-version"
|
||||
"test:watch": "jest --watch --config ./jest/jest-config.js"
|
||||
},
|
||||
"repository": "https://github.com/alxshelepenok/gatsby-starter-lumen",
|
||||
"author": "Alexander Shelepenok <alxshelepenok@gmail.com>",
|
||||
@ -113,7 +112,6 @@
|
||||
"postcss-pxtorem": "4.0.1",
|
||||
"react-test-renderer": "16.8.6",
|
||||
"rimraf": "2.6.3",
|
||||
"standard-version": "6.0.1",
|
||||
"stylelint": "10.1.0",
|
||||
"stylelint-config-recommended-scss": "3.3.0",
|
||||
"stylelint-scss": "3.9.1"
|
||||
|
31
scripts/update_changelog_.sh
Normal file
31
scripts/update_changelog_.sh
Normal file
@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
usage() {
|
||||
echo "$0 <tag> <repo>" >&2;
|
||||
}
|
||||
|
||||
if [ "$1" = "-h" -o "$1" = "--help" ]; then
|
||||
usage
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if [ -z "$2" ]
|
||||
then
|
||||
REPO=$(git ls-remote --get-url origin | \
|
||||
sed -u 's/git@//g; s/https:\/\///g; s/github.com\///g; s/\.git//g')
|
||||
else
|
||||
REPO=$2
|
||||
fi
|
||||
|
||||
NEW_TAG=$1
|
||||
CURRENT_DATE=$(date +"%Y-%m-%d")
|
||||
|
||||
LAST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
|
||||
LAST_DATE=$(git log -1 --format=%ai $LAST_TAG)
|
||||
|
||||
CHANGES=$(curl -s "https://api.github.com/repos/${REPO}/pulls?state=closed" | \
|
||||
jq --arg l "$LAST_DATE" -r '.[] | select((.merged_at != null) and (.closed_at > $l)) | "- [Pull #\(.number)](\(.html_url)): \(.title)"')
|
||||
|
||||
sed -i "4i ## [$NEW_TAG] - $CURRENT_DATE\n### Added\n${CHANGES//$'\n'/\\$'\n'}\n" CHANGELOG.md
|
47
scripts/update_release_notes.sh
Normal file
47
scripts/update_release_notes.sh
Normal file
@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
usage() {
|
||||
echo "$0 <repo> <tag> [<release name>]" >&2;
|
||||
}
|
||||
|
||||
if [ "$1" = "-h" -o "$1" = "--help" ]; then
|
||||
usage
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
REPO=$(git ls-remote --get-url origin | \
|
||||
sed -u 's/git@//g; s/https:\/\///g; s/github.com\///g; s/\.git//g')
|
||||
else
|
||||
REPO=$1
|
||||
fi
|
||||
|
||||
if [ -z "$2" ]
|
||||
then
|
||||
TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
|
||||
else
|
||||
TAG=$2
|
||||
fi
|
||||
|
||||
BODY=$(awk "/$TAG/ {print; exit}" RS="\n\n" ORS="\n\n" CHANGELOG.md | tail -n+2)
|
||||
|
||||
PAYLOAD=$(
|
||||
jq --null-input \
|
||||
--arg t "$TAG" \
|
||||
--arg n "$TAG" \
|
||||
--arg b "$BODY" \
|
||||
'{ tag_name: $t, name: $n, body: $b}'
|
||||
)
|
||||
|
||||
TAG_ID=$(curl -s "https://api.github.com/repos/$REPO/releases/tags/$TAG" | jq -r '.id')
|
||||
|
||||
curl --fail \
|
||||
--netrc \
|
||||
--silent \
|
||||
--location \
|
||||
--request PATCH \
|
||||
--data "$PAYLOAD" \
|
||||
"https://api.github.com/repos/${REPO}/releases/${TAG_ID}"
|
Loading…
Reference in New Issue
Block a user