78 lines
2.2 KiB
YAML
Raw Normal View History

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 ]
jobs:
macos:
runs-on: macos-latest
env:
2022-07-24 11:59:08 +05:30
SDL_VER: "2.0.22"
FFMPEG_VER: "5.1"
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"
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
git clone -b n${FFMPEG_VER} https://git.ffmpeg.org/ffmpeg.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
2021-09-19 00:44:06 +05:30
cmake ../ -DBUILD_SHARED_LIBS=1
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}/
2021-09-19 00:44:06 +05:30
- name: Build FFMPEG
run: |
export PATH="/usr/local/opt/ccache/libexec:$PATH"
2021-09-19 01:05:57 +05:30
mkdir -p ffmpeg/build/ffmpeg-${FFMPEG_VER}
cd ffmpeg/build
# The included lzma is built for 10.15 can generaates linker warnings
2021-09-19 00:44:06 +05:30
../configure --cc="${CC}" --cxx="${CXX}" --enable-shared --disable-static --disable-doc \
--disable-lzma
make -j4
make install DESTDIR=$(pwd)/ffmpeg-${FFMPEG_VER}
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
mkdir artifacts
mv "SDL/build/sdl-${SDL_VER}.7z" artifacts/
mv "ffmpeg/build/ffmpeg-${FFMPEG_VER}.7z" artifacts/
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/