mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2026-01-04 17:17:23 +08:00
Merge pull request #609 from nikita-bykov/swift-support
Add Swift support
This commit is contained in:
32
images/linux/scripts/installers/swift.sh
Normal file
32
images/linux/scripts/installers/swift.sh
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
################################################################################
|
||||
## File: swift.sh
|
||||
## Desc: Installs Swift
|
||||
################################################################################
|
||||
|
||||
# Source the helpers for use with the script
|
||||
source $HELPER_SCRIPTS/document.sh
|
||||
|
||||
# Install
|
||||
image_label="$(lsb_release -rs)"
|
||||
swift_version=$(curl -s https://swift.org/download/ | grep -m1 "id=\"swift-" | awk -F"[ <]" '{print $4}')
|
||||
|
||||
wget -P /tmp https://swift.org/builds/swift-$swift_version-release/ubuntu${image_label//./}/swift-$swift_version-RELEASE/swift-$swift_version-RELEASE-ubuntu$image_label.tar.gz
|
||||
tar xzf /tmp/swift-$swift_version-RELEASE-ubuntu$image_label.tar.gz
|
||||
mv swift-$swift_version-RELEASE-ubuntu$image_label /usr/share/swift
|
||||
|
||||
SWIFT_PATH="/usr/share/swift/usr/bin"
|
||||
SWIFT_BIN="$SWIFT_PATH/swift"
|
||||
ln -s "$SWIFT_BIN" /usr/local/bin/swift
|
||||
echo "SWIFT_PATH=$SWIFT_PATH" | tee -a /etc/environment
|
||||
|
||||
# Run tests to determine that the software installed as expected
|
||||
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
||||
if ! command -v swift; then
|
||||
echo "Swift was not installed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Document what was added to the image
|
||||
echo "Lastly, documenting what we added to the metadata file"
|
||||
DocumentInstalledItem "$(swift --version)"
|
||||
@@ -144,6 +144,7 @@
|
||||
"{{template_dir}}/scripts/installers/aws.sh",
|
||||
"{{template_dir}}/scripts/installers/build-essential.sh",
|
||||
"{{template_dir}}/scripts/installers/clang.sh",
|
||||
"{{template_dir}}/scripts/installers/swift.sh",
|
||||
"{{template_dir}}/scripts/installers/cmake.sh",
|
||||
"{{template_dir}}/scripts/installers/docker-compose.sh",
|
||||
"{{template_dir}}/scripts/installers/docker-moby.sh",
|
||||
|
||||
@@ -147,6 +147,7 @@
|
||||
"{{template_dir}}/scripts/installers/aws.sh",
|
||||
"{{template_dir}}/scripts/installers/build-essential.sh",
|
||||
"{{template_dir}}/scripts/installers/clang.sh",
|
||||
"{{template_dir}}/scripts/installers/swift.sh",
|
||||
"{{template_dir}}/scripts/installers/cmake.sh",
|
||||
"{{template_dir}}/scripts/installers/docker-compose.sh",
|
||||
"{{template_dir}}/scripts/installers/docker-moby.sh",
|
||||
|
||||
Reference in New Issue
Block a user