Skip to content

Commit 7a8a9cc

Browse files
committed
buid
1 parent 8ebd012 commit 7a8a9cc

File tree

2 files changed

+139
-0
lines changed

2 files changed

+139
-0
lines changed

.github/workflows/build-mac.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Build and Release for macOS
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-mac:
11+
runs-on: macos-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Install dependencies
18+
run: |
19+
brew update
20+
brew install cmake sfml
21+
22+
- name: Create build directory
23+
run: mkdir build
24+
25+
- name: Configure CMake
26+
run: |
27+
cd build
28+
cmake .. -DCMAKE_BUILD_TYPE=Release
29+
30+
- name: Build
31+
run: |
32+
cd build
33+
make -j$(sysctl -n hw.ncpu)
34+
35+
- name: Create release package
36+
run: |
37+
mkdir -p release-mac
38+
cp build/Oubliette release-mac/
39+
cp -r src/assets release-mac/
40+
cp README.md release-mac/
41+
42+
# Create a simple launcher script
43+
cat > release-mac/run.sh << 'EOF'
44+
#!/bin/bash
45+
cd "$(dirname "$0")"
46+
./Oubliette
47+
EOF
48+
chmod +x release-mac/run.sh
49+
50+
- name: Create ZIP archive
51+
run: |
52+
cd release-mac
53+
zip -r ../Oubliette-macOS.zip .
54+
55+
- name: Upload release
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: Oubliette-macOS
59+
path: Oubliette-macOS.zip
60+
61+
- name: Create GitHub Release
62+
if: startsWith(github.ref, 'refs/tags/')
63+
uses: softprops/action-gh-release@v1
64+
with:
65+
files: Oubliette-macOS.zip
66+
generate_release_notes: true
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Build and Release for Windows
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-windows:
11+
runs-on: windows-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Install dependencies
18+
run: |
19+
# Install SFML via vcpkg
20+
git clone https://github.com/Microsoft/vcpkg.git
21+
cd vcpkg
22+
.\bootstrap-vcpkg.bat
23+
.\vcpkg install sfml:x64-windows
24+
25+
- name: Create build directory
26+
run: mkdir build
27+
28+
- name: Configure CMake
29+
run: |
30+
cd build
31+
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake
32+
33+
- name: Build
34+
run: |
35+
cd build
36+
cmake --build . --config Release
37+
38+
- name: Create release package
39+
run: |
40+
mkdir release-windows
41+
copy build\Release\Oubliette.exe release-windows\
42+
xcopy src\assets release-windows\assets\ /E /I
43+
copy README.md release-windows\
44+
45+
# Copy SFML DLLs
46+
copy vcpkg\installed\x64-windows\bin\*.dll release-windows\
47+
48+
# Create a batch launcher
49+
echo @echo off > release-windows\run.bat
50+
echo cd /d "%%~dp0" >> release-windows\run.bat
51+
echo Oubliette.exe >> release-windows\run.bat
52+
53+
- name: Create ZIP archive
54+
run: |
55+
cd release-windows
56+
powershell Compress-Archive -Path * -DestinationPath ..\Oubliette-Windows.zip
57+
58+
- name: Upload release
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: Oubliette-Windows
62+
path: Oubliette-Windows.zip
63+
64+
- name: Create GitHub Release
65+
if: startsWith(github.ref, 'refs/tags/')
66+
uses: softprops/action-gh-release@v1
67+
with:
68+
files: Oubliette-Windows.zip
69+
generate_release_notes: true
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)