mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-24 10:28:10 +08:00
[ubuntu] Rename build scripts (#8866)
* [ubuntu] Rename build scripts * [ubuntu] Change reboot to inline shell * [ubuntu] Move disk space validation to pester tests * [ubuntu] Rename helper and tests files * [ubuntu] Changes to cleanup, post-deployment and r scripts
This commit is contained in:
committed by
GitHub
parent
410fd620be
commit
1bd9214f41
46
images/ubuntu/scripts/build/install-swift.sh
Normal file
46
images/ubuntu/scripts/build/install-swift.sh
Normal file
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash -e
|
||||
################################################################################
|
||||
## File: install-swift.sh
|
||||
## Desc: Install Swift
|
||||
################################################################################
|
||||
|
||||
# Source the helpers for use with the script
|
||||
source $HELPER_SCRIPTS/install.sh
|
||||
|
||||
# Install
|
||||
image_label="$(lsb_release -rs)"
|
||||
swift_version=$(curl -fsSL "https://api.github.com/repos/apple/swift/releases/latest" | jq -r '.tag_name | match("[0-9.]+").string')
|
||||
|
||||
swift_tar_name="swift-$swift_version-RELEASE-ubuntu$image_label.tar.gz"
|
||||
swift_tar_url="https://swift.org/builds/swift-$swift_version-release/ubuntu${image_label//./}/swift-$swift_version-RELEASE/$swift_tar_name"
|
||||
download_with_retries $swift_tar_url "/tmp" "$swift_tar_name"
|
||||
|
||||
# Verifing pgp signature using official swift pgp key. Referring to https://www.swift.org/install/linux/#Installation-via-Tarball
|
||||
# Download swift pgp key
|
||||
download_with_retries "https://swift.org/keys/all-keys.asc" "/tmp" "all-keys.asc"
|
||||
# Import swift pgp key
|
||||
gpg --no-default-keyring --keyring swift --import /tmp/all-keys.asc
|
||||
# Download signature file
|
||||
download_with_retries "$swift_tar_url.sig" "/tmp" "$swift_tar_name.sig"
|
||||
# Verify signature
|
||||
gpg --no-default-keyring --keyring swift --verify "/tmp/$swift_tar_name.sig" "/tmp/$swift_tar_name"
|
||||
# Remove swift pgp public key with temporary keyring
|
||||
rm ~/.gnupg/swift
|
||||
|
||||
|
||||
tar xzf /tmp/$swift_tar_name
|
||||
|
||||
SWIFT_INSTALL_ROOT="/usr/share/swift"
|
||||
SWIFT_BIN_ROOT="$SWIFT_INSTALL_ROOT/usr/bin"
|
||||
SWIFT_LIB_ROOT="$SWIFT_INSTALL_ROOT/usr/lib"
|
||||
|
||||
mv swift-$swift_version-RELEASE-ubuntu$image_label $SWIFT_INSTALL_ROOT
|
||||
mkdir -p /usr/local/lib
|
||||
|
||||
ln -s "$SWIFT_BIN_ROOT/swift" /usr/local/bin/swift
|
||||
ln -s "$SWIFT_BIN_ROOT/swiftc" /usr/local/bin/swiftc
|
||||
ln -s "$SWIFT_LIB_ROOT/libsourcekitdInProc.so" /usr/local/lib/libsourcekitdInProc.so
|
||||
|
||||
echo "SWIFT_PATH=$SWIFT_BIN_ROOT" | tee -a /etc/environment
|
||||
|
||||
invoke_tests "Common" "Swift"
|
||||
Reference in New Issue
Block a user