Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Update README.md

Update README.md #109

Workflow file for this run

name: Compile
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: setup jdk
uses: actions/setup-java@v1
with:
java-version: 16
- name: configure cmake
run: cmake -B build -DMCPPPP_CLI=TRUE -DMCPPPP_GUI=TRUE -DMCPPPP_JNI=TRUE -DMCPPPP_BUILD_FLTK=TRUE -DMCPPPP_STATIC_LINK=TRUE -DCMAKE_BUILD_TYPE=Release
- name: build cmake
run: cmake --build build --config Release --parallel 16
- name: copy files (windows)
if: ${{ runner.os == 'Windows' }}
run: mkdir artifacts; cp build/bin/Release/* artifacts/
shell: powershell
- name: copy files (linux)
if: ${{ runner.os == 'Linux' }}
run: mkdir artifacts && cp build/bin/* artifacts/ && cp build/libmcpppp.so artifacts/
- name: copy files (mac)
if: ${{ runner.os == 'macOs' }}
run: mkdir artifacts && cp build/libmcpppp.dylib artifacts/
- name: rename files (windows)
if: ${{ runner.os == 'Windows' }}
run: mv artifacts/MCPPPP-gui.exe artifacts/MCPPPP-windows.exe ; mv artifacts/MCPPPP-cli.exe artifacts/MCPPPP-windows-cli.exe
shell: powershell
- name: rename files (linux)
if: ${{ runner.os == 'Linux' }}
run: mv artifacts/MCPPPP-gui artifacts/MCPPPP-linux && mv artifacts/MCPPPP-cli artifacts/MCPPPP-linux-cli
#- name: create .app files (mac only)
- name: zip files (mac only)
if: ${{ runner.os == 'macOs' }}
run: |
#mkdir artifacts/MCPPPP-mac-cli.app
#mkdir artifacts/MCPPPP-mac-cli.app/Contents
#mkdir artifacts/MCPPPP-mac-cli.app/Contents/MacOS
#mkdir artifacts/MCPPPP-mac-cli.app/Contents/Resources
#cp build/bin/MCPPPP-cli artifacts/MCPPPP-mac-cli.app/Contents/MacOS/MCPPPP-cli
#touch artifacts/MCPPPP-mac-cli.app/Contents/MacOS/Info.plist
#
#echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
#<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
#<plist version=\"1.0\">
#<dict>
# <key>CFBundleDisplayName</key>
# <string>MCPPPP-cli</string>
# <key>CFBundleExecutable</key>
# <string>MCPPPP-cli</string>
# <key>CFBundleIconFile</key>
# <string>resources/mcpppp.png</string>
# <key>CFBundleIdentifier</key>
# <string>com.github.supsm.mcpppp</string>
# <key>CFBundleInfoDictionaryVersion</key>
# <string>6.0</string>
# <key>CFBundleName</key>
# <string>MCPPPP-cli</string>
#</dict>
#</plist>" >> artifacts/MCPPPP-mac-cli.app/Contents/Info.plist
#
#hdiutil create -volname MCPPPP-cli -srcfolder artifacts/MCPPPP-mac-cli.app -ov artifacts/MCPPPP-mac-cli.dmg
#rm -rf artifacts/MCPPPP-mac-cli.app
#
#
#mkdir artifacts/MCPPPP-mac.app
#mkdir artifacts/MCPPPP-mac.app/Contents
#mkdir artifacts/MCPPPP-mac.app/Contents/MacOS
#mkdir artifacts/MCPPPP-mac.app/Contents/Resources
#cp build/bin/MCPPPP-gui artifacts/MCPPPP-mac.app/Contents/MacOS/MCPPPP
#touch artifacts/MCPPPP-mac.app/Contents/MacOS/Info.plist
#
#echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
#<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
#<plist version=\"1.0\">
#<dict>
# <key>CFBundleDisplayName</key>
# <string>MCPPPP</string>
# <key>CFBundleExecutable</key>
# <string>MCPPPP</string>
# <key>CFBundleIconFile</key>
# <string>resources/mcpppp.png</string>
# <key>CFBundleIdentifier</key>
# <string>com.github.supsm.mcpppp</string>
# <key>CFBundleInfoDictionaryVersion</key>
# <string>6.0</string>
# <key>CFBundleName</key>
# <string>MCPPPP</string>
#</dict>
#</plist>" >> artifacts/MCPPPP-mac.app/Contents/Info.plist
#
#hdiutil create -volname MCPPPP -srcfolder artifacts/MCPPPP-mac.app -ov artifacts/MCPPPP-mac.dmg
#rm -rf artifacts/MCPPPP-mac.app
cp build/bin/MCPPPP-gui artifacts/MCPPPP-mac && cp build/bin/MCPPPP-cli artifacts/MCPPPP-mac-cli
cd artifacts
#chmod +x MCPPPP-mac && chmod +x MCPPPP-mac-cli
zip MCPPPP-mac.zip MCPPPP-mac
zip MCPPPP-mac-cli.zip MCPPPP-mac-cli
cd ..
- name: capture build artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}
path: artifacts/
- name: copy file (windows)
if: ${{ runner.os == 'Windows' }}
uses: supsm/copy_file_to_another_repo@master
env:
API_TOKEN_GITHUB: ${{ secrets.GH_PAT }}
with:
source_file: 'artifacts/mcpppp.dll'
destination_repo: 'supsm/MCPPPP'
destination_branch: 'mod'
destination_folder: 'src/main/resources'
user_email: '[email protected]'
user_name: 'supsm'
commit_message: 'copy windows libraries'
- name: copy file (linux)
if: ${{ runner.os == 'Linux' }}
uses: supsm/copy_file_to_another_repo@master
env:
API_TOKEN_GITHUB: ${{ secrets.GH_PAT }}
with:
source_file: 'artifacts/libmcpppp.so'
destination_repo: 'supsm/MCPPPP'
destination_branch: 'mod'
destination_folder: 'src/main/resources'
user_email: '[email protected]'
user_name: 'supsm'
commit_message: 'copy linux libraries'
- name: copy file (mac)
if: ${{ runner.os == 'macOs' }}
uses: supsm/copy_file_to_another_repo@master
env:
API_TOKEN_GITHUB: ${{ secrets.GH_PAT }}
with:
source_file: 'artifacts/libmcpppp.dylib'
destination_repo: 'supsm/MCPPPP'
destination_branch: 'mod'
destination_folder: 'src/main/resources'
user_email: '[email protected]'
user_name: 'supsm'
commit_message: 'copy mac libraries'
build-linux-arm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sudo apt update && sudo apt install -y gcc-12-aarch64-linux-gnu g++-12-aarch64-linux-gnu
- name: configure cmake
run: cmake -B build -DMCPPPP_CLI=TRUE -DMCPPPP_GUI=FALSE -DMCPPPP_JNI=FALSE -DMCPPPP_STATIC_LINK=TRUE -DCMAKE_BUILD_TYPE=Release
env:
CC: aarch64-linux-gnu-gcc-12
CXX: aarch64-linux-gnu-g++-12
- name: build cmake
run: cmake --build build
- name: copy files
run: mkdir artifacts && cp build/bin/* artifacts/
- name: rename files
run: mv artifacts/MCPPPP-cli artifacts/MCPPPP-linux-arm-cli
- name: capture build artifacts
uses: actions/upload-artifact@v2
with:
name: Linux-arm
path: artifacts/
build-emscripten:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: setup emsdk (emscripten)
uses: mymindstorm/setup-emsdk@v11
- name: configure cmake
run: emcmake cmake -B build -DMCPPPP_CLI=FALSE -DMCPPPP_GUI=FALSE -DMCPPPP_WEB=TRUE -DMCPPPP_STATIC_LINK=TRUE -DCMAKE_BUILD_TYPE=MinSizeRel
- name: build cmake
run: cmake --build build
- name: copy files
run: mkdir artifacts && cp build/bin/* artifacts/
- name: capture build artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}
path: artifacts/
- name: rename
run: mv artifacts/MCPPPP-web.html artifacts/index.html
- name: copy to github pages
uses: supsm/copy_file_to_another_repo@master
env:
API_TOKEN_GITHUB: ${{ secrets.GH_PAT }}
with:
source_file: 'artifacts/'
use_rsync: 'true'
destination_repo: 'supsm/MCPPPP'
destination_branch: 'pages'
user_email: '[email protected]'
user_name: 'supsm'
commit_message: 'copy web files'
# this is a separate workflow since my thing seems to have issues when used more than once
copy-gradle-properties:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: copy gradle properties
uses: supsm/copy_file_to_another_repo@master
env:
API_TOKEN_GITHUB: ${{ secrets.GH_PAT }}
with:
source_file: 'gradle.properties'
destination_repo: 'supsm/MCPPPP'
destination_branch: 'mod'
user_email: '[email protected]'
user_name: 'supsm'
commit_message: 'copy gradle.properties'