skip checking for a package if running in gitea
parent
b929af28e5
commit
207f1d711c
|
|
@ -28,18 +28,20 @@ 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\}://')
|
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}
|
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
|
# First check if the version of this package we're trying to build already exists in the registry
|
||||||
package_exists=null
|
# but this line: "jq -r .data.dist.tarball" fails only in gitea, so skip this block
|
||||||
#package_exists=$( yarn info --json ${package_name}@${package_publish_version} 2>/dev/null | jq -r .data.dist.tarball )
|
if [[ $GITEA_ACTIONS != "true" ]]; then
|
||||||
if [[ ! -z "$package_exists" && "$package_exists" != "null" ]]; then
|
package_exists=$( yarn info --json ${package_name}@${package_publish_version} 2>/dev/null | jq -r .data.dist.tarball )
|
||||||
echo "${package_publish_version} of ${package_name} already exists in the registry"
|
if [[ ! -z "$package_exists" && "$package_exists" != "null" ]]; then
|
||||||
if [[ ${CERC_FORCE_REBUILD} == "true" ]]; then
|
echo "${package_publish_version} of ${package_name} already exists in the registry"
|
||||||
# Attempt to unpublish the existing package
|
if [[ ${CERC_FORCE_REBUILD} == "true" ]]; then
|
||||||
echo "NOTE: unpublishing existing package version since force rebuild is enabled"
|
# Attempt to unpublish the existing package
|
||||||
npm unpublish --force ${package_name}@${package_publish_version}
|
echo "NOTE: unpublishing existing package version since force rebuild is enabled"
|
||||||
else
|
npm unpublish --force ${package_name}@${package_publish_version}
|
||||||
echo "skipping build since target version already exists"
|
else
|
||||||
exit 0
|
echo "skipping build since target version already exists"
|
||||||
fi
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
echo "Build and publish ${package_name} version ${package_publish_version}"
|
echo "Build and publish ${package_name} version ${package_publish_version}"
|
||||||
yarn install
|
yarn install
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue