Skip to content

Commit

Permalink
Fix Windows CI binary release setup
Browse files Browse the repository at this point in the history
- update CMakeLists to generate multi config options see https://cmake.org/cmake/help/latest/prop_gbl/GENERATOR_IS_MULTI_CONFIG.html
  • Loading branch information
TheTechsTech committed May 9, 2024
1 parent 343dda8 commit faf86ac
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 16 deletions.
40 changes: 24 additions & 16 deletions .github/workflows/release-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,40 @@ on:

jobs:
windows:
name: windows-build
name: windows-build (${{ matrix.arch }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
arch: [x64, Win32]
steps:
- uses: actions/checkout@v3
- name: CMake build
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- uses: actions/checkout@v4
- name: Configure
run: |
cmake .
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.0.2
- name: CMake release
mkdir build
cd build
cmake .. -D BUILD_TESTING=OFF -A ${{ matrix.arch }}
- name: Build
run: |
msbuild INSTALL.vcxproj /p:Configuration=Release
cd build
cmake --build . --config Release
- name: Create binary archive from release
run: |
mkdir libuv-${{ github.event.release.tag_name }}\bin
mkdir libuv-${{ github.event.release.tag_name }}\lib
move include libuv-${{ github.event.release.tag_name }}\
move Release/uv.lib libuv-${{ github.event.release.tag_name }}\lib\
move Release/uv.dll libuv-${{ github.event.release.tag_name }}\bin\
7z a libuv-${{ github.event.release.tag_name }}.zip libuv-${{ github.event.release.tag_name }}\* -tzip -y
mkdir libuv-${{ github.event.release.tag_name }}-${{ matrix.arch }}\bin
mkdir libuv-${{ github.event.release.tag_name }}-${{ matrix.arch }}\lib
move include libuv-${{ github.event.release.tag_name }}-${{ matrix.arch }}\
move Release/uv.lib libuv-${{ github.event.release.tag_name }}-${{ matrix.arch }}\lib\
move Release/uv.dll libuv-${{ github.event.release.tag_name }}-${{ matrix.arch }}\bin\
7z a libuv-${{ github.event.release.tag_name }}-${{ matrix.arch }}.zip libuv-${{ github.event.release.tag_name }}-${{ matrix.arch }}\* -tzip -y
- name: Upload the windows binary artifacts
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: libuv-${{ github.event.release.tag_name }}.zip
asset_name: libuv-${{ github.event.release.tag_name }}-windows
file: libuv-${{ github.event.release.tag_name }}-${{ matrix.arch }}.zip
asset_name: libuv-${{ github.event.release.tag_name }}-${{ matrix.arch }}-windows
tag: ${{ github.ref }}
overwrite: true
file_glob: true
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ include(CheckCCompilerFlag)
include(GNUInstallDirs)
include(CTest)

message("Generated with config types: ${CMAKE_CONFIGURATION_TYPES}")
set(CMAKE_CONFIGURATION_TYPES=Debug;Release)

set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS ON)
Expand Down

0 comments on commit faf86ac

Please sign in to comment.