Skip to content

Commit

Permalink
use the first key
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaqiluo committed Oct 15, 2024
1 parent a14056b commit 045b71c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/pre-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,16 @@ jobs:
run: |
echo "Importing gpg key"
echo -n "$GPG_KEY" | base64 --decode | gpg --import --batch >/dev/null
# Extract the key ID from the list of secret keys
GPG_KEY_ID=$(gpg --list-secret-keys --with-colons | awk -F: '/^fpr/ {print $10}')
# Print the list of secret key
gpg --list-secret-keys --with-colons
# Extract only the first full fingerprint from the list of secret keys
GPG_KEY_ID=$(gpg --list-secret-keys --with-colons | awk -F: '/^fpr/ {print $10; exit}')
echo "Extracted GPG Key ID: $GPG_KEY_ID"
# Automatically trust the key by creating a trust level entry for the key (ultimate trust)
echo -e "$GPG_KEY_ID:6:" | gpg --import-ownertrust
echo "signing SHASUM file"
VERSION_NO_V=$(echo ${{ github.ref_name }} | sed "s/^[v|V]//")
SHASUM_FILE=dist/artifacts/${{ github.ref_name }}/terraform-provider-rke_"$VERSION_NO_V"_SHA256SUMS
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,16 @@ jobs:
run: |
echo "Importing gpg key"
echo -n "$GPG_KEY" | base64 --decode | gpg --import --batch >/dev/null
# Extract the key ID from the list of secret keys
GPG_KEY_ID=$(gpg --list-secret-keys --with-colons | awk -F: '/^fpr/ {print $10}')
# Print the list of secret key
gpg --list-secret-keys --with-colons
# Extract only the first full fingerprint from the list of secret keys
GPG_KEY_ID=$(gpg --list-secret-keys --with-colons | awk -F: '/^fpr/ {print $10; exit}')
echo "Extracted GPG Key ID: $GPG_KEY_ID"
# Automatically trust the key by creating a trust level entry for the key (ultimate trust)
echo -e "$GPG_KEY_ID:6:" | gpg --import-ownertrust
echo "signing SHASUM file"
VERSION_NO_V=$(echo ${{ github.ref_name }} | sed "s/^[v|V]//")
SHASUM_FILE=dist/artifacts/${{ github.ref_name }}/terraform-provider-rke_"$VERSION_NO_V"_SHA256SUMS
Expand Down

0 comments on commit 045b71c

Please sign in to comment.