2019-09-06 05:24:37 +00:00
|
|
|
name: MacOS.
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- 'docs/**'
|
2020-04-12 05:17:44 +00:00
|
|
|
- '**.md'
|
2021-07-20 02:41:11 +00:00
|
|
|
- '!docs/building-mac.md'
|
2020-04-30 14:57:01 +00:00
|
|
|
- 'changelog.txt'
|
|
|
|
- 'LEGAL'
|
|
|
|
- 'LICENSE'
|
|
|
|
- '.github/**'
|
|
|
|
- '!.github/workflows/mac.yml'
|
|
|
|
- 'lib/xdg/**'
|
|
|
|
- 'snap/**'
|
2021-10-21 12:17:07 +00:00
|
|
|
- 'Telegram/build/docker/**'
|
2020-04-30 14:57:01 +00:00
|
|
|
- 'Telegram/Resources/uwp/**'
|
|
|
|
- 'Telegram/Resources/winrc/**'
|
|
|
|
- 'Telegram/SourceFiles/platform/win/**'
|
|
|
|
- 'Telegram/SourceFiles/platform/linux/**'
|
|
|
|
- 'Telegram/configure.bat'
|
2019-09-06 05:24:37 +00:00
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
|
|
|
- 'docs/**'
|
2020-04-12 05:17:44 +00:00
|
|
|
- '**.md'
|
2021-07-20 02:41:11 +00:00
|
|
|
- '!docs/building-mac.md'
|
2020-04-30 14:57:01 +00:00
|
|
|
- 'changelog.txt'
|
|
|
|
- 'LEGAL'
|
|
|
|
- 'LICENSE'
|
|
|
|
- '.github/**'
|
|
|
|
- '!.github/workflows/mac.yml'
|
|
|
|
- 'lib/xdg/**'
|
|
|
|
- 'snap/**'
|
2021-10-21 12:17:07 +00:00
|
|
|
- 'Telegram/build/docker/**'
|
2020-04-30 14:57:01 +00:00
|
|
|
- 'Telegram/Resources/uwp/**'
|
|
|
|
- 'Telegram/Resources/winrc/**'
|
|
|
|
- 'Telegram/SourceFiles/platform/win/**'
|
|
|
|
- 'Telegram/SourceFiles/platform/linux/**'
|
|
|
|
- 'Telegram/configure.bat'
|
2019-09-06 05:24:37 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
macos:
|
|
|
|
name: MacOS
|
|
|
|
runs-on: macos-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
defines:
|
|
|
|
- ""
|
|
|
|
env:
|
|
|
|
UPLOAD_ARTIFACT: "false"
|
2020-01-24 13:17:35 +00:00
|
|
|
ONLY_CACHE: "false"
|
2022-04-15 07:21:06 +00:00
|
|
|
PREPARE_PATH: "Telegram/build/prepare/prepare.py"
|
2020-02-24 13:51:53 +00:00
|
|
|
|
2019-09-06 05:24:37 +00:00
|
|
|
steps:
|
|
|
|
- name: Get repository name.
|
2020-10-25 01:46:27 +00:00
|
|
|
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
|
2019-09-06 05:24:37 +00:00
|
|
|
|
|
|
|
- name: Clone.
|
2020-03-20 16:32:06 +00:00
|
|
|
uses: actions/checkout@v2
|
2019-09-06 05:24:37 +00:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2020-03-20 16:32:06 +00:00
|
|
|
path: ${{ env.REPO_NAME }}
|
2019-09-06 05:24:37 +00:00
|
|
|
|
|
|
|
- name: First set up.
|
|
|
|
run: |
|
2020-08-11 12:45:30 +00:00
|
|
|
sudo chown -R `whoami`:admin /usr/local/share
|
2022-04-16 11:07:35 +00:00
|
|
|
brew install automake
|
2019-09-06 05:24:37 +00:00
|
|
|
|
2021-02-25 02:34:15 +00:00
|
|
|
# Disable spotlight.
|
|
|
|
sudo mdutil -a -i off
|
|
|
|
|
2019-09-06 05:24:37 +00:00
|
|
|
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
|
|
|
|
|
2021-09-13 12:22:09 +00:00
|
|
|
- name: ThirdParty cache.
|
|
|
|
id: cache-third-party
|
2020-06-30 08:37:15 +00:00
|
|
|
uses: actions/cache@v2
|
2019-09-06 05:24:37 +00:00
|
|
|
with:
|
2021-09-13 12:22:09 +00:00
|
|
|
path: ThirdParty
|
2022-04-15 07:21:06 +00:00
|
|
|
key: ${{ runner.OS }}-third-party-${{ hashFiles(format('{0}/{1}', env.REPO_NAME, env.PREPARE_PATH)) }}
|
|
|
|
restore-keys: ${{ runner.OS }}-third-party-
|
2019-09-06 05:24:37 +00:00
|
|
|
|
2021-09-13 12:22:09 +00:00
|
|
|
- name: Libraries cache.
|
|
|
|
id: cache-libs
|
2020-06-30 08:37:15 +00:00
|
|
|
uses: actions/cache@v2
|
2019-09-06 05:24:37 +00:00
|
|
|
with:
|
2021-09-13 12:22:09 +00:00
|
|
|
path: Libraries
|
2022-04-15 07:21:06 +00:00
|
|
|
key: ${{ runner.OS }}-libs-${{ hashFiles(format('{0}/{1}', env.REPO_NAME, env.PREPARE_PATH)) }}
|
|
|
|
restore-keys: ${{ runner.OS }}-libs-
|
2019-09-06 05:24:37 +00:00
|
|
|
|
2021-09-13 12:22:09 +00:00
|
|
|
- name: Libraries.
|
2020-08-14 06:45:41 +00:00
|
|
|
run: |
|
2021-10-29 18:05:21 +00:00
|
|
|
./$REPO_NAME/Telegram/build/prepare/mac.sh skip-release silent
|
2020-08-14 06:45:41 +00:00
|
|
|
|
2022-01-02 05:22:36 +00:00
|
|
|
- name: Free up some disk space.
|
|
|
|
run: |
|
|
|
|
cd Libraries
|
|
|
|
find . -iname "*.dir" -exec rm -rf {} || true \;
|
|
|
|
|
2020-01-24 13:17:35 +00:00
|
|
|
- name: Telegram Desktop build.
|
|
|
|
if: env.ONLY_CACHE == 'false'
|
2019-09-06 05:24:37 +00:00
|
|
|
run: |
|
|
|
|
cd $REPO_NAME/Telegram
|
|
|
|
|
|
|
|
DEFINE=""
|
|
|
|
if [ -n "${{ matrix.defines }}" ]; then
|
|
|
|
DEFINE="-D ${{ matrix.defines }}=ON"
|
|
|
|
echo Define from matrix: $DEFINE
|
2020-10-25 01:46:27 +00:00
|
|
|
echo "ARTIFACT_NAME=Telegram_${{ matrix.defines }}" >> $GITHUB_ENV
|
2020-04-12 19:04:47 +00:00
|
|
|
else
|
2020-10-25 01:46:27 +00:00
|
|
|
echo "ARTIFACT_NAME=Telegram" >> $GITHUB_ENV
|
2019-09-06 05:24:37 +00:00
|
|
|
fi
|
|
|
|
|
2020-08-10 14:10:42 +00:00
|
|
|
./configure.sh \
|
2020-11-17 10:05:26 +00:00
|
|
|
-D CMAKE_C_FLAGS="-Werror" \
|
|
|
|
-D CMAKE_CXX_FLAGS="-Werror" \
|
2020-08-10 14:10:42 +00:00
|
|
|
-D TDESKTOP_API_TEST=ON \
|
|
|
|
-D DESKTOP_APP_USE_PACKAGED=OFF \
|
|
|
|
-D DESKTOP_APP_DISABLE_CRASH_REPORTS=OFF \
|
|
|
|
$DEFINE
|
2019-09-06 05:24:37 +00:00
|
|
|
|
|
|
|
cd ../out
|
|
|
|
|
|
|
|
xcoderun='xcodebuild build -project Telegram.xcodeproj -scheme Telegram -destination "platform=macOS,arch=x86_64" -configuration Debug'
|
|
|
|
bash -c "$xcoderun" || bash -c "$xcoderun" || bash -c "$xcoderun"
|
|
|
|
|
|
|
|
- name: Move artifact.
|
|
|
|
if: env.UPLOAD_ARTIFACT == 'true'
|
|
|
|
run: |
|
|
|
|
cd $REPO_NAME/out/Debug
|
|
|
|
mkdir artifact
|
|
|
|
mv Telegram.app artifact/
|
|
|
|
mv Updater artifact/
|
|
|
|
- uses: actions/upload-artifact@master
|
|
|
|
if: env.UPLOAD_ARTIFACT == 'true'
|
|
|
|
name: Upload artifact.
|
|
|
|
with:
|
2020-04-12 19:04:47 +00:00
|
|
|
name: ${{ env.ARTIFACT_NAME }}
|
2020-01-22 21:31:38 +00:00
|
|
|
path: ${{ env.REPO_NAME }}/out/Debug/artifact/
|