Skip to content

Commit

Permalink
justfile: update "release" recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
rszyma committed Nov 23, 2023
1 parent bf320e4 commit be58687
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ install:
make package
code --install-extension kanata.vsix

# Creates a commit that updates kanata to latest git and adds notice about it to CHANGELOG.md
# Creates a commit, that updates kanata to latest git and adds notice about it to CHANGELOG.md
bump_kanata:
#!/bin/sh
set -euxo pipefail
Expand All @@ -22,23 +22,19 @@ bump_kanata:
git add CHANGELOG.md kanata
git commit -m "chore: bump kanata to $HASH"

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

just _ensure_no_staged_changes
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 commmit -m "Release v{{VERSION}}"
git push origin release-v{{VERSION}}

vsce publish {{VERSION}}
git add CHANGELOG.md package.json
git commit -m "Release v{{VERSION}}"
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
Expand Down

0 comments on commit be58687

Please sign in to comment.