ncmdump/.github/workflows/autobuild.yml

142 lines
3.5 KiB
YAML
Raw Normal View History

2024-02-07 15:03:52 +08:00
name: CI
env:
BUILD_TYPE: Release
BUILD_PATH: build
2024-02-07 15:03:52 +08:00
on:
push:
branches: [ main ]
jobs:
build_on_windows_msys2:
2024-02-07 15:03:52 +08:00
runs-on: windows-latest
steps:
2024-02-07 15:07:04 +08:00
- name: Checkout repository
2024-02-07 15:13:18 +08:00
uses: actions/checkout@v4
2024-02-07 23:00:17 +08:00
with:
submodules: recursive
2024-02-07 15:03:52 +08:00
- name: Install dependencies
2024-02-07 15:13:18 +08:00
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: git mingw-w64-ucrt-x86_64-toolchain
2024-02-07 15:03:52 +08:00
2024-02-07 22:54:38 +08:00
- name: Configure build
run: cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -B ${{ env.BUILD_PATH }}
- name: Build
run: cmake --build ${{ env.BUILD_PATH }} -j 4
2024-03-21 14:12:20 +08:00
- name: Strip
run: strip ${{ env.BUILD_PATH }}/ncmdump.exe
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
2024-09-21 00:08:51 +08:00
name: windows_amd64_build_msys2_exe
path: ${{ env.BUILD_PATH }}/ncmdump.exe
build_on_windows_msvc:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Configure build
run: cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -B ${{ env.BUILD_PATH }}
2024-02-07 22:54:38 +08:00
2024-02-07 15:03:52 +08:00
- name: Build
2024-02-08 10:49:07 +08:00
run: cmake --build ${{ env.BUILD_PATH }} -j 4 --config ${{ env.BUILD_TYPE }}
2024-02-07 22:54:38 +08:00
- name: Upload artifact executable
2024-02-07 22:54:38 +08:00
uses: actions/upload-artifact@v4
2024-02-07 15:03:52 +08:00
with:
2024-09-21 00:08:51 +08:00
name: windows_amd64_build_msvc_exe
2024-02-08 10:38:20 +08:00
path: ${{ env.BUILD_PATH }}/${{ env.BUILD_TYPE }}/ncmdump.exe
- name: Upload artifact DLL
uses: actions/upload-artifact@v4
with:
2024-09-21 00:08:51 +08:00
name: windows_amd64_build_msvc_dll
path: ${{ env.BUILD_PATH }}/${{ env.BUILD_TYPE }}/libncmdump.dll
2024-02-07 23:19:32 +08:00
2024-09-21 00:10:26 +08:00
build_on_linux_amd64:
2024-02-07 23:19:32 +08:00
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake
- name: Configure build
run: cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -B ${{ env.BUILD_PATH }}
2024-02-07 23:19:32 +08:00
- name: Build
run: cmake --build ${{ env.BUILD_PATH }} -j 4
2024-02-07 23:19:32 +08:00
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
2024-09-21 00:08:51 +08:00
name: linux_build_amd64
path: ${{ env.BUILD_PATH }}/ncmdump
2024-02-07 23:19:32 +08:00
2024-09-21 00:08:51 +08:00
build_on_macos_amd64:
2024-02-07 23:19:32 +08:00
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
brew install git cmake
- name: Configure build
2024-09-21 00:08:51 +08:00
run: cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -B ${{ env.BUILD_PATH }} -DCMAKE_OSX_ARCHITECTURES=x86_64
- name: Build
run: cmake --build ${{ env.BUILD_PATH }} -j 4
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: macOS_build_amd64
path: ${{ env.BUILD_PATH }}/ncmdump
build_on_macos_arm64:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
brew install git cmake
- name: Configure build
run: cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -B ${{ env.BUILD_PATH }} -DCMAKE_OSX_ARCHITECTURES=arm64
2024-02-07 23:19:32 +08:00
- name: Build
run: cmake --build ${{ env.BUILD_PATH }} -j 4
2024-02-07 23:19:32 +08:00
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
2024-09-21 00:08:51 +08:00
name: macOS_build_arm64
path: ${{ env.BUILD_PATH }}/ncmdump