Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix release script env vars #4

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions bin/release
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
VAULT_ID="hehpkyvswnpef4ywyqwi3dbclq"

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

# Check if the RUBYGEMS_API_KEY was successfully retrieved and is not empty
if [ -z "$RUBYGEMS_API_KEY" ]; then
# 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
Expand Down Expand Up @@ -37,16 +37,16 @@ for arch_key in "${!os_arch_map[@]}"; do
echo "Releasing for architecture: $arch_key"

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

# Check if the RUBYGEMS_OTP was successfully retrieved and is not empty
if [ -z "$RUBYGEMS_OTP" ]; then
# 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 RUBYGEMS_OTP temporarily and run rake release
env RELEASE_PLATFORM=$arch_key RUBYGEMS_OTP=$RUBYGEMS_OTP rake release
# Set RELEASE_PLATFORM and GEM_HOST_OTP_CODE temporarily and run rake release
env RELEASE_PLATFORM=$arch_key GEM_HOST_OTP_CODE=$GEM_HOST_OTP_CODE rake release

if [ $? -ne 0 ]; then
echo "Release failed for architecture: $arch_key"
Expand Down