init: template from npm action

This commit is contained in:
Mikeal Rogers 2019-01-26 21:51:06 +00:00
commit 6e839006c1
4 changed files with 32 additions and 0 deletions

17
Dockerfile Normal file
View File

@ -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 <mikeal.rogers@gmail.com>"
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"]

0
LICENSE Normal file
View File

0
README.md Normal file
View File

15
entrypoint.sh Normal file
View File

@ -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 $*"