77 types : [published]
88 workflow_dispatch :
99
10- env :
11- # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
12- BUILD_TYPE : Release
13-
1410jobs :
1511 build :
1612 # The CMake configure and build commands are platform agnostic and should work equally
@@ -19,27 +15,35 @@ jobs:
1915 # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
2016 runs-on : windows-latest
2117
18+ strategy :
19+ matrix :
20+ build-type : [Release, Debug]
21+ target : [win32, x64]
22+
2223 steps :
2324 - uses : actions/checkout@v2
2425
2526 - name : Configure CMake
2627 # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
2728 # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
28- run : cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE }} -G "Visual Studio 17 2022" -T host=x64 -A win32
29+ run : cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -G "Visual Studio 17 2022" -T host=x64 -A ${{ matrix.target }}
2930
3031 - name : Build
3132 # Build your program with the given configuration
32- run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
33+ run : cmake --build ${{github.workspace}}/build --config ${{ matrix.build-type }}
34+ - name : Rename Binary
35+ # upload-release-action doesn't let you change the filename, so we'll just do it here
36+ run : move build/bin/${{ matrix.build-type }}/usbdump.exe build/bin/${{ matrix.build-type }}/usbdump-${{ matrix.build-type }}-${{ matrix.target }}.exe
3337 - name : Upload to Artifacts
3438 uses : actions/upload-artifact@v2
3539 with :
36- name : Release
37- path : build/bin/${{env.BUILD_TYPE }}/usbdump.exe
40+ name : ${{ matrix.build-type }} ${{ matrix.target }}
41+ path : build/bin/${{ matrix.build-type }}/usbdump-${{ matrix.build-type }}-${{ matrix.target }} .exe
3842 - name : Upload to Release
3943 if : github.event_name == 'release'
4044 uses : svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
4145 with :
4246 repo_token : ${{ secrets.GITHUB_TOKEN }}
43- file : build/bin/${{env.BUILD_TYPE }}/usbdump.exe
47+ file : build/bin/${{ matrix.build-type }}/usbdump-${{ matrix.build-type }}-${{ matrix.target }} .exe
4448 tag : ${{ github.ref }}
4549 file_glob : true
0 commit comments