Update the publish.sh script
This commit is contained in:
+5
-27
@@ -8,15 +8,9 @@
|
|||||||
set -o errexit
|
set -o errexit
|
||||||
|
|
||||||
#
|
#
|
||||||
# All profiles to be built. Must correspond to .json files in the config
|
# Destination directory for the package.
|
||||||
# directory.
|
|
||||||
#
|
#
|
||||||
PROFILES="ol ol-debug"
|
BUILT_PACKAGE=build/ol
|
||||||
|
|
||||||
#
|
|
||||||
# Destination directory for builds.
|
|
||||||
#
|
|
||||||
BUILDS=dist
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# URL for canonical repo.
|
# URL for canonical repo.
|
||||||
@@ -61,21 +55,6 @@ assert_version_match() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
# Build all of the distribution profiles.
|
|
||||||
#
|
|
||||||
build_js() {
|
|
||||||
for p in ${@}; do
|
|
||||||
echo building ${BUILDS}/${p}.js
|
|
||||||
node ./tasks/build.js config/${p}.json ${BUILDS}/${p}.js
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
build_css() {
|
|
||||||
./node_modules/.bin/cleancss css/ol.css -o ${BUILDS}/ol.css
|
|
||||||
cp css/ol.css ${BUILDS}/ol-debug.css
|
|
||||||
}
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Check out the provided tag. This ensures that the tag has been pushed to
|
# Check out the provided tag. This ensures that the tag has been pushed to
|
||||||
# the canonical remote.
|
# the canonical remote.
|
||||||
@@ -86,7 +65,7 @@ checkout_tag() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Build all profiles and publish.
|
# Build the package and publish.
|
||||||
#
|
#
|
||||||
main() {
|
main() {
|
||||||
root=$(cd -P -- "$(dirname -- "${0}")" && pwd -P)/..
|
root=$(cd -P -- "$(dirname -- "${0}")" && pwd -P)/..
|
||||||
@@ -94,10 +73,9 @@ main() {
|
|||||||
assert_clean
|
assert_clean
|
||||||
checkout_tag ${1}
|
checkout_tag ${1}
|
||||||
assert_version_match ${1}
|
assert_version_match ${1}
|
||||||
rm -rf ${BUILDS}
|
|
||||||
npm install
|
npm install
|
||||||
build_js ${PROFILES}
|
npm run build-package
|
||||||
build_css
|
cd ${BUILT_PACKAGE}
|
||||||
npm publish
|
npm publish
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user