diff --git a/package.json b/package.json index 860a3e3..6862bdc 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/scripts/postversion.sh b/scripts/postversion.sh new file mode 100755 index 0000000..52d7dd5 --- /dev/null +++ b/scripts/postversion.sh @@ -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