-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cf7963d
commit 1c19213
Showing
3 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: build MacOS | ||
on: | ||
push: {tags: ['v*']} # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
pull_request: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build_darwin_aarch64: | ||
runs-on: macos-14 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install dependencies | ||
run: | | ||
brew install sdl2 sdl2_ttf sdl2_image sdl2_mixer lua bzip2 | ||
- name: Build | ||
run: | | ||
cd script | ||
bash ./local_darwin.sh | ||
- name: prepare release | ||
if: github.event_name == 'push' | ||
run: | | ||
cd build_darwin | ||
mv onsyuri onsyuri_${{ github.ref_name }}_aarch64_darwin | ||
- name: create release | ||
uses: ncipollo/release-action@v1 | ||
if: github.event_name == 'push' | ||
with: | ||
artifacts: "./build_darwin/onsyuri_${{ github.ref_name }}_aarch64_darwin" | ||
allowUpdates: "true" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
build_darwin_x86-64: | ||
runs-on: macos-13 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install dependencies | ||
run: | | ||
brew install sdl2 sdl2_ttf sdl2_image sdl2_mixer lua bzip2 | ||
- name: Build | ||
run: | | ||
cd script | ||
bash ./local_darwin.sh | ||
- name: prepare release | ||
if: github.event_name == 'push' | ||
run: | | ||
cd build_darwin | ||
mv onsyuri onsyuri_${{ github.ref_name }}_x86-64_darwin | ||
- name: create release | ||
uses: ncipollo/release-action@v1 | ||
if: github.event_name == 'push' | ||
with: | ||
artifacts: "./build_darwin/onsyuri_${{ github.ref_name }}_x86-64_darwin" | ||
allowUpdates: "true" | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# bash -c "export BUILD_TYPE=Debug && export USE_STATIC_PORTS=yes && export SKIP_PORTS=yes && ./local_linux64.sh" | ||
PLATFORM=darwin | ||
BUILD_PATH=./../build_${PLATFORM} | ||
CMAKELISTS_PATH=$(pwd)/.. | ||
CORE_NUM=$(nproc) | ||
TARGETS=$@ | ||
|
||
# config env | ||
CC=gcc | ||
CXX=g++ | ||
if [ -z "$BUILD_TYPE" ]; then BUILD_TYPE=MinSizeRel; fi | ||
if [ -z "$TARGETS" ]; then TARGETS=all; fi | ||
|
||
# config and build project | ||
# USE_STATIC_PORTS=yes | ||
# SKIP_PORTS=yes | ||
echo "BUILD_TYPE=$BUILD_TYPE" | ||
cmake -B $BUILD_PATH -S $CMAKELISTS_PATH \ | ||
-G "Unix Makefiles" -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ | ||
|
||
make -C $BUILD_PATH $TARGETS -j$CORE_NUM |