CD setup for automatic builds on all platforms (#1)

This commit is contained in:
Lorenzooone
2024-05-28 15:56:13 +02:00
parent c2866649c6
commit 30944dabc7
4 changed files with 139 additions and 8 deletions

71
.github/workflows/cd_main.yml vendored Normal file
View File

@@ -0,0 +1,71 @@
name: CD
on:
# Trigger the workflow on push,
# but only for the master branch
push:
branches:
- main
jobs:
build:
name: ${{ matrix.platform.name }} ${{ matrix.config.name }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- { name: Windows VS2022, os: windows-2022 }
- { name: Linux GCC, os: ubuntu-latest }
- { name: macOS x64, os: macos-13 }
- { name: macOS Apple Silicon, os: macos-14 }
config:
- { name: Static, flags: -DBUILD_SHARED_LIBS=FALSE }
steps:
- name: Install Linux Dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install libxrandr-dev libxcursor-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev
- name: Checkout
uses: actions/checkout@v3
- name: Configure
shell: bash
run: cmake -S . -B build -DCMAKE_INSTALL_PREFIX=install ${{matrix.platform.flags}} ${{matrix.config.flags}}
- name: Build
shell: bash
run: cmake --build build --config Release
- name: Pack
shell: bash
run: cd build && cpack -G ZIP
- name: Archive resulting artifact
uses: actions/upload-artifact@v3
with:
name: cc3dsfs_zip
path: build/cc3dsfs*.zip
publish:
name: Publishing
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Download a single artifact
uses: actions/download-artifact@v3
with:
name: cc3dsfs_zip
- name: Auto-Release the zips
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "nightly-latest"
prerelease: true
title: "Automatic Build"
files: |
cc3dsfs*.zip

45
.github/workflows/cd_pr.yml vendored Normal file
View File

@@ -0,0 +1,45 @@
name: CD
on: [pull_request]
jobs:
build:
name: ${{ matrix.platform.name }} ${{ matrix.config.name }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- { name: Windows VS2022, os: windows-2022 }
- { name: Linux GCC, os: ubuntu-latest }
- { name: macOS x64, os: macos-13 }
- { name: macOS Apple Silicon, os: macos-14 }
config:
- { name: Static, flags: -DBUILD_SHARED_LIBS=FALSE }
steps:
- name: Install Linux Dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install libxrandr-dev libxcursor-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev
- name: Checkout
uses: actions/checkout@v3
- name: Configure
shell: bash
run: cmake -S . -B build -DCMAKE_INSTALL_PREFIX=install ${{matrix.platform.flags}} ${{matrix.config.flags}}
- name: Build
shell: bash
run: cmake --build build --config Release
- name: Pack
shell: bash
run: cd build && cpack -G ZIP
- name: Archive resulting artifact
uses: actions/upload-artifact@v3
with:
name: cc3dsfs_zip
path: build/cc3dsfs*.zip

View File

@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.16)
project(CMakeSFMLProject LANGUAGES CXX)
project(cc3dsfs VERSION 0.0.0 LANGUAGES CXX)
include(ExternalProject)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
@@ -164,4 +164,24 @@ add_custom_command(
VERBATIM
)
install(TARGETS ${OUTPUT_NAME})
install(TARGETS ${OUTPUT_NAME} DESTINATION .)
install(FILES LICENSE README.md DESTINATION .)
if(WIN32)
install(FILES openal32.dll DESTINATION .)
endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
else()
install(FILES 51-ftd3xx.rules DESTINATION .)
endif()
set(CPACK_PACKAGE_NAME ${OUTPUT_NAME}_${CMAKE_SYSTEM_PROCESSOR})
set(CPACK_PACKAGE_VENDOR Lorenzooone)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "3DS Capture Card Fullscreen software")
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
set(CPACK_VERBATIM_VARIABLES TRUE)
include(CPack)

View File

@@ -1,9 +1,4 @@
VOL := d3xx-osx.${VER}
SRC_FOLDER := /Volumes/${VOL}
TAR := ${VOL}.dmg
hdiutil attach ${1}
cp ${2}/${4} ${3}
cp ${2}/*.h ${3}
hdiutil detach ${3}
hdiutil detach ${3} || true