Can't create release when push to master
[mfgtools.git] / .github / workflows / win.yaml
blob810c591770bb2e7453f244fd948f236594066be6
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: |
35         git fetch --tags --force # Retrieve annotated tags. #issue 290
36         msbuild /p:Configuration=${{ matrix.configuration }} /p:PlatformToolset=v143 /p:Platform=${{ matrix.platform }} msvc/uuu-static-link.sln
38     - name: Upload Build Artifacts
39       if: matrix.configuration == 'Release' && matrix.platform == 'x64'
40       uses: actions/upload-artifact@v3
41       with:
42         name: uuu.exe
43         path: msvc/x64/Release/uuu.exe
45     - name: Create or Update Release
46       if: matrix.configuration == 'Release' && matrix.platform == 'x64' && ${{ github.ref_type }} == 'tag'
47       uses: ncipollo/release-action@v1
48       with:
49         name: Release ${{ github.ref_name }}
50         tag: ${{ github.ref_name }}
51         commit: ${{ github.sha }}
52         allowUpdates: true
53         prerelease: true
54         artifacts: msvc/x64/Release/uuu.exe
56     - name: Build dynamic solution
57       run: msbuild /p:Configuration=${{ matrix.configuration }} /p:PlatformToolset=v143 /p:Platform=${{ matrix.platform }} msvc/uuu.sln