ncmdump/.github/workflows/autobuild.yml
2025-10-04 17:44:24 +08:00

126 lines
3.6 KiB
YAML

name: CI
env:
BUILD_TYPE: MinSizeRel
BUILD_PATH: build
on:
push:
branches: [ main, dev ]
jobs:
# ----------------------------------------------------------------------
# 1. Linux Build
# ----------------------------------------------------------------------
job_linux:
name: Linux Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake libtag1-dev zlib1g-dev
# ubuntu 24.04 does not contains taglib v2.x, which does not support cmake, built it manually
- name: Build TagLib v2.1.1
run: |
wget https://github.com/taglib/taglib/releases/download/v2.1.1/taglib-2.1.1.tar.gz
tar -xzf taglib-2.1.1.tar.gz
cd taglib-2.1.1
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release .
make -j$(nproc)
sudo make install
- name: Configure CMake
run: |
cmake -B ${{github.workspace}}/build \
-DCMAKE_BUILD_TYPE=Release \
-S ${{github.workspace}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config Release
- name: Upload Linux Artifact
uses: actions/upload-artifact@v4
with:
name: build-artifact-linux
path: ${{github.workspace}}/build/ncmdump
# ----------------------------------------------------------------------
# 2. macOS Build
# ----------------------------------------------------------------------
job_macos:
name: macOS Build
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Install Dependencies
run: |
brew install taglib
- name: Configure CMake
run: |
cmake -B ${{github.workspace}}/build \
-DCMAKE_BUILD_TYPE=Release \
-S ${{github.workspace}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config Release
- name: Upload macOS Artifact
uses: actions/upload-artifact@v4
with:
name: build-artifact-macos
path: ${{github.workspace}}/build/ncmdump
# ----------------------------------------------------------------------
# 3. Windows Build
# ----------------------------------------------------------------------
job_windows:
name: Windows Build
runs-on: windows-latest
env:
VCPKG_TRIPLET: x64-windows-static
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Install Dependencies
uses: lukka/run-vcpkg@v11
id: vcpkg
with:
vcpkgJsonGlob: '**/vcpkg.json'
- name: Configure CMake
run: |
cmake -B ${{github.workspace}}/build `
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake `
-DVCPKG_TARGET_TRIPLET=${{ env.VCPKG_TRIPLET }} `
-S ${{github.workspace}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config Release
- name: Upload Windows Executable Artifact
uses: actions/upload-artifact@v4
with:
name: build-artifact-windows
path: ${{github.workspace}}/build/ncmdump.exe
- name: Upload Windows Library Artifact
uses: actions/upload-artifact@v4
with:
name: build-artifact-windows
path: ${{github.workspace}}/build/libncmdump.dll