From 9847ebadb976d6ba6c8f0a708e6cf04d7d030a6a Mon Sep 17 00:00:00 2001 From: Rajeh Taher Date: Wed, 5 Jun 2024 00:38:10 +0300 Subject: [PATCH] Make an NPM release via GitHub (#2942) * Update release.yml * Update publish * Update release.yml * Update publish * Update publish: publish new docs before new version release * Update publish * Update publish --------- Co-authored-by: alechkos <93551621+alechkos@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- tools/publish | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a5e1d3d..2177fd0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: release_type: - description: "`alpha`, `alpha-minor`, `alpha-major` release?" + description: "`alpha`, `alpha-minor`, `alpha-major`, `release-minor`, `release-patch` release?" required: true default: "alpha" diff --git a/tools/publish b/tools/publish index c3a6a97..9dd0da0 100755 --- a/tools/publish +++ b/tools/publish @@ -25,6 +25,16 @@ then PRERELEASE='true' VERSION_ARGS="premajor --preid alpha" DIST_TAG="next" +elif [[ "$RELEASE_MODE" == "release-patch" ]] +then + PRERELEASE='false' + VERSION_ARGS="patch" + DIST_TAG="latest" +elif [[ "$RELEASE_MODE" == "release-minor" ]] +then + PRERELEASE='false' + VERSION_ARGS="minor" + DIST_TAG="latest" else echo 'Release Mode required' exit 1 @@ -57,8 +67,17 @@ echo "-----> BUMP VERSION" echo "" npm version $VERSION_ARGS || exit 1 + git push && git push --tags || exit 1 +npm run generate-docs + +git add . + +git commit -am "chore(${NEW_VERSION}): generate docs" + +git push + NEW_VERSION=`cat package.json | jq -r .version` echo "New Version: $NEW_VERSION"