commit 6e839006c1128851e9a370565db90628db637d74 Author: Mikeal Rogers Date: Sat Jan 26 21:51:06 2019 +0000 init: template from npm action diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..33dabdb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM node:10-slim + +LABEL version="1.0.0" +LABEL repository="http://github.com/mikeal/auto-release" +LABEL homepage="http://github.com/auto-release" +LABEL maintainer="Mikeal Rogers " + +LABEL com.github.actions.name="Automated releases for npm packages." +LABEL com.github.actions.description="Release npm package based on commit metadata." +LABEL com.github.actions.icon="package" +LABEL com.github.actions.color="red" +COPY LICENSE README.md / + +COPY "entrypoint.sh" "/entrypoint.sh" +ENTRYPOINT ["/entrypoint.sh"] +CMD ["help"] + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..10e7ac3 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +set -e + +if [ -n "$NPM_AUTH_TOKEN" ]; then + # Respect NPM_CONFIG_USERCONFIG if it is provided, default to $HOME/.npmrc + NPM_CONFIG_USERCONFIG="${NPM_CONFIG_USERCONFIG-"$HOME/.npmrc"}" + NPM_REGISTRY_URL="${NPM_REGISTRY_URL-registry.npmjs.org}" + + # Allow registry.npmjs.org to be overridden with an environment variable + printf "//%s/:_authToken=%s\\nregistry=%s" "$NPM_REGISTRY_URL" "$NPM_AUTH_TOKEN" "$NPM_REGISTRY_URL" > "$NPM_CONFIG_USERCONFIG" + chmod 0600 "$NPM_CONFIG_USERCONFIG" +fi + +sh -c "npx auto-release $*"