Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 42 additions & 1 deletion .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,22 @@ jobs:
executable: acecode.exe
archive_extension: zip
msvc_arch: amd64
build_desktop: true
cmake_extra_args: -DACECODE_BUILD_DESKTOP=ON
- id: macos-x64
os: macos-15
triplet: x64-osx
executable: acecode
archive_extension: tar.gz
cmake_extra_args: -DCMAKE_OSX_ARCHITECTURES=x86_64
build_desktop: true
cmake_extra_args: -DCMAKE_OSX_ARCHITECTURES=x86_64 -DACECODE_BUILD_DESKTOP=ON
- id: macos-arm64
os: macos-15
triplet: arm64-osx
executable: acecode
archive_extension: tar.gz
build_desktop: true
cmake_extra_args: -DACECODE_BUILD_DESKTOP=ON

steps:
- name: Checkout
Expand All @@ -63,6 +68,23 @@ jobs:
- name: Run vcpkg
uses: lukka/run-vcpkg@v11

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: '9'

- name: Build web UI
shell: bash
run: |
cd web
pnpm install --frozen-lockfile
pnpm build

- name: Configure
shell: bash
run: |
Expand All @@ -77,6 +99,11 @@ jobs:
shell: bash
run: cmake --build build --config Release --target acecode

- name: Build desktop
if: matrix.build_desktop
shell: bash
run: cmake --build build --config Release --target acecode-desktop

- name: Extract debug symbols (Linux)
if: runner.os == 'Linux'
shell: bash
Expand All @@ -100,6 +127,9 @@ jobs:
mkdir -p "$package_dir"
cp "build/${{ matrix.executable }}" "$package_dir/"
cp README.md README_CN.md "$package_dir/"
if [ "${{ matrix.build_desktop }}" = "true" ] && [ -d "build/ACECode.app" ]; then
cp -r "build/ACECode.app" "$package_dir/"
fi
tar -C dist -czf "acecode-${{ matrix.id }}.tar.gz" "acecode-${{ matrix.id }}"

- name: Package (Windows)
Expand All @@ -110,6 +140,9 @@ jobs:
New-Item -ItemType Directory -Force -Path $packageDir | Out-Null
Copy-Item "build/${{ matrix.executable }}" "$packageDir/"
Copy-Item "README.md","README_CN.md" "$packageDir/"
if ("${{ matrix.build_desktop }}" -eq "true" -and (Test-Path "build/Release/acecode-desktop.exe")) {
Copy-Item "build/Release/acecode-desktop.exe" "$packageDir/"
}
Compress-Archive -Path "$packageDir/*" -DestinationPath "acecode-${{ matrix.id }}.zip" -Force

- name: Upload artifact
Expand All @@ -127,6 +160,14 @@ jobs:
path: build/**/acecode.pdb
if-no-files-found: warn

- name: Upload desktop PDB
if: runner.os == 'Windows' && matrix.build_desktop
uses: actions/upload-artifact@v4
with:
name: acecode-${{ matrix.id }}-desktop-pdb
path: build/**/acecode-desktop.pdb
if-no-files-found: warn

- name: Upload debug symbols (Linux)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
Expand Down
7 changes: 7 additions & 0 deletions src/desktop/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ std::string desktop_exe_dir() {
return acecode::wide_to_utf8(fs::path(wpath).parent_path().wstring());
}
#elif defined(__APPLE__)
bool desktop_webapp_requested(int argc, char** argv) {
for (int i = 1; i < argc; ++i) {
if (argv[i] && is_webapp_arg(argv[i])) return true;
}
return false;
}

std::string desktop_exe_dir() {
uint32_t size = 1024;
std::vector<char> buf(size);
Expand Down
Loading