Skip to content

Merge pull request #105 from neogeek/hotfix/code-cleanup #64

Merge pull request #105 from neogeek/hotfix/code-cleanup

Merge pull request #105 from neogeek/hotfix/code-cleanup #64

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
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Build Release
run: |
mkdir -p build
g++ -std=c++17 -shared -fPIC -o build/libRhythmGameUtilities.so include/RhythmGameUtilities/RhythmGameUtilities.cpp
- name: Copy Release
run: |
mkdir -p UnityPackage/Libs/Linux
mkdir -p RhythmGameUtilities/Libs/Linux
cp build/libRhythmGameUtilities.so UnityPackage/Libs/Linux
cp build/libRhythmGameUtilities.so RhythmGameUtilities/Libs/Linux
- 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/Libs/Linux/libRhythmGameUtilities.so
git add RhythmGameUtilities/Libs/Linux/libRhythmGameUtilities.so
git commit -m "Updated libRhythmGameUtilities.so [skip ci]" || exit 0
git push
build-macos:
runs-on: macos-latest
needs: build-linux
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- 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: Copy Release
run: |
mkdir -p UnityPackage/Libs/macOS
mkdir -p RhythmGameUtilities/Libs/macOS
cp build/libRhythmGameUtilities.dylib UnityPackage/Libs/macOS
cp build/libRhythmGameUtilities.dylib RhythmGameUtilities/Libs/macOS
- 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/Libs/macOS/libRhythmGameUtilities.dylib
git add RhythmGameUtilities/Libs/macOS/libRhythmGameUtilities.dylib
git commit -m "Updated libRhythmGameUtilities.dylib [skip ci]" || exit 0
git push
build-windows:
runs-on: windows-latest
needs: build-macos
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- 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: Copy Release
shell: cmd
run: |
mkdir UnityPackage/Libs/Windows
mkdir RhythmGameUtilities/Libs/Windows
cp build/libRhythmGameUtilities.dll UnityPackage/Libs/Windows
cp build/libRhythmGameUtilities.dll RhythmGameUtilities/Libs/Windows
- name: Setup git
shell: cmd
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Git commit changes
shell: cmd
run: |
git pull
git add UnityPackage/Libs/Windows/libRhythmGameUtilities.dll
git add RhythmGameUtilities/Libs/Windows/libRhythmGameUtilities.dll
git commit -m "Updated libRhythmGameUtilities.dll [skip ci]" || exit 0
git push