Skip to content

Commit

Permalink
[Ubuntu] Fix Swift installer (actions#9677)
Browse files Browse the repository at this point in the history
  • Loading branch information
erik-bershel authored and guicaulada committed Jun 11, 2024
1 parent b16e203 commit 1df12af
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions images/ubuntu/scripts/build/install-swift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,25 @@ archive_url="https://download.swift.org/swift-${swift_version}-release/${image_l
archive_path=$(download_with_retry "$archive_url")

# Verifying PGP signature using official Swift PGP key. Referring to https://www.swift.org/install/linux/#Installation-via-Tarball
# Download and import Swift PGP key
pgp_key_path=$(download_with_retry "https://swift.org/keys/all-keys.asc")
gpg --no-default-keyring --keyring swift --import "$pgp_key_path"
# Download and import Swift PGP keys
gpg --keyserver hkp://keyserver.ubuntu.com \
--recv-keys \
'7463 A81A 4B2E EA1B 551F FBCF D441 C977 412B 37AD' \
'1BE1 E29A 084C B305 F397 D62A 9F59 7F4D 21A5 6D5F' \
'A3BA FD35 56A5 9079 C068 94BD 63BC 1CFE 91D3 06C6' \
'5E4D F843 FB06 5D7F 7E24 FBA2 EF54 30F0 71E1 B235' \
'8513 444E 2DA3 6B7C 1659 AF4D 7638 F1FB 2B2B 08C4' \
'A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561' \
'8A74 9566 2C3C D4AE 18D9 5637 FAF6 989E 1BC1 6FEA' \
'E813 C892 820A 6FA1 3755 B268 F167 DF1A CF9C E069'
gpg --keyserver hkp://keyserver.ubuntu.com --refresh-keys Swift

# Download and verify signature
signature_path=$(download_with_retry "${archive_url}.sig")
gpg --no-default-keyring --keyring swift --verify "$signature_path" "$archive_path"
gpg --verify "$signature_path" "$archive_path"

# Remove Swift PGP public key with temporary keyring
rm ~/.gnupg/swift
rm -rf ~/.gnupg

# Extract and install swift
tar xzf "$archive_path" -C /tmp
Expand Down

0 comments on commit 1df12af

Please # to comment.