-
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.
create justfile and add some scripts to it
- Loading branch information
Showing
1 changed file
with
43 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 |
---|---|---|
@@ -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 -- |