Removed nlohmann_json submodule #49
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD | |
on: [push, pull_request] | |
jobs: | |
build-linux: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
lfs: true | |
- name: Install prerequisites | |
run: sudo apt-get update -y && sudo apt-get install -y | |
libasound2-dev | |
libfmt-dev | |
libfreetype-dev | |
libsdl2-dev | |
libspdlog-dev | |
nlohmann-json3-dev | |
- name: Configure CMake | |
run: cmake | |
-B ${{github.workspace}}/build | |
-D CMAKE_CXX_FLAGS="-Wall -Wextra" | |
-D CMAKE_BUILD_TYPE=Release | |
-D MC_COMMIT_SHA=${{github.sha}} | |
-D MC_BUILD_NUMBER=${{github.run_number}} | |
-D CPACK_GENERATOR=DEB | |
-D CPACK_SYSTEM_NAME=ubuntu-22.04 | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --target midiconn -j `nproc` | |
- name: Create DEB package | |
run: cd ${{github.workspace}}/build && cpack -C Release | |
- name: Upload Artifacts | |
uses: actions/[email protected] | |
with: | |
path: | | |
${{github.workspace}}/build/midiconn | |
${{github.workspace}}/build/*.deb | |
build-flatpak: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
lfs: true | |
- name: Install prerequisites | |
run: sudo apt-get update -y && sudo apt-get install -y | |
appstream-util | |
flatpak-builder | |
- name: Validate metainfo | |
run: appstream-util validate | |
${{github.workspace}}/data/packaging/xyz.safeworlds.midiconn.metainfo.xml | |
- name: Install flatpak prerequisites | |
run: sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo && | |
sudo flatpak install -y flathub org.freedesktop.Sdk//22.08 org.freedesktop.Platform//22.08 | |
- name: Build flatpak | |
run: flatpak-builder build/flatpak ${{github.workspace}}/data/packaging/xyz.safeworlds.midiconn.yml | |
build-windows: | |
runs-on: windows-2022 | |
env: | |
vcpkg-prereqs: nlohmann-json:x64-windows spdlog:x64-windows sdl2:x64-windows freetype[core]:x64-windows zlib:x64-windows | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
lfs: true | |
- name: Restore vcpkg prerequisites cache | |
id: restore-cache-vcpkg | |
uses: actions/cache/restore@v3 | |
with: | |
path: C:\vcpkg | |
key: ${{env.vcpkg-prereqs}} | |
- name: Install prerequisites | |
if: ${{ steps.restore-cache-vcpkg.outputs.cache-hit != 'true' }} | |
run: vcpkg install ${{env.vcpkg-prereqs}} | |
- name: Save vcpkg prerequisites cache | |
if: ${{ steps.restore-cache-vcpkg.outputs.cache-hit != 'true' }} | |
uses: actions/cache/save@v3 | |
with: | |
path: C:\vcpkg | |
key: ${{env.vcpkg-prereqs}} | |
- name: Configure CMake | |
run: cmake | |
-B ${{github.workspace}}/build | |
-D MC_COMMIT_SHA=${{github.sha}} | |
-D MC_BUILD_NUMBER=${{github.run_number}} | |
-D MC_CHECK_FOR_UPDATES=ON | |
-D CMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake | |
-D CMAKE_CXX_FLAGS="/await /EHsc" | |
-T host=x64 | |
-A x64 | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --target midiconn --config Release | |
- name: Build installer | |
run: cd ${{github.workspace}}\build; cpack -C Release | |
- name: Upload Artifacts | |
uses: actions/[email protected] | |
with: | |
path: | | |
${{github.workspace}}\build\Release\*.exe | |
${{github.workspace}}\build\Release\*.dll | |
${{github.workspace}}\build\*.msi | |
release: | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-22.04 | |
needs: | |
- build-linux | |
- build-windows | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
- name: Create GitHub release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
${{github.workspace}}/build/*.deb | |
${{github.workspace}}/build/*.msi | |
- name: Push artifacts to itch.io | |
shell: bash | |
run: | | |
wget https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default -O butler.zip | |
unzip butler.zip | |
./butler push ${{github.workspace}}/build/Release/*.msi mfeproject/midiconn:windows-msi --userversion $GITHUB_REF_NAME | |
./butler push ${{github.workspace}}/build/*.deb mfeproject/midiconn:ubuntu2204-deb --userversion $GITHUB_REF_NAME |