diff --git a/RUBYGEM.md b/RUBYGEM.md index ba16387c..eff6e27c 100644 --- a/RUBYGEM.md +++ b/RUBYGEM.md @@ -5,5 +5,5 @@ Then run the following [Docker](https://docs.docker.com/engine/installation/) co ```bash docker build -t auth0-publish-rubygem . -docker run --rm -e RUBYGEMS_EMAIL=$RUBYGEMS_EMAIL -e RUBYGEMS_PASSWORD=$RUBYGEMS_PASSWORD -it auth0-publish-rubygem /bin/sh publish_rubygem.sh +docker run --rm -e RUBYGEMS_EMAIL="$RUBYGEMS_EMAIL" -e RUBYGEMS_PASSWORD="$RUBYGEMS_PASSWORD" -it auth0-publish-rubygem /bin/sh publish_rubygem.sh ``` diff --git a/publish_rubygem.sh b/publish_rubygem.sh index fd245a2b..31f28fee 100644 --- a/publish_rubygem.sh +++ b/publish_rubygem.sh @@ -1,12 +1,10 @@ #!/usr/bin/env bash -# Create file with credentials for rubygems.org -touch credentials.txt -echo $RUBYGEMS_EMAIL > credentials.txt -echo $RUBYGEMS_PASSWORD >> credentials.txt -# build the gem +# Create directory for rubygems credentials +mkdir /root/.gem +# Get API key from rubygems.org +curl -u "$RUBYGEMS_EMAIL":"$RUBYGEMS_PASSWORD" https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials +# Build Gem gem build auth0.gemspec -# publish the gem on rubygems.org -gem push auth0-*.gem < credentials.txt -# Delete credentials file -rm credentials.txt +# Publish Gem +gem push auth0-*.gem