2020-05-23 17:13:01 +00:00
|
|
|
name: Build (Windows)
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- '*'
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- '*'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_win:
|
2024-07-31 13:20:02 +00:00
|
|
|
name: Build on Windows ${{ matrix.platform.bitness }} as ${{ matrix.config }}
|
2020-05-23 17:13:01 +00:00
|
|
|
runs-on: windows-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
config: [Debug, Release, ReleaseDLL]
|
|
|
|
platform:
|
2024-06-28 18:41:00 +00:00
|
|
|
- { bitness: x32, ms: Win32, name: windows-ix86 }
|
|
|
|
- { bitness: x64, ms: x64, name: window-x86_64 }
|
2020-05-23 17:13:01 +00:00
|
|
|
env:
|
|
|
|
CONFIG: ${{ matrix.config }}
|
|
|
|
BITNESS: ${{ matrix.platform.bitness }}
|
|
|
|
PLATFORM: ${{ matrix.platform.ms }}
|
|
|
|
PTS: v142
|
|
|
|
|
|
|
|
steps:
|
2024-04-28 10:48:24 +00:00
|
|
|
- uses: actions/checkout@v4
|
2020-05-23 17:13:01 +00:00
|
|
|
|
|
|
|
- name: Add MSBuild to PATH
|
2024-04-28 10:48:24 +00:00
|
|
|
uses: microsoft/setup-msbuild@v2
|
2020-05-23 17:13:01 +00:00
|
|
|
|
|
|
|
- name: Build with MSBuild
|
|
|
|
run: |
|
|
|
|
MSBuild.exe libcpuid_vc10.sln `
|
|
|
|
/property:Platform=$Env:PLATFORM `
|
|
|
|
/property:Configuration=$Env:CONFIG `
|
|
|
|
/property:PlatformToolset=$Env:PTS `
|
|
|
|
/verbosity:normal
|
|
|
|
|
|
|
|
- name: Prepate artifacts
|
|
|
|
run: |
|
|
|
|
mkdir -pv "$DESTDIR/"{bin,include,lib}
|
2022-10-23 15:26:13 +00:00
|
|
|
cat <<EOF > "$DESTDIR/Readme.win"
|
|
|
|
The binaries here are compiled with Microsoft Visual C++. The following configurations are built:
|
|
|
|
|
|
|
|
Debug\ - no optimizations, using the static debug C runtime (/MTd)
|
|
|
|
Release\ - optimizations on, using the static C runtime (/MT)
|
|
|
|
ReleaseDLL\ - the library is compiled in a .dll (libcpuid.dll), which you'd need to ship alongside your executable. Static C runtime.
|
|
|
|
|
|
|
|
Operating system and compiler version:
|
|
|
|
$(wmic os get caption,version -value | sed '/^[[:space:]]*$/d')\n$(MSBuild.exe -version | sed '/^[[:space:]]*$/d')
|
|
|
|
EOF
|
2020-05-23 17:13:01 +00:00
|
|
|
install -v AUTHORS ChangeLog COPYING Readme.md "$DESTDIR/"
|
|
|
|
install -v libcpuid/{libcpuid_constants.h,libcpuid.h,libcpuid_types.h} "$DESTDIR/include/"
|
|
|
|
cd "$GITHUB_WORKSPACE/cpuid_tool/$BITNESS" && find * -type f -name '*.exe' -exec install -Dv "{}" "$DESTDIR/bin/{}" \;
|
|
|
|
cd "$GITHUB_WORKSPACE/libcpuid/$BITNESS" && find * -type f \( -name '*.lib' -o -name '*.dll' -o -name '*.exp' \) -exec install -Dv "{}" "$DESTDIR/lib/{}" \;
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
DESTDIR: ${{ github.workspace }}/installdir
|
|
|
|
|
|
|
|
- name: Upload artifacts
|
2024-04-28 10:48:24 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2020-05-23 17:13:01 +00:00
|
|
|
with:
|
2024-04-28 12:15:58 +00:00
|
|
|
name: ${{ matrix.platform.name }}-${{ matrix.config }}
|
2020-05-23 17:13:01 +00:00
|
|
|
path: installdir/*
|
2024-04-28 12:15:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
merge_win_artifacts:
|
|
|
|
name: Merge artifacts
|
|
|
|
runs-on: windows-latest
|
|
|
|
needs: build_win
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
platform:
|
2024-06-28 18:41:00 +00:00
|
|
|
- windows-ix86
|
|
|
|
- window-x86_64
|
2024-04-28 12:15:58 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Merge artifacts for ${{ matrix.platform }}
|
|
|
|
uses: actions/upload-artifact/merge@v4
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.platform }}
|
|
|
|
pattern: ${{ matrix.platform }}-*
|
|
|
|
delete-merged: true
|