use ref_name as release name
[mfgtools.git] / .github / workflows / win.yaml
blobdeca8c6fc8f9c60c7fff98bbd34ef6129ca202dd
1 name: Build with VS Studio
3 on:
4   push:
5     branches:
6       - master
7     tags:
8       - uuu*
9   pull_request:
10     types:
11       - opened
12       - synchronize
14 jobs:
15   build:
16     runs-on: windows-latest
18     strategy:
19       matrix:
20         configuration: ['Debug', 'Release']
21         platform: ['x86', 'x64']
23     steps:
24     - name: Checkout code
25       uses: actions/checkout@v3
26       with:
27         fetch-depth: 0
28         submodules: true
29     
30     - name: Set up Visual Studio
31       uses: microsoft/setup-msbuild@v1.1
33     - name: Build static solution
34       run: msbuild /p:Configuration=${{ matrix.configuration }} /p:PlatformToolset=v143 /p:Platform=${{ matrix.platform }} msvc/uuu-static-link.sln
36     - name: Upload Build Artifacts
37       if: matrix.configuration == 'Release' && matrix.platform == 'x64'
38       uses: actions/upload-artifact@v3
39       with:
40         name: uuu.exe
41         path: msvc/x64/Release/uuu.exe
43     - name: Create or Update Release
44       if: matrix.configuration == 'Release' && matrix.platform == 'x64'
45       uses: ncipollo/release-action@v1
46       with:
47         name: Release ${{ github.ref_name }}
48         tag: ${{ github.ref_name }}
49         commit: ${{ github.sha }}
50         allowUpdates: true
51         draft: true
52         prerelease: true
53         artifacts: msvc/x64/Release/uuu.exe
55     - name: Build dynamic solution
56       run: msbuild /p:Configuration=${{ matrix.configuration }} /p:PlatformToolset=v143 /p:Platform=${{ matrix.platform }} msvc/uuu.sln