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 29, 2025
1 parent 0ae5a3f commit abe7f08
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 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 @@ -39,7 +41,13 @@ jobs:
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)"
rm /usr/local/bin/idle3*
arch -x86_64 /usr/local/bin/brew install ada-url autoconf automake boost cmake ffmpeg libtool openal-soft openh264 openssl opus ninja pkg-config python 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 @@ -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 abe7f08

Please # to comment.