Skip to content

Commit

Permalink
try to build for intel macs in actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kukuruzka165 committed Jan 30, 2025
1 parent 0ae5a3f commit cc27bec
Showing 1 changed file with 31 additions and 17 deletions.
48 changes: 31 additions & 17 deletions .github/workflows/mac_packaged.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: MacOS Packaged.
name: macOS

on:
push:
Expand All @@ -9,18 +9,20 @@ on:
jobs:

macos:
name: MacOS
name: macOS
runs-on: macos-latest

strategy:
matrix:
defines:
- ""
arch:
- x86_64
- arm64

env:
GIT: "https://github.com"
CMAKE_PREFIX_PATH: "/opt/homebrew/opt/ffmpeg@6:/opt/homebrew/opt/openal-soft"
UPLOAD_ARTIFACT: "true"
ONLY_CACHE: "false"
MANUAL_CACHING: "1"
AUTO_CACHING: "1"
Expand All @@ -29,17 +31,17 @@ jobs:
- name: Get repository name.
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV

- name: Clone.
uses: actions/checkout@v4
with:
submodules: recursive
path: ${{ env.REPO_NAME }}

- name: First set up.
run: |
brew update
brew upgrade || true
brew install ada-url autoconf automake boost cmake ffmpeg libtool openal-soft openh264 openssl opus ninja pkg-config python qt yasm xz
if [ "${{ matrix.arch }}" == "x86_64" ]; then
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
arch -x86_64 /usr/local/bin/brew install python --force || true
arch -x86_64 /usr/local/bin/brew link --overwrite python
arch -x86_64 /usr/local/bin/brew install ada-url autoconf automake boost cmake ffmpeg libtool openal-soft openh264 openssl opus ninja pkg-config qt yasm xz
else
brew install ada-url autoconf automake boost cmake ffmpeg libtool openal-soft openh264 openssl opus ninja pkg-config python qt yasm xz
fi
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
xcodebuild -version > CACHE_KEY.txt
Expand All @@ -55,6 +57,12 @@ jobs:
echo "LibrariesPath=`pwd`" >> $GITHUB_ENV
curl -o tg_owt-version.json https://api.github.com/repos/desktop-app/tg_owt/git/refs/heads/master
- name: Clone.
uses: actions/checkout@v4
with:
submodules: recursive
path: ${{ env.REPO_NAME }}

- name: RNNoise.
run: |
Expand All @@ -64,8 +72,13 @@ jobs:
cd rnnoise
./autogen.sh
./configure --disable-examples --disable-doc
make -j$(sysctl -n hw.logicalcpu)
sudo make install
if [ "${{ matrix.arch }}" == "x86_64" ]; then
arch -x86_64 make -j$(sysctl -n hw.logicalcpu)
sudo arch -x86_64 make install
else
make -j$(sysctl -n hw.logicalcpu)
sudo make install
fi
- name: WebRTC cache.
id: cache-webrtc
Expand All @@ -82,7 +95,8 @@ jobs:
cd tg_owt
cmake -Bbuild -GNinja . \
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }}
cmake --build build --parallel
Expand All @@ -97,9 +111,9 @@ jobs:
if [ -n "${{ matrix.defines }}" ]; then
DEFINE="-D ${{ matrix.defines }}=ON"
echo Define from matrix: $DEFINE
echo "ARTIFACT_NAME=materialgram_${{ matrix.defines }}" >> $GITHUB_ENV
echo "ARTIFACT_NAME=materialgram_${{ matrix.defines }}_${{ matrix.arch }}" >> $GITHUB_ENV
else
echo "ARTIFACT_NAME=materialgram" >> $GITHUB_ENV
echo "ARTIFACT_NAME=materialgram_${{ matrix.arch }}" >> $GITHUB_ENV
fi
cmake -Bbuild -GNinja . \
Expand All @@ -108,6 +122,7 @@ jobs:
-DCMAKE_FIND_FRAMEWORK=LAST \
-DTDESKTOP_API_ID=${{ secrets.API_ID }} \
-DTDESKTOP_API_HASH=${{ secrets.API_HASH }} \
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} \
$DEFINE
cmake --build build --parallel
Expand All @@ -121,7 +136,6 @@ jobs:
hdiutil create -volname materialgram -srcfolder dmgsrc -ov -format UDZO materialgram.dmg
- name: Move artifact.
if: env.UPLOAD_ARTIFACT == 'true'
run: |
cd $REPO_NAME/build
mkdir artifact
Expand Down

0 comments on commit cc27bec

Please # to comment.