diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 3550b814f0..9aa29942c3 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -32,7 +32,8 @@ jobs: QT_PREFIX: "/usr/local/desktop-app/Qt-5.12.5" LIBICONV_VER: "libiconv-1.15" UPLOAD_ARTIFACT: "false" - MANUAL_CACHING: "1" + ONLY_CACHE: "false" + MANUAL_CACHING: "2" DOC_PATH: "docs/building-xcode.md" steps: - name: Get repository name. @@ -117,8 +118,8 @@ jobs: run: | cd $LibrariesPath - git clone $GIT/openssl/openssl openssl_$OPENSSL_VER - cd openssl_$OPENSSL_VER + git clone $GIT/openssl/openssl openssl + cd openssl git checkout OpenSSL_"$OPENSSL_VER"-stable ./Configure \ --prefix=$PREFIX \ @@ -127,6 +128,15 @@ jobs: $MIN_MAC make build_libs -j$(nproc) + SSL_DIR=$LibrariesPath/openssl_${{ env.OPENSSL_VER }} + mkdir -p $SSL_DIR/include + copyLib() { + cp $1.a $SSL_DIR/$1.a + } + copyLib libssl + copyLib libcrypto + sudo cp -R include/. $SSL_DIR/include/ + - name: Opus cache. id: cache-opus uses: actions/cache@v1 @@ -174,7 +184,7 @@ jobs: id: cache-ffmpeg uses: actions/cache@v1 with: - path: ${{ env.LibrariesPath }}/ffmpeg + path: ${{ env.LibrariesPath }}/ffmpeg-cache key: ${{ runner.OS }}-ffmpeg-${{ env.CACHE_KEY }} - name: FFmpeg. if: steps.cache-ffmpeg.outputs.cache-hit != 'true' @@ -188,7 +198,7 @@ jobs: LDFLAGS=`freetype-config --libs` PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/pkgconfig - ./configure --prefix=/usr/local \ + ./configure --prefix=$LibrariesPath/ffmpeg-cache \ --extra-cflags="$MIN_MAC $UNGUARDED" \ --extra-cxxflags="$MIN_MAC $UNGUARDED" \ --extra-ldflags="$MIN_MAC" \ @@ -290,10 +300,23 @@ jobs: --enable-muxer=opus make -j$(nproc) + sudo make install - name: FFmpeg install. run: | - cd $LibrariesPath/ffmpeg - sudo make install + cd $LibrariesPath + #List of files from cmake/external/ffmpeg/CMakeLists.txt. + copyLib() { + mkdir -p ffmpeg/$1 + \cp -fR ffmpeg-cache/lib/$1.a ffmpeg/$1/$1.a + } + copyLib libavformat + copyLib libavcodec + copyLib libswresample + copyLib libswscale + copyLib libavutil + + sudo cp -R ffmpeg-cache/. /usr/local/ + sudo cp -R ffmpeg-cache/include/. ffmpeg/ - name: OpenAL Soft. run: | @@ -364,8 +387,8 @@ jobs: cd $LibrariesPath mv qt-cache Qt-5.12.5 sudo mkdir -p $QT_PREFIX - sudo mv -f Qt-5.12.5 /usr/local/desktop-app/ - - name: Build Qt 5.12.5. + sudo mv -f Qt-5.12.5 "$(dirname "$QT_PREFIX")"/ + - name: Qt 5.12.5 build. if: steps.cache-qt.outputs.cache-hit != 'true' run: | cd $LibrariesPath @@ -400,7 +423,8 @@ jobs: make clean cp -r $QT_PREFIX $LibrariesPath/qt-cache - - name: Build Telegram Desktop. + - name: Telegram Desktop build. + if: env.ONLY_CACHE == 'false' run: | cd $REPO_NAME/Telegram diff --git a/.github/workflows/win.yml b/.github/workflows/win.yml index 702a3651f5..815b9b68c3 100644 --- a/.github/workflows/win.yml +++ b/.github/workflows/win.yml @@ -27,7 +27,8 @@ jobs: QT: "5_12_5" OPENSSL_VER: "1_1_1" UPLOAD_ARTIFACT: "false" - MANUAL_CACHING: "1" + ONLY_CACHE: "false" + MANUAL_CACHING: "2" DOC_PATH: "docs/building-msvc.md" steps: - name: Get repository name. @@ -134,6 +135,7 @@ jobs: move ossl_static.pdb out32 rmdir /S /Q test + rmdir /S /Q .git - name: Zlib. shell: cmd @@ -226,6 +228,7 @@ jobs: path: ${{ env.LibrariesPath }}/opus key: ${{ runner.OS }}-opus-${{ env.CACHE_KEY }} - name: Opus. + if: steps.cache-opus.outputs.cache-hit != 'true' shell: cmd run: | %VC% @@ -242,7 +245,7 @@ jobs: uses: actions/cache@v1 with: path: ${{ env.LibrariesPath }}/ffmpeg - key: ${{ runner.OS }}-ffmpeg-${{ env.CACHE_KEY }}-${{ hashFiles('**/build_ffmpeg_win.sh') }} + key: ${{ runner.OS }}-ffmpeg-${{ env.CACHE_KEY }}-2-${{ hashFiles('**/build_ffmpeg_win.sh') }} - name: FFmpeg. if: steps.cache-ffmpeg.outputs.cache-hit != 'true' shell: cmd @@ -257,6 +260,8 @@ jobs: set MSYS2_PATH_TYPE=inherit call c:\tools\msys64\usr\bin\bash --login ../../%REPO_NAME%/Telegram/Patches/build_ffmpeg_win.sh + rmdir /S /Q .git + - name: Qt 5.12.5 cache. id: cache-qt uses: actions/cache@v1 @@ -298,7 +303,7 @@ jobs: -nomake examples ^ -nomake tests ^ -platform win32-msvc - - name: Build Qt 5.12.5. + - name: Qt 5.12.5 build. if: steps.cache-qt.outputs.cache-hit != 'true' shell: cmd run: | @@ -321,7 +326,8 @@ jobs: fi echo "::set-env name=TDESKTOP_BUILD_DEFINE::$DEFINE" - - name: Build Telegram Desktop. + - name: Telegram Desktop build. + if: env.ONLY_CACHE == 'false' shell: cmd run: | cd %REPO_NAME%\Telegram @@ -348,4 +354,4 @@ jobs: if: env.UPLOAD_ARTIFACT == 'true' with: name: Telegram - path: ${{ env.REPO_NAME }}\out\Debug\artifact\ \ No newline at end of file + path: ${{ env.REPO_NAME }}\out\Debug\artifact\