diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml new file mode 100644 index 0000000..a37ad0c --- /dev/null +++ b/.github/workflows/swift.yml @@ -0,0 +1,41 @@ +name: Build and Test + +on: + push: + pull_request: + schedule: + - cron: "0 9 * * 1" + +jobs: + linux: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + image: + - swift:5.0.3-xenial + - swift:5.1.5-xenial + - swift:5.2.5-xenial + - swift:5.3.2-xenial + - swift:5.3.2-bionic + container: ${{ matrix.image }} + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + - name: Build Swift Debug Package + run: swift build -c debug + - name: Build Swift Release Package + run: swift build -c release + nextstep: + runs-on: macos-latest + steps: + - name: Select latest available Xcode + uses: maxim-lobanov/setup-xcode@v1.2.1 + with: + xcode-version: 12.2 + - name: Checkout Repository + uses: actions/checkout@v2 + - name: Build Swift Debug Package + run: swift build -c debug + - name: Build Swift Release Package + run: swift build -c release diff --git a/.travis.d/before-install.sh b/.travis.d/before-install.sh deleted file mode 100755 index f8d4b74..0000000 --- a/.travis.d/before-install.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -if [[ "$TRAVIS_OS_NAME" == "Linux" ]]; then - sudo apt-get -q update - sudo apt-get install -y wget \ - clang-3.8 libc6-dev make git libicu52 libicu-dev \ - git autoconf libtool pkg-config \ - libblocksruntime-dev \ - libkqueue-dev \ - libpthread-workqueue-dev \ - systemtap-sdt-dev \ - libbsd-dev libbsd0 libbsd0-dbg \ - curl libcurl4-openssl-dev \ - libssl-dev \ - libedit-dev \ - libpython2.7 \ - python2.7 python2.7-dev \ - libxml2 - - sudo update-alternatives --quiet --install /usr/bin/clang clang /usr/bin/clang-3.8 100 - sudo update-alternatives --quiet --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.8 100 -fi diff --git a/.travis.d/install.sh b/.travis.d/install.sh deleted file mode 100755 index 2d1b622..0000000 --- a/.travis.d/install.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# Install Swift - -wget "${SWIFT_SNAPSHOT_NAME}" - -TARBALL="`ls swift-*.tar.gz`" -echo "Tarball: $TARBALL" - -TARPATH="$PWD/$TARBALL" - -cd $HOME # expand Swift tarball in $HOME -tar zx --strip 1 --file=$TARPATH -pwd - -export PATH="$PWD/usr/bin:$PATH" -which swift - -if [ `which swift` ]; then - echo "Installed Swift: `which swift`" -else - echo "Failed to install Swift?" - exit 42 -fi -swift --version - - -# Environment - -TT_SWIFT_BINARY=`which swift` - -echo "${TT_SWIFT_BINARY}" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a84b3f7..0000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -language: generic - -notifications: - slack: nozeio:LIFY1Jtkx0FRcLq3u1WliHRZ - -matrix: - include: - - os: Linux - dist: trusty - env: SWIFT_SNAPSHOT_NAME="https://swift.org/builds/swift-5.0-release/ubuntu1404/swift-5.0-RELEASE/swift-5.0-RELEASE-ubuntu14.04.tar.gz" - sudo: required - - os: Linux - dist: xenial - env: SWIFT_SNAPSHOT_NAME="https://swift.org/builds/swift-5.2-release/ubuntu1604/swift-5.2-RELEASE/swift-5.2-RELEASE-ubuntu16.04.tar.gz" - sudo: required - - os: osx - osx_image: xcode11.4 - - -before_install: - - ./.travis.d/before-install.sh - -install: - - ./.travis.d/install.sh - -script: - - export PATH="$HOME/usr/bin:$PATH" - - export SWIFTENV_ROOT="$HOME/.swiftenv" - - export PATH="${SWIFTENV_ROOT}/bin:${SWIFTENV_ROOT}/shims:$PATH" - - swift build -c release - - swift build -c debug diff --git a/Package.swift b/Package.swift index cedef94..dc29195 100644 --- a/Package.swift +++ b/Package.swift @@ -4,7 +4,7 @@ import PackageDescription var packageDependencies : [ Package.Dependency ] = [ .package(url: "https://github.com/apple/swift-nio.git", - from: "2.18.0"), + from: "2.25.1"), .package(url: "https://github.com/SwiftNIOExtras/swift-nio-irc.git", from: "0.8.0") ] @@ -12,7 +12,7 @@ var targetDependencies : [ Target.Dependency ] = [ "NIO", "NIOIRC" ] if #available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) { packageDependencies += [ .package(url: "https://github.com/apple/swift-nio-transport-services", - from: "1.6.0") + from: "1.9.1") ] targetDependencies += [ "NIOTransportServices" ] } diff --git a/Sources/IRC/IRCClient.swift b/Sources/IRC/IRCClient.swift index 0147c25..9c71b3d 100644 --- a/Sources/IRC/IRCClient.swift +++ b/Sources/IRC/IRCClient.swift @@ -2,7 +2,7 @@ // // This source file is part of the swift-nio-irc open source project // -// Copyright (c) 2018 ZeeZide GmbH. and the swift-nio-irc project authors +// Copyright (c) 2018-2020 ZeeZide GmbH. and the swift-nio-irc project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information @@ -132,15 +132,19 @@ open class IRCClient : IRCClientMessageTarget { self.eventLoop = eventLoop // what a mess :-) - var overrideBootstrap : NIOClientTCPBootstrapProtocol? #if canImport(NIOTransportServices) #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) + var overrideBootstrap : NIOClientTCPBootstrapProtocol? if #available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) { if options.eventLoopGroup is NIOTSEventLoopGroup { overrideBootstrap = NIOTSConnectionBootstrap(group: eventLoop) } } + #else + let overrideBootstrap : NIOClientTCPBootstrapProtocol? = nil #endif + #else + let overrideBootstrap : NIOClientTCPBootstrapProtocol? = nil #endif self.bootstrap = overrideBootstrap ?? ClientBootstrap(group: eventLoop) @@ -408,7 +412,7 @@ open class IRCClient : IRCClientMessageTarget { func errorCaught(context: ChannelHandlerContext, error: Error) { self.client.handlerCaughtError(error, in: context) - _ = context.close(promise: nil) + context.close(promise: nil) } }