2021-09-19 00:44:06 +05:30
|
|
|
name: build-ci
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ "*" ]
|
|
|
|
tags: [ "*" ]
|
2021-09-19 01:05:57 +05:30
|
|
|
paths-ignore:
|
2022-07-24 11:56:43 +05:30
|
|
|
- "**.7z"
|
2021-09-19 00:44:06 +05:30
|
|
|
pull_request:
|
|
|
|
branches: [ main ]
|
|
|
|
|
2022-12-11 13:09:27 +05:30
|
|
|
env:
|
2022-12-24 11:10:42 +05:30
|
|
|
SDL_VER: "2.26.1"
|
2022-12-11 13:09:27 +05:30
|
|
|
FFMPEG_VER: "5.1"
|
2023-01-04 19:11:58 -08:00
|
|
|
QT_VER: "5.15.8"
|
2022-12-11 13:09:27 +05:30
|
|
|
MVK_VER: "1.2.1"
|
|
|
|
|
2021-09-19 00:44:06 +05:30
|
|
|
jobs:
|
2022-12-11 13:09:27 +05:30
|
|
|
SDL:
|
|
|
|
env:
|
2021-09-19 01:05:57 +05:30
|
|
|
MACOSX_DEPLOYMENT_TARGET: "10.13"
|
|
|
|
CCACHE_CPP2: "yes"
|
|
|
|
CCACHE_SLOPPINESS: "time_macros"
|
|
|
|
CC: "ccache clang"
|
|
|
|
CXX: "ccache clang++"
|
2022-07-24 12:20:39 +05:30
|
|
|
OBJC: "clang"
|
2022-12-11 13:09:27 +05:30
|
|
|
runs-on: macos-latest
|
2021-09-19 00:44:06 +05:30
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
run: |
|
2021-10-08 13:51:50 +05:30
|
|
|
git clone -b release-${SDL_VER} https://github.com/libsdl-org/SDL.git --depth 1
|
2021-09-19 00:44:06 +05:30
|
|
|
- name: Set up cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/Library/Caches/ccache
|
|
|
|
key: ${{ runner.os }}-macos-${{ github.sha }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-macos-
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2021-09-19 01:05:57 +05:30
|
|
|
brew install p7zip ccache nasm
|
2021-09-19 00:44:06 +05:30
|
|
|
- name: Build SDL
|
|
|
|
run: |
|
|
|
|
export PATH="/usr/local/opt/ccache/libexec:$PATH"
|
|
|
|
|
2021-09-19 01:05:57 +05:30
|
|
|
mkdir -p SDL/build/sdl-${SDL_VER}
|
|
|
|
cd SDL/build
|
|
|
|
|
2023-01-04 08:22:05 -08:00
|
|
|
cmake ../ -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DBUILD_SHARED_LIBS=1
|
2021-09-19 00:44:06 +05:30
|
|
|
make -j4
|
2021-09-19 01:05:57 +05:30
|
|
|
make install DESTDIR=$(pwd)/sdl-${SDL_VER}
|
|
|
|
|
|
|
|
7z a "sdl-${SDL_VER}.7z" sdl-${SDL_VER}/
|
2022-12-11 13:09:27 +05:30
|
|
|
- name: Pack
|
|
|
|
run: |
|
|
|
|
# move the compiled archive into the artifacts directory to be uploaded
|
|
|
|
mkdir -p artifacts/sdl2
|
|
|
|
mv "SDL/build/sdl-${SDL_VER}.7z" artifacts/sdl2
|
|
|
|
- name: Upload
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: macos
|
|
|
|
path: |
|
|
|
|
artifacts/
|
|
|
|
|
|
|
|
FFmpeg:
|
|
|
|
env:
|
|
|
|
MACOSX_DEPLOYMENT_TARGET: "10.13"
|
|
|
|
CCACHE_CPP2: "yes"
|
|
|
|
CCACHE_SLOPPINESS: "time_macros"
|
|
|
|
CC: "ccache clang"
|
|
|
|
CXX: "ccache clang++"
|
|
|
|
OBJC: "clang"
|
|
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
run: |
|
|
|
|
git clone -b n${FFMPEG_VER} https://git.ffmpeg.org/ffmpeg.git --depth 1
|
|
|
|
- name: Set up cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/Library/Caches/ccache
|
|
|
|
key: ${{ runner.os }}-macos-${{ github.sha }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-macos-
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
brew install p7zip ccache nasm
|
2021-09-19 00:44:06 +05:30
|
|
|
- name: Build FFMPEG
|
|
|
|
run: |
|
|
|
|
export PATH="/usr/local/opt/ccache/libexec:$PATH"
|
|
|
|
|
2023-01-04 08:22:05 -08:00
|
|
|
mkdir -p ffmpeg/build
|
2021-09-19 01:05:57 +05:30
|
|
|
cd ffmpeg/build
|
|
|
|
|
2023-01-04 08:22:05 -08:00
|
|
|
x86path=$(pwd)/x86_64
|
|
|
|
armpath=$(pwd)/arm64
|
|
|
|
|
|
|
|
# Build for x86_64
|
|
|
|
mkdir -p $x86path/install
|
|
|
|
cd $x86path
|
|
|
|
# The included lzma is built for 10.15 can generates linker warnings
|
|
|
|
../../configure --enable-cross-compile --arch=x86_64 \
|
|
|
|
--cc="${CC} -arch x86_64" --cxx="${CXX} -arch x86_64" --enable-shared --disable-static --disable-doc \
|
2021-09-19 00:44:06 +05:30
|
|
|
--disable-lzma
|
|
|
|
make -j4
|
2023-01-04 08:22:05 -08:00
|
|
|
make install DESTDIR=$x86path/install
|
|
|
|
|
|
|
|
# Build for arm64
|
|
|
|
mkdir -p $armpath/install
|
|
|
|
cd $armpath
|
|
|
|
# The included lzma is built for 10.15 can generates linker warnings
|
|
|
|
../../configure --enable-cross-compile --arch=arm64 \
|
|
|
|
--cc="${CC} -arch arm64" --cxx="${CXX} -arch arm64" --enable-shared --disable-static --disable-doc \
|
|
|
|
--disable-lzma
|
|
|
|
make -j4
|
|
|
|
make install DESTDIR=$armpath/install
|
|
|
|
- name: Create universal build
|
|
|
|
run: |
|
|
|
|
cd ffmpeg/build
|
|
|
|
|
|
|
|
x86path=$(pwd)/x86_64
|
|
|
|
armpath=$(pwd)/arm64
|
|
|
|
universalpath=$(pwd)/ffmpeg-${FFMPEG_VER}
|
|
|
|
|
|
|
|
mkdir -p $universalpath
|
|
|
|
for f in $(find $x86path/install); do
|
|
|
|
subpath=${f#$x86path/install}
|
|
|
|
dest=$universalpath$subpath
|
|
|
|
if [ -d "$f" ]; then
|
|
|
|
mkdir -p "$dest"
|
|
|
|
elif [ -L "$f" ]; then
|
|
|
|
ln -s $(readlink "$f") "$dest"
|
|
|
|
elif [[ ":$f:" == *"/bin/"* ]] || [[ $f == *.a ]] || [[ $f == *.dylib ]]; then
|
|
|
|
lipo -create -output "$dest" "$x86path/install$subpath" "$armpath/install$subpath"
|
|
|
|
else
|
|
|
|
cp "$f" "$dest"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2021-09-19 01:05:57 +05:30
|
|
|
7z a "ffmpeg-${FFMPEG_VER}.7z" ffmpeg-${FFMPEG_VER}/
|
|
|
|
- name: Pack
|
|
|
|
run: |
|
|
|
|
# move the compiled archive into the artifacts directory to be uploaded
|
2022-12-11 13:09:27 +05:30
|
|
|
mkdir -p artifacts/ffmpeg
|
|
|
|
mv "ffmpeg/build/ffmpeg-${FFMPEG_VER}.7z" artifacts/ffmpeg
|
2021-09-19 00:44:06 +05:30
|
|
|
- name: Upload
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: macos
|
|
|
|
path: |
|
2021-09-19 01:05:57 +05:30
|
|
|
artifacts/
|
2022-12-11 13:09:27 +05:30
|
|
|
|
2023-01-04 19:11:58 -08:00
|
|
|
Qt:
|
|
|
|
env:
|
|
|
|
MACOSX_DEPLOYMENT_TARGET: "10.13"
|
|
|
|
CCACHE_CPP2: "yes"
|
|
|
|
CCACHE_SLOPPINESS: "time_macros"
|
|
|
|
CC: "ccache clang"
|
|
|
|
CXX: "ccache clang++"
|
|
|
|
OBJC: "clang"
|
|
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
run: |
|
|
|
|
wget https://download.qt.io/official_releases/qt/${QT_VER%.*}/${QT_VER}/single/qt-everywhere-opensource-src-${QT_VER}.tar.xz
|
|
|
|
tar xf qt-everywhere-opensource-src-${QT_VER}.tar.xz
|
|
|
|
mv qt-everywhere-src-${QT_VER} qt
|
|
|
|
- name: Set up cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/Library/Caches/ccache
|
|
|
|
key: ${{ runner.os }}-macos-${{ github.sha }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-macos-
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
brew install p7zip ccache
|
|
|
|
- name: Build Qt
|
|
|
|
run: |
|
|
|
|
export PATH="/usr/local/opt/ccache/libexec:$PATH"
|
|
|
|
|
|
|
|
mkdir -p qt/build/qt-${QT_VER}
|
|
|
|
cd qt/build
|
|
|
|
|
|
|
|
../configure -prefix $(pwd)/qt-${QT_VER} -device-option QMAKE_APPLE_DEVICE_ARCHS="x86_64 arm64" \
|
|
|
|
-debug-and-release -opensource -opengl desktop -mp -ltcg \
|
|
|
|
-nomake examples -nomake tests \
|
|
|
|
-skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcharts -skip qtconnectivity -skip qtdatavis3d \
|
|
|
|
-skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtlocation -skip qtlottie -skip qtmacextras \
|
|
|
|
-skip qtnetworkauth -skip qtpurchasing -skip qtquick3d -skip qtquickcontrols -skip qtquicktimeline \
|
|
|
|
-skip qtremoteobjects -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport \
|
|
|
|
-skip qtspeech -skip qtsvg -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview \
|
|
|
|
-skip qtx11extras -skip qtxmlpatterns -skip qtvirtualkeyboard -skip qtquickcontrols2 -skip qtdeclarative \
|
|
|
|
-skip qtnetworkauth -skip qtwinextras -skip qtimageformats
|
|
|
|
make -j4
|
|
|
|
make install
|
|
|
|
|
|
|
|
7z a "qt-${QT_VER}.7z" qt-${QT_VER}/
|
|
|
|
- name: Pack
|
|
|
|
run: |
|
|
|
|
# move the compiled archive into the artifacts directory to be uploaded
|
|
|
|
mkdir -p artifacts/qt
|
|
|
|
mv "qt/build/qt-${QT_VER}.7z" artifacts/qt
|
|
|
|
- name: Upload
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: macos
|
|
|
|
path: |
|
|
|
|
artifacts/
|
|
|
|
|
2022-12-11 13:09:27 +05:30
|
|
|
MoltenVK:
|
|
|
|
env:
|
|
|
|
MACOSX_DEPLOYMENT_TARGET: "10.13"
|
|
|
|
CCACHE_CPP2: "yes"
|
|
|
|
CCACHE_SLOPPINESS: "time_macros"
|
|
|
|
CC: "clang"
|
|
|
|
CXX: "clang++"
|
|
|
|
OBJC: "clang"
|
|
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
run: |
|
|
|
|
git clone -b v${MVK_VER} https://github.com/KhronosGroup/MoltenVK.git --depth 1
|
|
|
|
- name: Set up cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/Library/Caches/ccache
|
|
|
|
External/build
|
|
|
|
!External/build/Intermediates
|
|
|
|
key: ${{ runner.os }}-macos-${{ github.sha }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-macos-
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
brew install p7zip ccache
|
|
|
|
cd MoltenVK
|
|
|
|
./fetchDependencies -v --macos
|
|
|
|
- name: Build MoltenVK
|
|
|
|
run: |
|
|
|
|
export PATH="/usr/local/opt/ccache/libexec:$PATH"
|
|
|
|
cd MoltenVK
|
|
|
|
|
|
|
|
make macos -j4
|
|
|
|
|
|
|
|
# Workaround unsupported `make install` to custom prefix
|
|
|
|
mkdir -p moltenvk-${MVK_VER}/Library/Frameworks/
|
|
|
|
cp -a Package/Latest/MoltenVK/MoltenVK.xcframework moltenvk-${MVK_VER}/Library/Frameworks/
|
|
|
|
|
|
|
|
7z a "moltenvk-${MVK_VER}.7z" moltenvk-${MVK_VER}/
|
|
|
|
- name: Pack
|
|
|
|
run: |
|
|
|
|
# move the compiled archive into the artifacts directory to be uploaded
|
|
|
|
mkdir -p artifacts/moltenvk
|
|
|
|
mv "MoltenVK/moltenvk-${MVK_VER}.7z" artifacts/moltenvk
|
|
|
|
- name: Upload
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: macos
|
|
|
|
path: |
|
|
|
|
artifacts/
|
|
|
|
PR:
|
2022-12-24 14:23:42 +05:30
|
|
|
if: ${{ github.ref == 'refs/heads/main' }}
|
2022-12-11 13:09:27 +05:30
|
|
|
runs-on: ubuntu-latest
|
2023-01-04 19:11:58 -08:00
|
|
|
needs: [SDL, FFmpeg, Qt, MoltenVK]
|
2022-12-11 13:09:27 +05:30
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
path: ~/
|
|
|
|
- name: Copy Artifacts
|
|
|
|
run: cp -r ~/macos/* ./
|
|
|
|
- name: Create Pull Request
|
|
|
|
uses: peter-evans/create-pull-request@v4
|
|
|
|
with:
|
|
|
|
delete-branch: true
|
|
|
|
title: '[Auto] The bump by Github Actions'
|
2022-12-24 14:23:24 +05:30
|
|
|
commit-message: |
|
|
|
|
[Auto] Bumps
|
|
|
|
- SDL2 ${{ env.SDL_VER }}
|
|
|
|
- FFmpeg ${{ env.FFMPEG_VER }}
|
2023-01-04 19:11:58 -08:00
|
|
|
- Qt ${{ env.QT_VER }}
|
2022-12-24 14:23:24 +05:30
|
|
|
- MoltenVK ${{ env.MVK_VER }}
|
2022-12-11 13:09:27 +05:30
|
|
|
body: |
|
|
|
|
Bumps
|
|
|
|
- SDL2 ${{ env.SDL_VER }}
|
|
|
|
- FFmpeg ${{ env.FFMPEG_VER }}
|
2023-01-04 19:11:58 -08:00
|
|
|
- Qt ${{ env.QT_VER }}
|
2022-12-11 13:09:27 +05:30
|
|
|
- MoltenVK ${{ env.MVK_VER }}
|