skip checking for a package if running in gitea

zramsay 2023-09-27 19:23:56 -04:00
parent b929af28e5
commit 207f1d711c
1 changed files with 14 additions and 12 deletions

View File

@ -28,9 +28,10 @@ npm config set @lirewine:registry ${local_npm_registry_url}
local_npm_registry_url_fixed=$( echo ${local_npm_registry_url} | sed -e 's/^http[s]\{0,1\}://')
npm config set -- ${local_npm_registry_url_fixed}:_authToken ${CERC_NPM_AUTH_TOKEN}
# First check if the version of this package we're trying to build already exists in the registry
package_exists=null
#package_exists=$( yarn info --json ${package_name}@${package_publish_version} 2>/dev/null | jq -r .data.dist.tarball )
if [[ ! -z "$package_exists" && "$package_exists" != "null" ]]; then
# but this line: "jq -r .data.dist.tarball" fails only in gitea, so skip this block
if [[ $GITEA_ACTIONS != "true" ]]; then
package_exists=$( yarn info --json ${package_name}@${package_publish_version} 2>/dev/null | jq -r .data.dist.tarball )
if [[ ! -z "$package_exists" && "$package_exists" != "null" ]]; then
echo "${package_publish_version} of ${package_name} already exists in the registry"
if [[ ${CERC_FORCE_REBUILD} == "true" ]]; then
# Attempt to unpublish the existing package
@ -40,6 +41,7 @@ if [[ ! -z "$package_exists" && "$package_exists" != "null" ]]; then
echo "skipping build since target version already exists"
exit 0
fi
fi
fi
echo "Build and publish ${package_name} version ${package_publish_version}"
yarn install