42 lines
1.1 KiB
YAML
42 lines
1.1 KiB
YAML
name: nuget
|
|
|
|
on: pull_request
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: nuget/setup-nuget@v1
|
|
with:
|
|
nuget-api-key: ${{ secrets.nuget_apikey }}
|
|
nuget-version: '5.x'
|
|
|
|
- name: Create Build Environment
|
|
run: cmake -E make_directory build
|
|
|
|
- name: Configure
|
|
working-directory: build
|
|
run: |
|
|
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON -A x64 -DCMAKE_CXX_STANDARD=17 ..
|
|
|
|
- name: Build
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: |
|
|
$threads = (Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors
|
|
cmake --build . --config Debug --parallel $threads
|
|
cmake --build . --config Release --parallel $threads
|
|
|
|
- name: Test
|
|
working-directory: build
|
|
run: ctest -C Debug -V
|
|
env:
|
|
CTEST_OUTPUT_ON_FAILURE: True
|
|
|
|
- name: NuGet Pack
|
|
run: |
|
|
cp readme.rst readme.md
|
|
cp license.rst readme.md
|
|
nuget pack bundle\nuget\fmt.nuspec -properties Id=wuganhao.fmt -version 1.0-dev -basepath . -OutputFileNamesWithoutVersion |