Skip to content

Commit

Permalink
Add release script to automate the release process
Browse files Browse the repository at this point in the history
Co-authored-by: Nate Vick <nate.vick@hint.io>
  • Loading branch information
benjaminwood and natevick committed Dec 2, 2023
1 parent b0c8885 commit 07ec5ae
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions bin/release
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# Define the vault ID for DRY purposes
VAULT_ID="hehpkyvswnpef4ywyqwi3dbclq"

# Retrieve the RubyGems API key from 1Password and export it
export GEM_HOST_API_KEY=$(op item get RubyGems --field label=api_key --vault $VAULT_ID)

# Check if the GEM_HOST_API_KEY was successfully retrieved and is not empty
if [ -z "$GEM_HOST_API_KEY" ]; then
echo "Failed to retrieve RubyGems API key."
exit 1
fi

# Retrieve the OTP from 1Password
GEM_HOST_OTP_CODE=$(op item get RubyGems --otp --vault $VAULT_ID)

# Check if the GEM_HOST_OTP_CODE was successfully retrieved and is not empty
if [ -z "$GEM_HOST_OTP_CODE" ]; then
echo "Failed to retrieve RubyGems OTP."
continue
fi

# Set RELEASE_PLATFORM and GEM_HOST_OTP_CODE temporarily and run rake release
env GEM_HOST_OTP_CODE=$GEM_HOST_OTP_CODE rake release

echo "Release completed."

0 comments on commit 07ec5ae

Please sign in to comment.