Skip to content

Updated .net framework used for testing. #66

Updated .net framework used for testing.

Updated .net framework used for testing. #66

name: Build
on:
push:
branches:
- main
paths:
- 'include/**/*'
- '!**/*.md'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Build Release
run: |
mkdir -p build
g++ -std=c++17 -shared -fPIC -o build/libRhythmGameUtilities.so include/RhythmGameUtilities/RhythmGameUtilities.cpp
- name: Upload build artifacts
uses: actions/[email protected]
with:
name: build-linux-files
path: build/
retention-days: 1
build-macos:
runs-on: macos-latest
steps:
- name: Check out repository
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Build Release
run: |
mkdir -p build
g++ -std=c++17 -shared -fPIC -arch arm64 -o build/libRhythmGameUtilities-arm64.dylib include/RhythmGameUtilities/RhythmGameUtilities.cpp
g++ -std=c++17 -shared -fPIC -arch x86_64 -o build/libRhythmGameUtilities-x86_64.dylib include/RhythmGameUtilities/RhythmGameUtilities.cpp
lipo -create -output build/libRhythmGameUtilities.dylib build/libRhythmGameUtilities-arm64.dylib build/libRhythmGameUtilities-x86_64.dylib
lipo -info build/libRhythmGameUtilities.dylib
- name: Upload build artifacts
uses: actions/[email protected]
with:
name: build-macos-files
path: build/
retention-days: 1
build-windows:
runs-on: windows-latest
steps:
- name: Check out repository
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Build Release
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
mkdir -p build
cl /EHsc /std:c++17 /c include/RhythmGameUtilities/RhythmGameUtilities.cpp /Fo:build\RhythmGameUtilities.obj
link /DLL /MACHINE:X64 /OUT:build\libRhythmGameUtilities.dll /IMPLIB:build\libRhythmGameUtilities.lib build\RhythmGameUtilities.obj
del build\RhythmGameUtilities.obj
- name: Upload build artifacts
uses: actions/[email protected]
with:
name: build-windows-files
path: build/
retention-days: 1
commit-changes:
needs: [build-linux, build-macos, build-windows]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Download all build artifacts
uses: actions/[email protected]
with:
path: artifacts/
- name: Move artifacts to build directory
run: |
mkdir -p UnityPackage/Libs/Linux
mkdir -p RhythmGameUtilities/Libs/Linux
mkdir -p UnityPackage/Libs/macOS
mkdir -p RhythmGameUtilities/Libs/macOS
mkdir -p UnityPackage/Libs/Windows
mkdir -p RhythmGameUtilities/Libs/Windows
cp artifacts/build-linux-files/libRhythmGameUtilities.so UnityPackage/Libs/Linux/
cp artifacts/build-linux-files/libRhythmGameUtilities.so RhythmGameUtilities/Libs/Linux/
cp artifacts/build-macos-files/libRhythmGameUtilities.dylib UnityPackage/Libs/macOS/
cp artifacts/build-macos-files/libRhythmGameUtilities.dylib RhythmGameUtilities/Libs/macOS/
cp artifacts/build-windows-files/libRhythmGameUtilities.dll UnityPackage/Libs/Windows/
cp artifacts/build-windows-files/libRhythmGameUtilities.dll RhythmGameUtilities/Libs/Windows/
- name: Setup git
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Git commit changes
run: |
git pull
git add UnityPackage/
git add RhythmGameUtilities/
git commit -m "Updated build files [skip ci]" || exit 0
git push