Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed publish NodeJS versions to v22 and Fixed scripts, etc #49

Merged
merged 1 commit into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ name: Node.js AntPickax CI
#
on:
push:
branches-ignore:
- 'gh-pages'
tags:
- '*'
pull_request:
#
# CRON event is fire on every sunday(UTC).
Expand Down Expand Up @@ -77,6 +81,7 @@ jobs:
# NODEJS_TYPE_VARS_FILE : specify custom variables file
# * NPM_TOKEN : The token for publishing to npm
# FORCE_PUBLISHER : nodejs major version to publish packages
# FORCE_NOT_PUBLISHER : do not allow to publish any packages(for forked repository)
# USE_PACKAGECLOUD_REPO : true means using pacakgecloud.io repo, false is not using
# PACKAGECLOUD_OWNER : owner name as a pat of path to packagcloud.io for downloading
# PACKAGECLOUD_DOWNLOAD_REPO : repo name as a pat of path to packagcloud.io for downloading
Expand All @@ -88,6 +93,7 @@ jobs:
echo "ENV_NODEJS_TYPE_VARS_FILE=${{ secrets.NODEJS_TYPE_VARS_FILE }}" >> "${GITHUB_ENV}"
echo "ENV_NPM_TOKEN=${{ secrets.NPM_TOKEN }}" >> "${GITHUB_ENV}"
echo "ENV_FORCE_PUBLISHER=${{ secrets.FORCE_PUBLISHER }}" >> "${GITHUB_ENV}"
echo "ENV_FORCE_NOT_PUBLISHER=${{ secrets.FORCE_NOT_PUBLISHER }}" >> "${GITHUB_ENV}"
echo "ENV_USE_PACKAGECLOUD_REPO=${{ secrets.USE_PACKAGECLOUD_REPO }}" >> "${GITHUB_ENV}"
echo "ENV_PACKAGECLOUD_OWNER=${{ secrets.PACKAGECLOUD_OWNER }}" >> "${GITHUB_ENV}"
echo "ENV_PACKAGECLOUD_DOWNLOAD_REPO=${{ secrets.PACKAGECLOUD_DOWNLOAD_REPO }}" >> "${GITHUB_ENV}"
Expand Down
61 changes: 44 additions & 17 deletions .github/workflows/nodejs_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#
# AUTHOR: Takeshi Nakatani
# CREATE: Tue, Nov 24 2020
# REVISION: 1.3
# REVISION: 1.5
#

#==============================================================
Expand Down Expand Up @@ -71,6 +71,7 @@ CI_PACKAGECLOUD_OWNER="antpickax"
CI_PACKAGECLOUD_DOWNLOAD_REPO="stable"
CI_NPM_TOKEN=""
CI_FORCE_PUBLISHER=""
CI_FORCE_NOT_PUBLISHER=0

CI_IN_SCHEDULE_PROCESS=0
CI_PUBLISH_TAG_NAME=""
Expand Down Expand Up @@ -169,6 +170,7 @@ func_usage()
echo " --nodejstype-vars-file(-f) <file path> specify the file that describes the package list to be installed before build(default is nodejstypevars.sh)"
echo " --npm-token(-token) <token> npm token for uploading(specify when uploading)"
echo " --force-publisher(-fp) <version> specify publisher node major version(ex. 10/11/12)."
echo " --force-not-publisher(-np) do not allow to publish any packages."
echo ""
echo " Option for packagecloud.io:"
echo " --use-packagecloudio-repo(-usepc) use packagecloud.io repository(default), exclusive -notpc option"
Expand All @@ -180,6 +182,7 @@ func_usage()
echo " ENV_NODEJS_TYPE_VARS_FILE the file for custom variables ( same as option '--nodejstype-vars-file(-f)' )"
echo " ENV_NPM_TOKEN the token for publishing to npm ( same as option '--npm-token(-token)' )"
echo " ENV_FORCE_PUBLISHER nodejs major version to publish packages ( same as option '--force-publisher(-fp)' )"
echo " ENV_FORCE_NOT_PUBLISHER do not allow to publish any packages ( same as option '--force-not-publisher(-np)' )"
echo " ENV_USE_PACKAGECLOUD_REPO use packagecloud.io repository: true/false ( same as option '--use-packagecloudio-repo(-usepc)' and '--not-use-packagecloudio-repo(-notpc)' )"
echo " ENV_PACKAGECLOUD_OWNER owner name for uploading to packagecloud.io ( same as option '--packagecloudio-owner(-pcowner)' )"
echo " ENV_PACKAGECLOUD_DOWNLOAD_REPO repository name of installing packages in packagecloud.io ( same as option '--packagecloudio-download-repo(-pcdlrepo)' )"
Expand Down Expand Up @@ -531,6 +534,7 @@ PRNTITLE "Start to check options and environments"
OPT_NODEJS_TYPE=""
OPT_NODEJS_TYPE_VARS_FILE=""
OPT_FORCE_PUBLISHER=""
OPT_FORCE_NOT_PUBLISHER=0
OPT_USE_PACKAGECLOUD_REPO=
OPT_PACKAGECLOUD_OWNER=""
OPT_PACKAGECLOUD_DOWNLOAD_REPO=""
Expand All @@ -540,11 +544,11 @@ while [ $# -ne 0 ]; do
if [ -z "$1" ]; then
break

elif [ "$1" = "-h" ] || [ "$1" = "-H" ] || [ "$1" = "--help" ] || [ "$1" = "--HELP" ]; then
elif echo "$1" | grep -q -i -e "^-h$" -e "^--help$"; then
func_usage "${PRGNAME}"
exit 0

elif [ "$1" = "-node" ] || [ "$1" = "-NODE" ] || [ "$1" = "--nodejstype" ] || [ "$1" = "--NODEJSTYPE" ]; then
elif echo "$1" | grep -q -i -e "^-node$" -e "^--nodejstype$"; then
if [ -n "${OPT_NODEJS_TYPE}" ]; then
PRNERR "already set \"--nodejstype(-node)\" option."
exit 1
Expand All @@ -556,7 +560,7 @@ while [ $# -ne 0 ]; do
fi
OPT_NODEJS_TYPE="$1"

elif [ "$1" = "-f" ] || [ "$1" = "-F" ] || [ "$1" = "--nodejstype-vars-file" ] || [ "$1" = "--NODEJSTYPE-VARS-FILE" ]; then
elif echo "$1" | grep -q -i -e "^-f$" -e "^--nodejstype-vars-file$"; then
if [ -n "${OPT_NODEJS_TYPE_VARS_FILE}" ]; then
PRNERR "already set \"--nodejstype-vars-file(-f)\" option."
exit 1
Expand All @@ -572,9 +576,9 @@ while [ $# -ne 0 ]; do
fi
OPT_NODEJS_TYPE_VARS_FILE="$1"

elif [ "$1" = "-fp" ] || [ "$1" = "-FP" ] || [ "$1" = "--force-publisher" ] || [ "$1" = "--FORCE-PUBLISHER" ]; then
elif echo "$1" | grep -q -i -e "^-fp$" -e "^--force-publisher$"; then
if [ -n "${OPT_FORCE_PUBLISHER}" ]; then
PRNERR "already set \"--force-publisher(-fp)\" or \"--not-publish(-np)\" option."
PRNERR "already set \"--force-publisher(-fp)\" option."
exit 1
fi
shift
Expand All @@ -588,21 +592,28 @@ while [ $# -ne 0 ]; do
fi
OPT_FORCE_PUBLISHER="$1"

elif [ "$1" = "-usepc" ] || [ "$1" = "-USEPC" ] || [ "$1" = "--use-packagecloudio-repo" ] || [ "$1" = "--USE-PACKAGECLOUDIO-REPO" ]; then
elif echo "$1" | grep -q -i -e "^-np$" -e "^--force-not-publisher$"; then
if [ "${OPT_FORCE_NOT_PUBLISHER}" -ne 0 ]; then
PRNERR "already set \"--force-not-publisher(-np)\" option."
exit 1
fi
OPT_FORCE_NOT_PUBLISHER="$1"

elif echo "$1" | grep -q -i -e "^-usepc$" -e "^--use-packagecloudio-repo$"; then
if [ -n "${OPT_USE_PACKAGECLOUD_REPO}" ]; then
PRNERR "already set \"--use-packagecloudio-repo(-usepc)\" or \"--not-use-packagecloudio-repo(-notpc)\" option."
exit 1
fi
OPT_USE_PACKAGECLOUD_REPO=1

elif [ "$1" = "-notpc" ] || [ "$1" = "-NOTPC" ] || [ "$1" = "--not-use-packagecloudio-repo" ] || [ "$1" = "--NOT-USE-PACKAGECLOUDIO-REPO" ]; then
elif echo "$1" | grep -q -i -e "^-notpc$" -e "^--not-use-packagecloudio-repo$"; then
if [ -n "${OPT_USE_PACKAGECLOUD_REPO}" ]; then
PRNERR "already set \"--use-packagecloudio-repo(-usepc)\" or \"--not-use-packagecloudio-repo(-notpc)\" option."
exit 1
fi
OPT_USE_PACKAGECLOUD_REPO=0

elif [ "$1" = "-token" ] || [ "$1" = "-TOKEN" ] || [ "$1" = "--npm-token" ] || [ "$1" = "--NPM-TOKEN" ]; then
elif echo "$1" | grep -q -i -e "^-token$" -e "^--npm-token$"; then
if [ -n "${OPT_NPM_TOKEN}" ]; then
PRNERR "already set \"--npm-token(-token)\" option."
exit 1
Expand All @@ -614,7 +625,7 @@ while [ $# -ne 0 ]; do
fi
OPT_NPM_TOKEN="$1"

elif [ "$1" = "-pcowner" ] || [ "$1" = "-PCOWNER" ] || [ "$1" = "--packagecloudio-owner" ] || [ "$1" = "--PACKAGECLOUDIO-OWNER" ]; then
elif echo "$1" | grep -q -i -e "^-pcowner$" -e "^--packagecloudio-owner$"; then
if [ -n "${OPT_PACKAGECLOUD_OWNER}" ]; then
PRNERR "already set \"--packagecloudio-owner(-pcowner)\" option."
exit 1
Expand All @@ -626,7 +637,7 @@ while [ $# -ne 0 ]; do
fi
OPT_PACKAGECLOUD_OWNER="$1"

elif [ "$1" = "-pcdlrepo" ] || [ "$1" = "-PCDLREPO" ] || [ "$1" = "--packagecloudio-download-repo" ] || [ "$1" = "--PACKAGECLOUDIO-DOWNLOAD-REPO" ]; then
elif echo "$1" | grep -q -i -e "^-pcdlrepo$" -e "^--packagecloudio-download-repo$"; then
if [ -n "${OPT_PACKAGECLOUD_DOWNLOAD_REPO}" ]; then
PRNERR "already set \"--packagecloudio-download-repo(-pcdlrepo)\" option."
exit 1
Expand Down Expand Up @@ -680,6 +691,19 @@ elif [ -n "${ENV_FORCE_PUBLISHER}" ]; then
CI_FORCE_PUBLISHER="${ENV_FORCE_PUBLISHER}"
fi

if [ "${OPT_FORCE_NOT_PUBLISHER}" -ne 0 ]; then
CI_FORCE_NOT_PUBLISHER=1
elif [ -n "${ENV_FORCE_NOT_PUBLISHER}" ]; then
if [ "${ENV_FORCE_NOT_PUBLISHER}" = "true" ] || [ "${ENV_FORCE_NOT_PUBLISHER}" -eq 1 ]; then
CI_FORCE_NOT_PUBLISHER=1
fi
fi

if [ -n "${CI_FORCE_PUBLISHER}" ] && [ "${CI_FORCE_NOT_PUBLISHER}" -ne 0 ]; then
PRNERR "\"FORCE_PUBLISHER\"(ENV or --force-publisher(-fp) option) and \"FORCE_NOT_PUBLISHER\"(ENV or --force-not-publisher(-np) option) cannot be specified together."
exit 1
fi

if [ -n "${OPT_USE_PACKAGECLOUD_REPO}" ]; then
if [ "${OPT_USE_PACKAGECLOUD_REPO}" -eq 1 ]; then
CI_USE_PACKAGECLOUD_REPO=1
Expand Down Expand Up @@ -793,13 +817,15 @@ PRNTITLE "Check whether to execute processes"
#
# Check whether to publish
#
if [ "${IS_PUBLISHER}" -eq 1 ] || { [ -n "${CI_FORCE_PUBLISHER}" ] && [ "${CI_FORCE_PUBLISHER}" = "${CI_NODEJS_MAJOR_VERSION}" ]; }; then
if [ -n "${CI_PUBLISH_TAG_NAME}" ]; then
if [ -z "${CI_NPM_TOKEN}" ]; then
PRNERR "Specified release tag for publish, but NPM token is not specified."
exit 1
if [ "${CI_FORCE_NOT_PUBLISHER}" -eq 0 ]; then
if [ "${IS_PUBLISHER}" -eq 1 ] || { [ -n "${CI_FORCE_PUBLISHER}" ] && [ "${CI_FORCE_PUBLISHER}" = "${CI_NODEJS_MAJOR_VERSION}" ]; }; then
if [ -n "${CI_PUBLISH_TAG_NAME}" ]; then
if [ -z "${CI_NPM_TOKEN}" ]; then
PRNERR "Specified release tag for publish, but NPM token is not specified."
exit 1
fi
CI_DO_PUBLISH=1
fi
CI_DO_PUBLISH=1
fi
fi

Expand All @@ -826,6 +852,7 @@ echo " CI_PACKAGECLOUD_OWNER = ${CI_PACKAGECLOUD_OWNER}"
echo " CI_PACKAGECLOUD_DOWNLOAD_REPO = ${CI_PACKAGECLOUD_DOWNLOAD_REPO}"
echo " CI_NPM_TOKEN = **********"
echo " CI_FORCE_PUBLISHER = ${CI_FORCE_PUBLISHER}"
echo " CI_FORCE_NOT_PUBLISHER = ${CI_FORCE_NOT_PUBLISHER}"
echo " CI_PUBLISH_TAG_NAME = ${CI_PUBLISH_TAG_NAME}"
echo " CI_DO_PUBLISH = ${CI_DO_PUBLISH}"
echo ""
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nodejstypevars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ elif [ "${CI_NODEJS_MAJOR_VERSION}" = "18" ]; then
INSTALL_PKG_LIST="git gcc g++ make chmpx-dev"
INSTALLER_BIN="apt-get"
INSTALL_QUIET_ARG="-qq"
IS_PUBLISHER=1
IS_PUBLISHER=0

elif [ "${CI_NODEJS_MAJOR_VERSION}" = "20" ]; then
INSTALL_PKG_LIST="git gcc g++ make chmpx-dev"
Expand All @@ -82,7 +82,7 @@ elif [ "${CI_NODEJS_MAJOR_VERSION}" = "22" ]; then
INSTALL_PKG_LIST="git gcc g++ make chmpx-dev"
INSTALLER_BIN="apt-get"
INSTALL_QUIET_ARG="-qq"
IS_PUBLISHER=0
IS_PUBLISHER=1
fi

#---------------------------------------------------------------
Expand Down
8 changes: 2 additions & 6 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
1. Taku Ishihara <taishiha@yahoo-corp.jp >

Wrote from scratch the initial version of chmpx nodejs addon.

2. Takeshi Nakatani <ggtakec@gmail.com>
1. Takeshi Nakatani <ggtakec@gmail.com>

Develops and other improvements chmpx nodejs addon.

3. Hirotaka Wakabayashi <hiwakaba@yahoo-corp.jp>
2. Hirotaka Wakabayashi <hiwakaba@lycorp.co.jp>

Develops and other improvements chmpx nodejs addon.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
},
"author": "Takeshi Nakatani <ggtakec@gmail.com> (https://github.com/ggtakec)",
"contributors": [
"Hirotaka Wakabayashi <hiwakaba@yahoo-corp.jp> (https://github.com/hiwakaba)"
"Hirotaka Wakabayashi <hiwakaba@lycorp.co.jp> (https://github.com/hiwakaba)"
],
"license": "MIT"
}
Loading