carton/.github/actions/install-swift/action.yml

45 lines
1.2 KiB
YAML

inputs:
swift-dir:
description: The directory name part of the distribution URL
required: true
swift-version:
description: Git tag indicating the Swift version
required: true
runs:
using: composite
steps:
# https://www.swift.org/install/linux/#installation-via-tarball
- name: Install dependent packages for Swift
shell: bash
run: >
sudo apt-get -q update &&
sudo apt-get install -y
binutils
git
gnupg2
libc6-dev
libcurl4-openssl-dev
libedit2
libgcc-9-dev
libpython3.8
libsqlite3-0
libstdc++-9-dev
libxml2-dev
libz3-dev
pkg-config
tzdata
unzip
zlib1g-dev
curl
- name: Download Swift
shell: bash
run: curl -fLO https://download.swift.org/${{ inputs.swift-dir }}/${{ inputs.swift-version }}/${{ inputs.swift-version }}-ubuntu22.04.tar.gz
working-directory: ${{ env.RUNNER_TEMP }}
- name: Unarchive and Install Swift
shell: bash
run: sudo tar -xf ${{ inputs.swift-version }}-ubuntu22.04.tar.gz --strip-components=2 -C /usr/local
working-directory: ${{ env.RUNNER_TEMP }}