Skip to content

Commit

Permalink
Try to fix actions
Browse files Browse the repository at this point in the history
  • Loading branch information
caiiiycuk committed Jan 26, 2024
1 parent 89cfb44 commit f8f6ffe
Show file tree
Hide file tree
Showing 5 changed files with 425 additions and 268 deletions.
91 changes: 75 additions & 16 deletions .github/workflows/vangers_linux_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,82 @@ name: Vangers Linux Build

on: [push, pull_request]

env:
ARCHITECTURE: 64

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: update repos
run: sudo apt-get update
- name: install libs
run: sudo apt-get install cmake libsdl2-dev libsdl2-net-dev libogg-dev libvorbis-dev libavcodec-dev libavformat-dev libavutil-dev
- name: clunk download lib
run: git clone --depth 1 https://github.com/stalkerg/clunk.git clunk
working-directory: /tmp
- name: clunk build and install
run: cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_C_COMPILER=/usr/bin/gcc-9 -DCMAKE_CXX_COMPILER=/usr/bin/g++-9 . && make && sudo make install
working-directory: /tmp/clunk
- name: configure
run: mkdir build && cd build && cmake -DCMAKE_C_COMPILER=/usr/bin/gcc-9 -DCMAKE_CXX_COMPILER=/usr/bin/g++-9 ..
- name: make
run: make
working-directory: build
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Run the build process with Docker
uses: addnab/docker-run-action@v3
with:
image: registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest
options: -v ${{ github.workspace }}:/app
shell: bash
run: |
set -xe
cd /app
apt install -y gcc-9 g++-9 ninja-build yasm
echo "Install rust & cargo"
curl https://sh.rustup.rs -sSf | sh -s -- -y
echo "Compile renderer_ng"
pushd vange-rs/lib/ffi
export PATH=$HOME/.cargo/bin:$PATH
cargo build --release
ls -lh ../../target
popd
echo "Install Clunk"
git clone --depth 1 https://github.com/stalkerg/clunk.git clunk
cd clunk
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc-9 -DCMAKE_CXX_COMPILER=g++-9 -DWITH_SSE=${{ env.ARCHITECTURE == '64' && 'OFF' || 'ON' }}
make -j$(nproc)
make install
cd /app
echo "Install FFMpeg"
git clone --depth 1 --branch release/6.0 https://git.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg
./configure --enable-shared --prefix=/usr/local \
--disable-everything \
--enable-swscale \
--enable-zlib \
--enable-demuxer=avi,rawvideo \
--enable-decoder=png,rawvideo,h264 \
--enable-parser=png \
--enable-protocol=file \
--disable-d3d11va \
--disable-dxva2 \
--disable-vaapi \
--disable-vdpau \
--disable-vulkan \
--disable-doc --disable-ffplay --disable-ffprobe --disable-ffmpeg \
--disable-static --disable-bzlib --disable-libopenjpeg --disable-iconv
make -j$(nproc)
make install
cd /app
mkdir build
cd build
echo "Compile Vangers"
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc-9 -DCMAKE_CXX_COMPILER=g++-9 -DCMAKE_SKIP_RPATH=ON
VERBOSE=1 make -j$(nproc)
cd /app
mkdir -p artifacts
cp build/src/vangers artifacts/vangers${{ env.ARCHITECTURE }}.bin
cp /usr/local/lib/libclunk.so artifacts/lib${{ env.ARCHITECTURE }}
cp /usr/local/lib/libavcodec.so.60 artifacts/lib${{ env.ARCHITECTURE }}
cp /usr/local/lib/libavformat.so.60 artifacts/lib${{ env.ARCHITECTURE }}
cp /usr/local/lib/libavutil.so.58 artifacts/lib${{ env.ARCHITECTURE }}
cp /usr/lib/i386-linux-gnu/libSDL2_net-2.0.so.0 artifacts/lib${{ env.ARCHITECTURE }}
cp /usr/lib/x86_64-linux-gnu/libSDL2_net-2.0.so.0 artifacts/lib${{ env.ARCHITECTURE }}
tar -cvf artifacts.tar artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: Vangers-Release-linux${{ env.ARCHITECTURE }}
path: artifacts.tar
247 changes: 163 additions & 84 deletions .github/workflows/vangers_macos_build.yml
Original file line number Diff line number Diff line change
@@ -1,100 +1,179 @@
name: Vangers MacOS Build

on: [push, pull_request]

env:
MACOSX_DEPLOYMENT_TARGET: 11

jobs:
build:
runs-on: macos-11
steps:
- uses: actions/checkout@v2
# - name: update repos
# run: |
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# brew update
- name: install libs
run: |
brew install ninja yasm dylibbundler
- name: install our libs
run: |
- uses: actions/checkout@v3
with:
submodules: recursive

- name: install libs
run: |
brew install ninja yasm dylibbundler
- name: install our libs
run: |
# brew reinstall -s ./formulas/libsndfile.rb --force --verbose --debug
# brew reinstall -s ./formulas/libogg.rb --force --verbose --debug
# brew reinstall -s ./formulas/libvorbis.rb --force --verbose --debug
# brew install -s ./formulas/sdl2.rb --force --verbose --debug
# brew install -s ./formulas/sdl2_net.rb --force --verbose --debug
brew install sdl2 sdl2_net libvorbis libogg libsndfile
- name: clunk -- download lib
run: git clone --depth 1 https://github.com/stalkerg/clunk.git clunk
- name: clunk -- create build dir
run: mkdir clunk/build
- name: clunk -- build and install
run: cmake -DCMAKE_INSTALL_PREFIX=/usr/local -G Ninja .. && ninja && sudo ninja install
working-directory: clunk/build
env:
MACOSX_DEPLOYMENT_TARGET: 10.12
- name: ffmpeg -- download
run: git clone --depth 1 --branch n4.2.3 https://git.ffmpeg.org/ffmpeg.git ffmpeg
- name: ffmpeg -- configure
run: ./configure --enable-shared --prefix=/usr/local
--cc=clang
--arch=x86_64
--cpu=westmere
--disable-everything
--enable-swscale
--enable-zlib
--enable-demuxer=avi,rawvideo
--enable-decoder=png,rawvideo,h264
--enable-parser=png
--enable-protocol=file
--disable-d3d11va
--disable-dxva2
--disable-avx
--disable-doc --disable-ffplay --disable-ffprobe --disable-ffmpeg
--disable-static --disable-bzlib --disable-libopenjpeg --disable-iconv
working-directory: ffmpeg
- name: ffmpeg -- build and install
run: |
make -j4
sudo make install
working-directory: ffmpeg
- name: configure
run: mkdir build && cd build && cmake -G Ninja ..
- name: make
run: ninja
working-directory: build
- name: vangers -- prepare release folder
run: |
mkdir Vangers.app/Contents/Frameworks
mkdir Vangers.app/Contents/Libs
cp -L /usr/local/lib/libSDL2-2.0.0.dylib Vangers.app/Contents/Libs/
cp -L /usr/local/lib/libSDL2_net-2.0.0.dylib Vangers.app/Contents/Libs/
cp -L /usr/local/lib/libavcodec.58.54.100.dylib Vangers.app/Contents/Libs/
cp -L /usr/local/lib/libavformat.58.29.100.dylib Vangers.app/Contents/Libs/
cp -L /usr/local/lib/libavutil.56.31.100.dylib Vangers.app/Contents/Libs/
cp -L /usr/local/lib/libogg.0.dylib Vangers.app/Contents/Libs/
cp -L /usr/local/lib/libvorbis.0.dylib Vangers.app/Contents/Libs/
cp -L /usr/local/lib/libvorbisfile.3.dylib Vangers.app/Contents/Libs/
cp clunk/build/libclunk.dylib Vangers.app/Contents/Libs/
cp build/src/vangers Vangers.app/Contents/MacOS/Vangers
dylibbundler -x Vangers.app/Contents/MacOS/Vangers
strip Vangers.app/Contents/MacOS/Vangers
sudo chmod 777 Vangers.app/Contents/Libs/*
install_name_tool -change /usr/local/opt/libogg/lib/libogg.0.dylib "@executable_path/../Libs/libogg.0.dylib" Vangers.app/Contents/Libs/libvorbis.0.dylib
install_name_tool -change /usr/local/Cellar/libvorbis/1.3.6/lib/libvorbis.0.dylib "@executable_path/../Libs/libvorbis.0.dylib" Vangers.app/Contents/Libs/libvorbisfile.3.dylib
install_name_tool -change /usr/local/opt/libogg/lib/libogg.0.dylib "@executable_path/../Libs/libogg.0.dylib" Vangers.app/Contents/Libs/libvorbisfile.3.dylib
mv Vangers.app/Contents/Libs/libavcodec.58.54.100.dylib Vangers.app/Contents/Libs/libavcodec.58.dylib
mv Vangers.app/Contents/Libs/libavformat.58.29.100.dylib Vangers.app/Contents/Libs/libavformat.58.dylib
mv Vangers.app/Contents/Libs/libavutil.56.31.100.dylib Vangers.app/Contents/Libs/libavutil.56.dylib
install_name_tool -change "@executable_path/../libs/libavcodec.58.54.100.dylib" "@executable_path/../Libs/libavcodec.58.dylib" Vangers.app/Contents/MacOS/Vangers
install_name_tool -change "@executable_path/../libs/libavformat.58.29.100.dylib" "@executable_path/../Libs/libavformat.58.dylib" Vangers.app/Contents/MacOS/Vangers
install_name_tool -change "@executable_path/../libs/libavutil.56.31.100.dylib" "@executable_path/../Libs/libavutil.56.dylib" Vangers.app/Contents/MacOS/Vangers
install_name_tool -change "/usr/local/lib/libavutil.56.dylib" "@executable_path/../Libs/libavutil.56.dylib" Vangers.app/Contents/Libs/libavcodec.58.dylib
install_name_tool -change "/usr/local/lib/libavutil.56.dylib" "@executable_path/../Libs/libavutil.56.dylib" Vangers.app/Contents/Libs/libavformat.58.dylib
install_name_tool -change "/usr/local/lib/libavcodec.58.dylib" "@executable_path/../Libs/libavcodec.58.dylib" Vangers.app/Contents/Libs/libavformat.58.dylib
install_name_tool -change "/usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib" "@executable_path/../Libs/libSDL2-2.0.0.dylib" Vangers.app/Contents/Libs/libSDL2_net-2.0.0.dylib
tar -cvf Vangers.app.tar Vangers.app
- uses: actions/upload-artifact@v2
with:
name: Vangers.app.tar
path: Vangers.app.tar
- name: vange-rs -- install rustup
if: steps.vange-rs-cache-build.outputs.cache-hit != 'true'
uses: actions-rs/toolchain@v1
with:
toolchain: "stable"
target: x86_64-apple-darwin
default: true

- name: vange-rs -- build
if: steps.vange-rs-cache-build.outputs.cache-hit != 'true'
run: cargo build --release
working-directory: vange-rs/lib/ffi

- name: clunk -- download
run: |
git clone --depth 1 https://github.com/stalkerg/clunk.git clunk
echo "CLUNK_SHORT_COMMIT_SHA=$(git -C clunk rev-parse --short HEAD)" >> $GITHUB_ENV
- name: clunk -- cache
id: cache-clunk
uses: actions/cache@v3
with:
path: clunk/build
key: macos-clunk-${{ env.CLUNK_SHORT_COMMIT_SHA }}

- name: clunk -- create build dir
if: steps.cache-clunk.outputs.cache-hit != 'true'
run: mkdir clunk/build

- name: clunk -- build
working-directory: clunk/build
if: steps.cache-clunk.outputs.cache-hit != 'true'
run: |
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -G Ninja ..
ninja
- name: clunk -- install
working-directory: clunk/build
run: sudo ninja install

- name: ffmpeg -- cache
id: cache-ffmpeg
uses: actions/cache@v3
with:
path: ffmpeg/build
key: macos-ffmpeg-n4.2.2

- name: ffmpeg -- download
run: git clone --depth 1 --branch n4.2.3 https://git.ffmpeg.org/ffmpeg.git ffmpeg

- name: ffmpeg -- configure
if: steps.cache-ffmpeg.outputs.cache-hit != 'true'
working-directory: ffmpeg
run: ./configure --enable-shared --prefix=/usr/local
--cc=clang
--arch=x86_64
--cpu=westmere
--disable-everything
--enable-swscale
--enable-zlib
--enable-demuxer=avi,rawvideo
--enable-decoder=png,rawvideo,h264
--enable-parser=png
--enable-protocol=file
--disable-d3d11va
--disable-dxva2
--disable-avx
--disable-doc --disable-ffplay --disable-ffprobe --disable-ffmpeg
--disable-static --disable-bzlib --disable-libopenjpeg --disable-iconv

- name: ffmpeg -- build
if: steps.cache-ffmpeg.outputs.cache-hit != 'true'
working-directory: ffmpeg
run: |
make -j4
- name: ffmpeg -- install
working-directory: ffmpeg
run: sudo make install

- name: vangers -- configure
run: mkdir build && cd build && cmake -G Ninja ..

- name: vangers -- make
working-directory: build
run: ninja

- name: vangers -- show depends
working-directory: build
run: otool -L src/vangers

- name: vangers -- prepare release folder
run: |
mkdir Vangers.app/Contents/Frameworks
mkdir Vangers.app/Contents/Libs
cp -L /usr/local/lib/libSDL2-2.0.0.dylib Vangers.app/Contents/Libs/
cp -L /usr/local/lib/libSDL2_net-2.0.0.dylib Vangers.app/Contents/Libs/
cp -L /usr/local/lib/libavcodec.58.54.100.dylib Vangers.app/Contents/Libs/
cp -L /usr/local/lib/libavformat.58.29.100.dylib Vangers.app/Contents/Libs/
cp -L /usr/local/lib/libavutil.56.31.100.dylib Vangers.app/Contents/Libs/
cp -L /usr/local/lib/libogg.0.dylib Vangers.app/Contents/Libs/
cp -L /usr/local/lib/libvorbis.0.dylib Vangers.app/Contents/Libs/
cp -L /usr/local/lib/libvorbisfile.3.dylib Vangers.app/Contents/Libs/
cp clunk/build/libclunk.dylib Vangers.app/Contents/Libs/
cp build/src/vangers Vangers.app/Contents/MacOS/Vangers
dylibbundler -i "@loader_path/" -x Vangers.app/Contents/MacOS/Vangers
install_name_tool -change "@loader_path/libEGL.dylib" "@executable_path/../Libs/libEGL.dylib" Vangers.app/Contents/MacOS/Vangers
install_name_tool -change "@loader_path/libGLESv2.dylib" "@executable_path/../Libs/libGLESv2.dylib" Vangers.app/Contents/MacOS/Vangers
install_name_tool -change "@executable_path/../libs/libogg.0.8.5.dylib" "@executable_path/../libs/libogg.0.dylib" Vangers.app/Contents/MacOS/Vangers
rm Vangers.app/Contents/MacOS/libEGL.dylib
rm Vangers.app/Contents/MacOS/libGLESv2.dylib
otool -L Vangers.app/Contents/MacOS/Vangers
strip Vangers.app/Contents/MacOS/Vangers
sudo chmod 777 Vangers.app/Contents/Libs/*
install_name_tool -change /usr/local/opt/libogg/lib/libogg.0.dylib "@executable_path/../Libs/libogg.0.dylib" Vangers.app/Contents/Libs/libvorbis.0.dylib
install_name_tool -change /usr/local/Cellar/libvorbis/1.3.7/lib/libvorbis.0.dylib "@executable_path/../Libs/libvorbis.0.dylib" Vangers.app/Contents/Libs/libvorbisfile.3.dylib
install_name_tool -change /usr/local/opt/libogg/lib/libogg.0.dylib "@executable_path/../Libs/libogg.0.dylib" Vangers.app/Contents/Libs/libvorbisfile.3.dylib
mv Vangers.app/Contents/Libs/libavcodec.58.54.100.dylib Vangers.app/Contents/Libs/libavcodec.58.dylib
mv Vangers.app/Contents/Libs/libavformat.58.29.100.dylib Vangers.app/Contents/Libs/libavformat.58.dylib
mv Vangers.app/Contents/Libs/libavutil.56.31.100.dylib Vangers.app/Contents/Libs/libavutil.56.dylib
install_name_tool -change "@executable_path/../libs/libavcodec.58.54.100.dylib" "@executable_path/../Libs/libavcodec.58.dylib" Vangers.app/Contents/MacOS/Vangers
install_name_tool -change "@executable_path/../libs/libavformat.58.29.100.dylib" "@executable_path/../Libs/libavformat.58.dylib" Vangers.app/Contents/MacOS/Vangers
install_name_tool -change "@executable_path/../libs/libavutil.56.31.100.dylib" "@executable_path/../Libs/libavutil.56.dylib" Vangers.app/Contents/MacOS/Vangers
install_name_tool -change "/usr/local/lib/libavutil.56.dylib" "@executable_path/../Libs/libavutil.56.dylib" Vangers.app/Contents/Libs/libavcodec.58.dylib
install_name_tool -change "/usr/local/lib/libavutil.56.dylib" "@executable_path/../Libs/libavutil.56.dylib" Vangers.app/Contents/Libs/libavformat.58.dylib
install_name_tool -change "/usr/local/lib/libavcodec.58.dylib" "@executable_path/../Libs/libavcodec.58.dylib" Vangers.app/Contents/Libs/libavformat.58.dylib
install_name_tool -change "/usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib" "@executable_path/../Libs/libSDL2-2.0.0.dylib" Vangers.app/Contents/Libs/libSDL2_net-2.0.0.dylib
install_name_tool -change "/usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib" "@executable_path/../Libs/libSDL2-2.0.0.dylib" Vangers.app/Contents/Libs/libclunk.dylib
echo "libclunk.dylib"
otool -L Vangers.app/Contents/Libs/libclunk.dylib
echo "libvorbisfile.3.dylib"
otool -L Vangers.app/Contents/Libs/libvorbisfile.3.dylib
echo "libvorbis.0.dylib"
otool -L Vangers.app/Contents/Libs/libvorbis.0.dylib
echo "libogg.0.dylib"
otool -L Vangers.app/Contents/Libs/libogg.0.dylib
echo "libavutil.56.dylib"
otool -L Vangers.app/Contents/Libs/libavutil.56.dylib
echo "libavformat.58.dylib"
otool -L Vangers.app/Contents/Libs/libavformat.58.dylib
echo "libavcodec.58.dylib"
otool -L Vangers.app/Contents/Libs/libavcodec.58.dylib
echo "libSDL2_net-2.0.0.dylib"
otool -L Vangers.app/Contents/Libs/libSDL2_net-2.0.0.dylib
echo "libSDL2-2.0.0.dylib"
otool -L Vangers.app/Contents/Libs/libSDL2-2.0.0.dylib
tar -cvf Vangers.app.tar Vangers.app
- uses: actions/upload-artifact@v3
with:
name: Vangers-Release-MacOS
path: Vangers.app.tar
Loading

0 comments on commit f8f6ffe

Please sign in to comment.