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>
This commit is contained in:
Rajeh Taher 2024-06-05 00:38:10 +03:00 • committed by GitHub
commit 9847ebadb9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 1 deletions

View file

@ -4,7 +4,7 @@ on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
release_type: release_type:
description: "`alpha`, `alpha-minor`, `alpha-major` release?" description: "`alpha`, `alpha-minor`, `alpha-major`, `release-minor`, `release-patch` release?"
required: true required: true
default: "alpha" default: "alpha"

View file

@ -25,6 +25,16 @@ then
PRERELEASE='true' PRERELEASE='true'
VERSION_ARGS="premajor --preid alpha" VERSION_ARGS="premajor --preid alpha"
DIST_TAG="next" 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 else
echo 'Release Mode required' echo 'Release Mode required'
exit 1 exit 1
@ -57,8 +67,17 @@ echo "-----> BUMP VERSION"
echo "" echo ""
npm version $VERSION_ARGS || exit 1 npm version $VERSION_ARGS || exit 1
git push && git push --tags || 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` NEW_VERSION=`cat package.json | jq -r .version`
echo "New Version: $NEW_VERSION" echo "New Version: $NEW_VERSION"