chore(devenv): Add release script and rename changelog script to gen-changelog

This commit is contained in:
Evan Fiordeliso 2024-03-08 13:24:43 -05:00
parent 9c4e63c200
commit 7fa9815a37
1 changed files with 16 additions and 4 deletions

View File

@ -2,10 +2,14 @@
{
# https://devenv.sh/basics/
env.PROJECT_NAME = "go-twitch";
env = {
PROJECT_NAME = "go-twitch";
env.MOCK_DATA_PATH = "~/.config/twitch-cli/eventCache.db";
env.MOCK_API_PORT = "3000";
MOCK_DATA_PATH = "~/.config/twitch-cli/eventCache.db";
MOCK_API_PORT = "3000";
CHANGELOG_FILE = "CHANGELOG.md";
};
# https://devenv.sh/packages/
packages = with pkgs; [
@ -21,7 +25,15 @@
echo "Golang version: $(go version | cut -d ' ' -f 3)"
'';
changelog.exec = "git cliff -o CHANGELOG.md";
gen-changelog.exec = "git cliff -o $CHANGELOG_FILE";
release.exec = ''
version = "$(git cliff --bumped-version)"
gen-changelog
git add $CHANGELOG_FILE
git commit -m "chore: Update changelog and bump version"
git tag "$version" -m "Release $version"
git push --tags
'';
gen-mock-data.exec = "twitch-cli mock-api generate";
rm-mock-data.exec = "rm $MOCK_DATA_PATH";