From 8fc7cbedd96778fc53be9d06346b92c5f1f6fcd7 Mon Sep 17 00:00:00 2001 From: Jonghyeon Park Date: Wed, 10 Jun 2026 10:12:30 +0900 Subject: [PATCH 1/3] ci: add ci scheme for release --- .github/workflows/ci-release.yml | 108 +++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 .github/workflows/ci-release.yml diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml new file mode 100644 index 0000000..ed7d770 --- /dev/null +++ b/.github/workflows/ci-release.yml @@ -0,0 +1,108 @@ +name: CI and Release + +on: + pull_request: + release: + types: [created, published] + +permissions: + contents: write + +jobs: + test: + name: Test + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Configure + run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release + + - name: Build + run: cmake --build build --config Release --parallel + + - name: Test + run: ctest --test-dir build --output-on-failure -C Release + + build: + name: Build ${{ matrix.artifact }} + needs: test + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + include: + - artifact: namumark-windows-x86 + os: windows-latest + cmake_arch: Win32 + cmake_extra_args: '' + archive: namumark-windows-x86.zip + - artifact: namumark-windows-x86_64 + os: windows-latest + cmake_arch: x64 + cmake_extra_args: '' + archive: namumark-windows-x86_64.zip + - artifact: namumark-macos-universal + os: macos-latest + cmake_arch: '' + cmake_extra_args: '-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"' + archive: namumark-macos-universal.tar.gz + - artifact: namumark-linux-x86 + os: ubuntu-latest + cmake_arch: '' + cmake_extra_args: '-DCMAKE_C_FLAGS=-m32 -DCMAKE_EXE_LINKER_FLAGS=-m32 -DCMAKE_SHARED_LINKER_FLAGS=-m32' + archive: namumark-linux-x86.tar.gz + - artifact: namumark-linux-x86_64 + os: ubuntu-latest + cmake_arch: '' + cmake_extra_args: '' + archive: namumark-linux-x86_64.tar.gz + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Linux x86 toolchain + if: matrix.artifact == 'namumark-linux-x86' + run: | + sudo apt-get update + sudo apt-get install -y gcc-multilib g++-multilib + + - name: Configure Windows + if: runner.os == 'Windows' + run: cmake -S . -B build -G "Visual Studio 17 2022" -A ${{ matrix.cmake_arch }} -DCMAKE_BUILD_TYPE=Release -DNAMUMARK_BUILD_TESTING=OFF + + - name: Configure Unix + if: runner.os != 'Windows' + run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DNAMUMARK_BUILD_TESTING=OFF ${{ matrix.cmake_extra_args }} + + - name: Build + run: cmake --build build --config Release --parallel + + - name: Install + run: cmake --install build --config Release --prefix package/${{ matrix.artifact }} + + - name: Archive Windows package + if: runner.os == 'Windows' + shell: pwsh + run: Compress-Archive -Path package/${{ matrix.artifact }}/* -DestinationPath ${{ matrix.archive }} + + - name: Archive Unix package + if: runner.os != 'Windows' + run: tar -czf ${{ matrix.archive }} -C package ${{ matrix.artifact }} + + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.artifact }} + path: ${{ matrix.archive }} + if-no-files-found: error + + - name: Upload release asset + if: github.event_name == 'release' + env: + GH_TOKEN: ${{ github.token }} + run: gh release upload ${{ github.event.release.tag_name }} ${{ matrix.archive }} --clobber From f0988fe4b7cf8d11cce85160caa2e5a475049d64 Mon Sep 17 00:00:00 2001 From: Jonghyeon Park Date: Wed, 10 Jun 2026 10:21:38 +0900 Subject: [PATCH 2/3] fix: feed invalid compiler options while ci (build error while ci on release/pr) --- .github/workflows/ci-release.yml | 2 +- CMakeLists.txt | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index ed7d770..d27afe4 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -53,7 +53,7 @@ jobs: - artifact: namumark-linux-x86 os: ubuntu-latest cmake_arch: '' - cmake_extra_args: '-DCMAKE_C_FLAGS=-m32 -DCMAKE_EXE_LINKER_FLAGS=-m32 -DCMAKE_SHARED_LINKER_FLAGS=-m32' + cmake_extra_args: '-DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 -DCMAKE_EXE_LINKER_FLAGS=-m32 -DCMAKE_SHARED_LINKER_FLAGS=-m32' archive: namumark-linux-x86.tar.gz - artifact: namumark-linux-x86_64 os: ubuntu-latest diff --git a/CMakeLists.txt b/CMakeLists.txt index 513ef7c..e7f7b72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,16 +48,20 @@ target_include_directories(namumark-shared ${CMAKE_CURRENT_SOURCE_DIR} ) +if(MSVC) + set(NAMUMARK_WARNING_FLAGS /W4) +else() + set(NAMUMARK_WARNING_FLAGS -Wall -Wextra) +endif() + target_compile_options(namumark-lib PRIVATE - -Wall - -Wextra + ${NAMUMARK_WARNING_FLAGS} ) target_compile_options(namumark-shared PRIVATE - -Wall - -Wextra + ${NAMUMARK_WARNING_FLAGS} ) add_executable(namumark From 5bbc1869880c82e2cbee541be306e2fc9392b716 Mon Sep 17 00:00:00 2001 From: Jonghyeon Park Date: Wed, 10 Jun 2026 10:25:33 +0900 Subject: [PATCH 3/3] chore: migrate actions/checkout@v6, actions/upload-artifact@v5 --- .github/workflows/ci-release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index d27afe4..b66e803 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -15,7 +15,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Configure run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release @@ -63,7 +63,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install Linux x86 toolchain if: matrix.artifact == 'namumark-linux-x86' @@ -95,7 +95,7 @@ jobs: run: tar -czf ${{ matrix.archive }} -C package ${{ matrix.artifact }} - name: Upload build artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 with: name: ${{ matrix.artifact }} path: ${{ matrix.archive }}