diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5ed4bb4..7fb1231 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -87,12 +87,8 @@ jobs: shell: bash run: | echo "REVISION: $REVISION" - cat $GITHUB_ENV - echo "REVISION: ${{env.REVISION}}" - mkdir build - cd build - CXXFLAGS="-stdlib=libc++" CC=/usr/bin/clang-10 CXX=/usr/bin/clang++-10 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=../tdlib .. - cmake --build . --target install -- -j4 + + source ./github-workflows/install-dependencies.sh - uses: actions/upload-artifact@v2 with: name: tdlight-${{ env.SAFE_ARCH }} diff --git a/github-workflows/install-dependencies.sh b/github-workflows/install-dependencies.sh new file mode 100755 index 0000000..684225c --- /dev/null +++ b/github-workflows/install-dependencies.sh @@ -0,0 +1,64 @@ +#!/bin/bash -e +set -e + +# ====== Setup environment variables +source ./travis/setup_variables.sh + +if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + echo "==Linux====" +elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + echo "==OSX======" + export PYTHON=36 + brew install swig; + curl -LO https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci; + source ./macports-ci install; + yes | sudo port install python$PYTHON; + yes | sudo port install py$PYTHON-pip; + sudo port select --set python3 python$PYTHON; + sudo port select --set pip pip$PYTHON; + pip install pyinstaller --user; + export PATH=$PATH:$(python3 -c "import site; print(site.USER_BASE)")/bin; + brew install gperf openssl coreutils + + # Precompile .tlo files because of a bug in travis/macOs + cd ./implementations/tdlight/td/generate/tl-parser/ + echo "Configuring tl-parser" + ./configure + echo "Compiling tl-parser" + make + cd .. + echo "Running tl-parser on mtproto_api" + ./tl-parser/bin/tl-parser -v -e scheme/mtproto_api.tlo scheme/mtproto_api.tl + echo "Running tl-parser on secret_api" + ./tl-parser/bin/tl-parser -v -e scheme/secret_api.tlo scheme/secret_api.tl + echo "Running tl-parser on telegram_api" + ./tl-parser/bin/tl-parser -v -e scheme/telegram_api.tlo scheme/telegram_api.tl + echo "Running tl-parser on td_api" + ./tl-parser/bin/tl-parser -v -e scheme/td_api.tlo scheme/td_api.tl + echo "Done .tlo" +elif [[ "$TRAVIS_OS_NAME" == "windows" ]]; then + echo "==Windows==" + choco install ccache + choco install make + choco install windows-sdk-10.1 + choco install visualstudio2019buildtools --version=16.7.0.0 --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64" + choco install openjdk11 --version=11.0.8.10 + choco install maven --version=3.6.3 + choco install base64 + choco install gperf + choco install strawberryperl + choco install nasm + choco install php --version=7.4.9 --package-parameters='"/ThreadSafe ""/InstallDir:C:\PHP"""' + choco install python3 --params "/InstallDir:C:\Python3" + + [ -d ./windowsenv/ ] && $(yes | rm -rf ./windowsenv/) + [ -d $VCPKG_DIR ] && $(yes | rm -rf $VCPKG_DIR) + git clone --depth=1 https://github.com/tdlight-team/windows-amd64-prebuilt-libraries.git windowsenv + mv windowsenv/vcpkg $VCPKG_DIR + cd $VCPKG_DIR + ./vcpkg integrate install +else + echo "Unrecognized os: $TRAVIS_OS_NAME" + exit 1 +fi +