Skip to content

Commit

Permalink
Improve Ubuntu 22.04 compatibility (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevapple committed Apr 3, 2023
1 parent adcaf4b commit db2445a
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 7 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,36 @@ on:
- '!.github/workflows/CI.yaml'

jobs:
test-setup:
runs-on: ubuntu-latest
strategy:
matrix:
image:
- ubuntu:18.04
- ubuntu:20.04
- ubuntu:22.04
- centos:7
- amazonlinux:2
fail-fast: false
container:
image: ${{ matrix.image }}
steps:
- name: Install dependencies
if: ${{ startsWith(matrix.image, 'amazonlinux:') }}
run: yum install gzip tar -y

- name: Checkout
uses: actions/checkout@v3

- name: Set up environment
if: ${{ startsWith(matrix.image, 'ubuntu:') }}
run: |
echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV
echo "DEBCONF_NONINTERACTIVE_SEEN=true" >> $GITHUB_ENV
- name: Test swiftbox setup
run: ./swiftbox.sh list

test-ubuntu:
runs-on: ubuntu-20.04
env:
Expand Down
29 changes: 22 additions & 7 deletions swiftbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Set environment properties

SWIFTBOX_VERSION="0.13.2"
SWIFTBOX_VERSION="0.13.3"
SWIFT_DOWNLOAD_SITE="https://download.swift.org"

if [ `id -u` = 0 ]
Expand Down Expand Up @@ -127,18 +127,33 @@ init-env() {
case $SYSTEM_NAME in
ubuntu)
$SUDO_FLAG apt-get update
$SUDO_FLAG apt-get install gnupg git libpython2.7 binutils tzdata libxml2 clang libicu-dev pkg-config zlib1g-dev libedit2 libsqlite3-0 libz3-dev -y
case $SYSTEM_VERSION in
16.04 | 18.04 | 20.04 | 22.04) ;;
*)
echo "It seems you're using an unsupported Ubuntu version. Dependency installation might fail."
;;
esac
COMMON_DEPS="binutils git gnupg2 libc6-dev libedit2 libsqlite3-0 pkg-config tzdata zlib1g-dev"
case $SYSTEM_VERSION in
16.04 | 18.04)
$SUDO_FLAG apt-get install libgcc-5-dev libstdc++-5-dev -y
FOUNDATION_DEPS="libcurl4 libxml2 libicu-dev"
GCC_DEPS="libgcc-5-dev libstdc++-5-dev"
PYTHON_DEP="libpython2.7"
;;
20.04)
$SUDO_FLAG apt-get install libgcc-9-dev libstdc++-9-dev -y
FOUNDATION_DEPS="libcurl4 libxml2"
GCC_DEPS="libgcc-9-dev libstdc++-9-dev"
PYTHON_DEP="libpython2.7"
OTHER_DEPS="uuid-dev"
;;
*)
echo "You should install the corresponding version of libgcc-dev and libstdc++-dev manually to enable full functionalities of Swift."
22.04 | *)
FOUNDATION_DEPS="libcurl4-openssl-dev libxml2-dev"
GCC_DEPS="libgcc-9-dev libstdc++-9-dev"
PYTHON_DEP="libpython3.8"
OTHER_DEPS="unzip"
;;
esac
$SUDO_FLAG apt-get install $COMMON_DEPS $FOUNDATION_DEPS $GCC_DEPS $PYTHON_DEP $OTHER_DEPS -y
;;
centos)
$SUDO_FLAG yum install binutils gcc git libedit libicu-devel pkg-config python2 sqlite zlib-devel -y
Expand All @@ -154,7 +169,7 @@ init-env() {
esac
;;
amazonlinux)
$SUDO_FLAG yum install binutils gcc git glibc-static gzip libbsd libcurl libedit libicu sqlite libstdc++-static libuuid libxml2 tar -y
$SUDO_FLAG yum install binutils gcc git glibc-static gzip libbsd libcurl libedit libicu sqlite libstdc++-static libuuid libxml2 tar tzdata -y
;;
esac
wget -q -O - https://swift.org/keys/all-keys.asc | $SUDO_FLAG gpg --import -
Expand Down

0 comments on commit db2445a

Please sign in to comment.