Skip to content

Commit

Permalink
Add Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
grgar committed Mar 19, 2024
1 parent 0c0156c commit 45e1b2b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
all: publish

.SUFFIXES:

file = dotfiles-$(shell git describe).vsix
tag = $(shell git describe --abbrev=0 | awk -F. -v OFS=. '{$$NF++ ; print}')

.PHONY changelog: CHANGELOG.md
CHANGELOG.md: .git/refs/heads/main
echo "# Changelog\n### ${tag}" >$@
git log --oneline --decorate-refs='tags/*' --format="%(decorate:prefix=### ,suffix=%n,tag=)%n- %w(0,0,2)%B" >>$@

version: CHANGELOG.md
npm version ${tag} --no-git-tag-version
git add package.json package-lock.json CHANGELOG.md
git commit --amend --no-edit
git tag -afsm "" ${tag}
git push origin main ${tag}

.PHONY package: ${file}
${file}: version
npx vsce package

publish: ${package} CHANGELOG.md
npx vsce publish ${tag} -i ${package}
git log $(git describe --tags --abbrev=0 @^).. | gh release create ${tag} --notes-file - ${package}

0 comments on commit 45e1b2b

Please sign in to comment.