mirror of
https://github.com/decaf-emu/decaf-emu.git
synced 2025-04-02 10:42:13 -04:00
225 lines
7.5 KiB
YAML
225 lines
7.5 KiB
YAML
name: C/C++ CI
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
windows-build:
|
|
runs-on: windows-2019
|
|
strategy:
|
|
fail-fast: false
|
|
|
|
env:
|
|
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
|
|
VCPKG_BUILD_TYPE: 'release'
|
|
VCPKG_ROOT: '${{github.workspace}}/libraries/vcpkg'
|
|
OS: windows-2019
|
|
MSVC: msvc2019_64
|
|
COMPILER: cl
|
|
VULKAN_VERSION: 1.3.211.0
|
|
QT_VERSION: 5.15.0
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Initialise
|
|
run: mkdir build
|
|
|
|
- name: "Fetch full history for vcpkg submodule"
|
|
run: |
|
|
cd libraries/vcpkg
|
|
git fetch --unshallow
|
|
git pull --all
|
|
|
|
- name: 'Setup vcpkg'
|
|
run: ./libraries/vcpkg/bootstrap-vcpkg.bat
|
|
|
|
- name: 'Setup NuGet Credentials'
|
|
shell: 'bash'
|
|
run: >
|
|
cd build &&
|
|
`../libraries/vcpkg/vcpkg fetch nuget | tail -n 1`
|
|
sources add
|
|
-source "https://nuget.pkg.github.com/decaf-emu/index.json"
|
|
-storepasswordincleartext
|
|
-name "GitHub"
|
|
-username "decaf-emu"
|
|
-password "${{ secrets.GITHUB_TOKEN }}"
|
|
-Verbosity "detailed"
|
|
|
|
- name: Load Cached Vulkan SDK
|
|
id: cache-vulkan-windows
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: C:/VulkanSDK/${{ env.VULKAN_VERSION }}
|
|
key: ${{ runner.os }}-${{ env.VULKAN_VERSION }}
|
|
|
|
- name: Install Vulkan SDK from web
|
|
if: steps.cache-vulkan-windows.outputs.cache-hit != 'true'
|
|
shell: powershell
|
|
run: |
|
|
mkdir "C:\\VulkanSDK"
|
|
cd "C:\\VulkanSDK"
|
|
Invoke-WebRequest "https://sdk.lunarg.com/sdk/download/${{ env.VULKAN_VERSION }}/windows/VulkanSDK-${{ env.VULKAN_VERSION }}-Installer.exe?u=" -OutFile "VulkanSDK.exe"
|
|
Start-Process -FilePath VulkanSDK.exe -Wait -PassThru -ArgumentList @("in --al --da --ao --confirm-command");
|
|
cd "C:\\VulkanSDK\\${{ env.VULKAN_VERSION }}"
|
|
Remove-Item -Force -Recurse Demos
|
|
Remove-Item -Force -Recurse Templates
|
|
Remove-Item -Force -Recurse Tools
|
|
Remove-Item -Force maintenancetool.exe
|
|
Remove-Item -Force Bin\\VkLayer*
|
|
Remove-Item -Force Lib\\shaderc*
|
|
dir
|
|
|
|
- name: Load Cached Qt
|
|
id: cache-qt-windows
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: C:/Qt/${{ env.QT_VERSION }}/${{ env.MSVC }}
|
|
key: ${{ runner.os }}-qt-${{ env.QT_VERSION }}-${{ env.MSVC }}
|
|
|
|
- name: Install Qt from web
|
|
if: steps.cache-qt-windows.outputs.cache-hit != 'true'
|
|
shell: powershell
|
|
run: |
|
|
mkdir "C:\\Qt"
|
|
cd "C:\\Qt"
|
|
pip install aqtinstall
|
|
cmd /c 'python 2>&1' -m aqt install ${{ env.QT_VERSION }} windows desktop win64_${{ env.MSVC }}
|
|
dir
|
|
|
|
- name: Setup Environment
|
|
shell: powershell
|
|
run: |
|
|
echo "VULKAN_SDK=C:\\VulkanSDK\\${{ env.VULKAN_VERSION }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
echo "QTDIR=C:\\Qt\\${{ env.QT_VERSION }}\\${{ env.MSVC }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
|
|
- name: Configure
|
|
shell: cmd
|
|
run: |
|
|
cd build
|
|
cmake -DCMAKE_TOOLCHAIN_FILE=../libraries/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-release -DVCPKG_HOST_TRIPLET=x64-windows-release -DCMAKE_BUILD_TYPE=Release -DDECAF_BUILD_TOOLS=ON -DDECAF_VULKAN=ON -DDECAF_QT=ON -DCMAKE_PREFIX_PATH=%QTDIR% -DCMAKE_INSTALL_PREFIX=install ..
|
|
|
|
- name: Build
|
|
run: |
|
|
cd build
|
|
cmake --build . --config Release -j 2 --target install
|
|
|
|
- uses: actions/upload-artifact@master
|
|
with:
|
|
name: decaf-emu-${{ env.OS }}
|
|
path: build/install
|
|
|
|
ubuntu-build:
|
|
runs-on: ubuntu-20.04
|
|
strategy:
|
|
fail-fast: false
|
|
|
|
env:
|
|
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
|
|
VCPKG_BUILD_TYPE: 'release'
|
|
VCPKG_ROOT: '${{github.workspace}}/libraries/vcpkg'
|
|
OS: ubuntu-20.04
|
|
MSVC: msvc2019_64
|
|
COMPILER: gcc
|
|
VERSION: 10
|
|
QT_VERSION: 5.15.0
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: true
|
|
|
|
- name: cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.ccache
|
|
key: build-ccache-${{github.run_id}}
|
|
restore-keys: |
|
|
build-ccache
|
|
|
|
- name: Initialise
|
|
run: |
|
|
mkdir build
|
|
|
|
- name: Install Dependencies
|
|
run: |
|
|
cd build
|
|
wget -qO - http://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
|
|
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-focal.list http://packages.lunarg.com/vulkan/lunarg-vulkan-focal.list
|
|
sudo apt-add-repository ppa:cginternals/ppa
|
|
sudo apt-get update
|
|
sudo apt-get install -y cmake ccache vulkan-sdk python3-setuptools mesa-common-dev libglu1-mesa-dev ninja-build libcurl4-openssl-dev libsdl2-dev libssl-dev zlib1g-dev libuv1-dev libc-ares-dev libavcodec-dev libavfilter-dev libavutil-dev libswscale-dev
|
|
if [ "${{ env.COMPILER }}" = "gcc" ]; then
|
|
sudo apt-get install -y g++-${{ env.VERSION }}
|
|
else
|
|
sudo apt-get install -y clang-${{ env.VERSION }}
|
|
fi
|
|
pip3 install wheel
|
|
pip3 install aqtinstall
|
|
python3 -m aqt install ${{ env.QT_VERSION }} linux desktop
|
|
PELFVER=0.12
|
|
curl -sSfLO https://github.com/NixOS/patchelf/releases/download/${PELFVER}/patchelf-${PELFVER}.tar.bz2
|
|
tar xvf patchelf-${PELFVER}.tar.bz2
|
|
cd patchelf-${PELFVER}*/
|
|
./configure
|
|
make && sudo make install
|
|
cd ../
|
|
|
|
- name: Setup Environment
|
|
run: |
|
|
if [ "${{ env.COMPILER }}" = "gcc" ]; then
|
|
echo "CC=gcc-${{ env.VERSION }}" >> $GITHUB_ENV
|
|
echo "CXX=g++-${{ env.VERSION }}" >> $GITHUB_ENV
|
|
else
|
|
echo "CC=clang-${{ env.VERSION }}" >> $GITHUB_ENV
|
|
echo "CXX=clang++-${{ env.VERSION}}" >> $GITHUB_ENV
|
|
fi
|
|
echo "QTDIR=$PWD/build/${{ env.QT_VERSION }}/gcc_64" >> $GITHUB_ENV
|
|
echo "VULKAN_SDK=$PWD/vulkan" >> $GITHUB_ENV
|
|
|
|
- name: Configure
|
|
run: |
|
|
cd build
|
|
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DDECAF_BUILD_TOOLS=ON -DDECAF_VULKAN=ON -DDECAF_QT=ON -DCMAKE_PREFIX_PATH=$QTDIR -DCMAKE_INSTALL_PREFIX=install ..
|
|
|
|
- name: Build
|
|
run: |
|
|
cd build
|
|
cmake --build . --config Release -j 2 --target install
|
|
|
|
- uses: actions/upload-artifact@master
|
|
with:
|
|
name: decaf-emu-${{ env.OS }}
|
|
path: build/install
|
|
|
|
create-release:
|
|
needs: [windows-build, ubuntu-build]
|
|
runs-on: "ubuntu-20.04"
|
|
if: github.ref == 'refs/heads/master'
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Download Artifacts
|
|
uses: actions/download-artifact@v2
|
|
|
|
- name: Upload
|
|
shell: bash
|
|
run: |
|
|
if [[ -e decaf-emu-appimage ]]; then
|
|
mv decaf-emu-appimage artifacts
|
|
else
|
|
mkdir artifacts
|
|
fi
|
|
files=$(find . -name "decaf-emu-*" ! -iname "*.zip" -type d)
|
|
for f in $files; do
|
|
echo "Compressing $f"
|
|
(cd $(basename $f) && zip -r ../artifacts/$(basename $f).zip *)
|
|
done
|
|
ls -al artifacts/
|
|
wget -c https://github.com/tcnksm/ghr/releases/download/v0.14.0/ghr_v0.14.0_linux_amd64.tar.gz
|
|
tar xfv ghr_v0.14.0_linux_amd64.tar.gz
|
|
ghr_v0.14.0_linux_amd64/ghr -u ${{ github.repository_owner }} -r decaf-emu -recreate -n 'decaf-emu CI builds' -b "Corresponding commit: ${{ github.sha }}" release artifacts/
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|