Skip to content

Commit

Permalink
create justfile and add some scripts to it
Browse files Browse the repository at this point in the history
  • Loading branch information
rszyma committed Nov 23, 2023
1 parent bfe4bc1 commit 116ea12
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
_default:
@just -l --unsorted

install:
git submodule update
make package
code --install-extension kanata.vsix

# Updates kanata to latest git + adds notice about it to CHANGELOG.md
bump_kanata:
#!/bin/sh
git submodule update --remote &&
cd kanata &&
HASH=$(git rev-parse --short HEAD) &&
echo "$HASH" &&
cd .. &&
# Exit early without updating changelog if a bump notice was already added in "Unreleased" section.
! grep -q "$HASH" CHANGELOG.md &&
sed '/Updated kanata to/Id' CHANGELOG.md &&
just add_to_changelog "Updated kanata to [$HASH]\(https://github.com/jtroo/kanata/tree/$HASH\)"

# Bumps version number, pushes a "new version" commit/tags, builds, uploads to VS Code marketplace.
release VERSION:
just _ensure_clean_directory

git checkout main
git pull
git checkout -b release-v{{VERSION}}
sed -i 's/\"version\": \"[^\"]*\"/\"version\": \"{{VERSION}}\"/' package.json
sed -i 's/### Unreleased/### Unreleased\n\n* no changes yet\n\n### {{VERSION}}/' CHANGELOG.md
git push

git tag v{{VERSION}}
git push --tags

# vsce publish {{VERSION}}

add_to_changelog TEXT:
sed -i '/no changes yet/Id' CHANGELOG.md
sed -i "N;s/^### Unreleased\n/\0\n\* {{TEXT}}/" CHANGELOG.md

_ensure_clean_directory:
git diff-index --quiet HEAD --

0 comments on commit 116ea12

Please sign in to comment.