updated postversion script

This commit is contained in:
Jeff Dickey 2023-12-14 08:49:28 -06:00
parent 015cd77f75
commit 0e7eb33465
No known key found for this signature in database
GPG key ID: 584DADE86724B407
2 changed files with 15 additions and 2 deletions

View file

@ -24,8 +24,8 @@
"lint": "npx eslint . -c ./.github/linters/.eslintrc.yml",
"package": "ncc build src/index.ts --license licenses.txt",
"package:watch": "npm run package -- --watch",
"prepare": "husky install",
"postversion": "git push origin v$(jq -r .version package.json) && git tag v1 -f && git push origin v1 -f"
"postversion": "./scripts/postversion.sh",
"prepare": "husky install"
},
"license": "MIT",
"dependencies": {

13
scripts/postversion.sh Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -euxo pipefail
VERSION=$(jq -r .version package.json)
# push the current tag to github
git push origin "v$VERSION"
# set the v1 tag to this release
git tag v1 -f
# push the v1 tag to github
git push origin v1 -f
# create a release on github
gh release create "v$VERSION" --generate-notes --verify-tag