Skip to content

Commit 758f509

Browse files
authored
release cicd: separate staging and prod gpg keys
1 parent 11097fb commit 758f509

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.github/workflows/sign_and_release.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ jobs:
493493
494494
- name: Set up GPG passphrase
495495
run: |
496-
if [ "${{ inputs.release_environment }}" == "production" ]; then
496+
if [ "${RELEASE_ENVIRONMENT}" == "production" ]; then
497497
if [ -z "${{ inputs.GPG_PASSPHRASE }}" ]; then
498498
echo "Error: GPG_PASSPHRASE is required for production releases"
499499
exit 1
@@ -512,9 +512,16 @@ jobs:
512512
fi
513513
514514
echo "Processing GPG key..."
515-
if ! aws secretsmanager get-secret-value --secret-id arn:aws:secretsmanager:us-east-1:446527654354:secret:altinity_${RELEASE_ENVIRONMENT}_gpg-Rqbe8S --query SecretString --output text | sed -e "s/^'//" -e "s/'$//" | jq -r '.altinity_${RELEASE_ENVIRONMENT}_gpg | @base64d' | gpg --quiet --batch --import >/dev/null 2>&1; then
516-
echo "Failed to import GPG key"
517-
exit 1
515+
if [ "${RELEASE_ENVIRONMENT}" == "production" ]; then
516+
if ! aws secretsmanager get-secret-value --secret-id arn:aws:secretsmanager:us-east-1:${{ secrets.SIGNING_PROD_SECRET_ID }} --query SecretString --output text | sed -e "s/^'//" -e "s/'$//" | jq -r '.altinity_prod_gpg | @base64d' | gpg --quiet --batch --import >/dev/null 2>&1; then
517+
echo "Failed to import prod GPG key"
518+
exit 1
519+
fi
520+
else
521+
if ! aws secretsmanager get-secret-value --secret-id arn:aws:secretsmanager:us-east-1:${{ secrets.SIGNING_STAGING_SECRET_ID }} --query SecretString --output text | sed -e "s/^'//" -e "s/'$//" | jq -r '.altinity_staging_gpg | @base64d' | gpg --quiet --batch --import >/dev/null 2>&1; then
522+
echo "Failed to import staging GPG key"
523+
exit 1
524+
fi
518525
fi
519526
520527
gpg --quiet --list-secret-keys --with-keygrip >/dev/null 2>&1

0 commit comments

Comments
 (0)