tdesktop/.github/workflows/mac.yml

143 lines
4.0 KiB
YAML
Raw Normal View History

name: MacOS.
on:
push:
paths-ignore:
- 'docs/**'
- '**.md'
- 'changelog.txt'
- 'LEGAL'
- 'LICENSE'
- '.github/**'
- '!.github/workflows/mac.yml'
- 'lib/xdg/**'
- 'snap/**'
2021-10-21 12:17:07 +00:00
- 'Telegram/build/docker/**'
- 'Telegram/Resources/uwp/**'
- 'Telegram/Resources/winrc/**'
- 'Telegram/SourceFiles/platform/win/**'
- 'Telegram/SourceFiles/platform/linux/**'
- 'Telegram/configure.bat'
pull_request:
paths-ignore:
- 'docs/**'
- '**.md'
- 'changelog.txt'
- 'LEGAL'
- 'LICENSE'
- '.github/**'
- '!.github/workflows/mac.yml'
- 'lib/xdg/**'
- 'snap/**'
2021-10-21 12:17:07 +00:00
- 'Telegram/build/docker/**'
- 'Telegram/Resources/uwp/**'
- 'Telegram/Resources/winrc/**'
- 'Telegram/SourceFiles/platform/win/**'
- 'Telegram/SourceFiles/platform/linux/**'
- 'Telegram/configure.bat'
jobs:
macos:
name: MacOS
2024-02-16 21:27:14 +00:00
runs-on: macos-13
strategy:
matrix:
defines:
- ""
env:
2024-04-03 15:09:00 +00:00
UPLOAD_ARTIFACT: "true"
ONLY_CACHE: "false"
PREPARE_PATH: "Telegram/build/prepare/prepare.py"
2020-02-24 13:51:53 +00:00
steps:
- name: Get repository name.
2020-10-25 01:46:27 +00:00
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
- name: Clone.
uses: actions/checkout@v4
with:
submodules: recursive
2020-03-20 16:32:06 +00:00
path: ${{ env.REPO_NAME }}
- name: First set up.
run: |
2020-08-11 12:45:30 +00:00
sudo chown -R `whoami`:admin /usr/local/share
2024-03-14 06:17:15 +00:00
brew update
brew upgrade || true
brew install automake meson nasm ninja pkg-config
2021-02-25 02:34:15 +00:00
# Disable spotlight.
sudo mdutil -a -i off
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
- name: ThirdParty cache.
id: cache-third-party
uses: actions/cache@v4
with:
path: ThirdParty
key: ${{ runner.OS }}-third-party-${{ hashFiles(format('{0}/{1}', env.REPO_NAME, env.PREPARE_PATH)) }}
restore-keys: ${{ runner.OS }}-third-party-
- name: Libraries cache.
id: cache-libs
uses: actions/cache@v4
with:
path: Libraries
key: ${{ runner.OS }}-libs-${{ hashFiles(format('{0}/{1}', env.REPO_NAME, env.PREPARE_PATH)) }}
restore-keys: ${{ runner.OS }}-libs-
- name: Libraries.
2020-08-14 06:45:41 +00:00
run: |
./$REPO_NAME/Telegram/build/prepare/mac.sh skip-release silent
2020-08-14 06:45:41 +00:00
- name: Free up some disk space.
run: |
cd Libraries
find . -iname "*.dir" -exec rm -rf {} || true \;
- name: Telegram Desktop build.
if: env.ONLY_CACHE == 'false'
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
else
2020-10-25 01:46:27 +00:00
echo "ARTIFACT_NAME=Telegram" >> $GITHUB_ENV
fi
./configure.sh \
2020-11-17 10:05:26 +00:00
-D CMAKE_C_FLAGS="-Werror" \
-D CMAKE_CXX_FLAGS="-Werror" \
2023-02-10 12:29:24 +00:00
-D CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO \
-D TDESKTOP_API_TEST=ON \
2023-12-31 09:29:54 +00:00
-D DESKTOP_APP_DISABLE_AUTOUPDATE=OFF \
-D DESKTOP_APP_DISABLE_CRASH_REPORTS=OFF \
$DEFINE
cd ../out
2023-02-10 12:29:24 +00:00
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@v4
if: env.UPLOAD_ARTIFACT == 'true'
name: Upload artifact.
with:
name: ${{ env.ARTIFACT_NAME }}
2020-01-22 21:31:38 +00:00
path: ${{ env.REPO_NAME }}/out/Debug/artifact/