-
Notifications
You must be signed in to change notification settings - Fork 1
94 lines (75 loc) · 2.97 KB
/
mac.yml
File metadata and controls
94 lines (75 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: macOS
on:
workflow_dispatch:
jobs:
macos:
name: macOS
runs-on: macos-26
strategy:
matrix:
defines:
- ""
env:
UPLOAD_ARTIFACT: "true"
ONLY_CACHE: "false"
PREPARE_PATH: "Telegram/build/prepare/prepare.py"
steps:
- name: Get repository name.
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
- name: Clone.
uses: actions/checkout@v6
with:
submodules: recursive
path: ${{ env.REPO_NAME }}
- name: First set up.
run: |
sudo chown -R `whoami`:admin /usr/local/share
brew update
brew upgrade || true
brew install automake libtool meson nasm ninja pkg-config
# Disable spotlight.
sudo mdutil -a -i off
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
sudo sed -i '' '/CMAKE_${lang}_FLAGS_DEBUG_INIT/s/ -g//' /opt/homebrew/share/cmake/Modules/Compiler/GNU.cmake
- name: Libraries cache.
id: cache-libs
uses: actions/cache@v5
with:
path: |
Libraries
ThirdParty
key: ${{ runner.OS }}-libs-${{ hashFiles(format('{0}/{1}', env.REPO_NAME, env.PREPARE_PATH)) }}
restore-keys: ${{ runner.OS }}-libs-
- name: Libraries.
run: |
./$REPO_NAME/Telegram/build/prepare/mac.sh silent
- name: Free up some disk space.
run: find Libraries '(' '(' ! '(' -name '*.a' -o -name '*.h' -o -name '*.hpp' -o -name '*.inc' -o -name '*.cmake' -o -path '*/include/*' -o -path '*/objects-*' -o -path '*/cache_keys/*' -o -path '*/patches/*' -o -perm +111 ')' -type f ')' -o -empty ')' -delete
- name: Telegram Desktop build.
if: env.ONLY_CACHE == 'false'
run: |
cd $REPO_NAME/Telegram
echo "ARTIFACT_NAME=AyuGram" >> $GITHUB_ENV
./configure.sh \
-D CMAKE_CONFIGURATION_TYPES=Release \
-D CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO \
-D TDESKTOP_API_ID=2040 \
-D TDESKTOP_API_HASH=b18441a1ff607e10a989891a5462e627 \
-D DESKTOP_APP_DISABLE_AUTOUPDATE=ON \
-D CMAKE_EXE_LINKER_FLAGS="-Wl,-x"
# cmake --build ../out --config Release --parallel
# `xcodebuild` is used instead of `cmake --build` to make icons work properly.
# https://github.com/Bush2021/ayugram/blob/7d16d749fdaf55867754e8d8ef585d04c9382092/Telegram/CMakeLists.txt#L1996
xcodebuild -project ../out/Telegram.xcodeproj -scheme Telegram -configuration Release build
- name: Move artifact.
if: env.UPLOAD_ARTIFACT == 'true'
run: |
cd $REPO_NAME/out/Release
mkdir artifact
mv AyuGram.app artifact/
- uses: actions/upload-artifact@v7
if: env.UPLOAD_ARTIFACT == 'true'
name: Upload artifact.
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.REPO_NAME }}/out/Release/artifact/