Browse Source

Add 'dotnet/.github/workflows/msbuild.xml'

天问 2 years ago
parent
commit
a464ddc6b1
1 changed files with 96 additions and 0 deletions
  1. 96 0
      dotnet/.github/workflows/msbuild.xml

+ 96 - 0
dotnet/.github/workflows/msbuild.xml

@@ -0,0 +1,96 @@
+name: Release CI
+on: push
+jobs:
+  x64_build:
+    runs-on: windows-latest
+
+    steps:
+    - uses: actions/checkout@v2
+      
+    - name: Add msbuild to PATH
+      uses: microsoft/setup-msbuild@v1
+      
+    - name: Run msbuild
+      run: msbuild -p:configuration=release -p:platform=x64 -p:platformToolset=v142
+      
+    - name: Get current time
+      uses: 1466587594/current-time@v1
+      id: current-time
+      with:
+        format: YYYYMMDD_HHmmss
+        utcOffset: "+08:00"
+      
+    - name : Upload artifact
+      uses: actions/upload-artifact@v2
+      with:
+        name: x64_${{ steps.current-time.outputs.formattedTime }}_TrafficMonitor
+        path: |
+          Bin/x64/Release/TrafficMonitor.exe
+          Bin/x64/Release/*.dll
+
+    - name : Upload pdb files
+      uses: actions/upload-artifact@v2
+      with:
+        name: x64_${{ steps.current-time.outputs.formattedTime }}_pdb
+        path: Bin/x64/Release/*.pdb
+
+  x86_build:
+    runs-on: windows-latest
+
+    steps:
+    - uses: actions/checkout@v2
+      
+    - name: Add msbuild to PATH
+      uses: microsoft/setup-msbuild@v1
+      
+    - name: Run msbuild
+      run: msbuild -p:configuration=release -p:platform=x86 -p:platformToolset=v142
+      
+    - name: Get current time
+      uses: 1466587594/current-time@v1
+      id: current-time
+      with:
+        format: YYYYMMDD_HHmmss
+        utcOffset: "+08:00"
+      
+    - name : Upload artifact
+      uses: actions/upload-artifact@v2
+      with:
+        name: x86_${{ steps.current-time.outputs.formattedTime }}_TrafficMonitor
+        path: |
+          Bin/Release/TrafficMonitor.exe
+          Bin/Release/*.dll
+      
+    - name : Upload pdb files
+      uses: actions/upload-artifact@v2
+      with:
+        name: x86_${{ steps.current-time.outputs.formattedTime }}_pdb
+        path: Bin/Release/*.pdb
+
+  # winXP_build:
+    # runs-on: windows-latest
+
+    # steps:
+    # - uses: actions/checkout@v2
+      
+    # - name: Add msbuild to PATH
+      # uses: microsoft/setup-msbuild@v1
+      
+    # - name: Run msbuild
+      # run: |
+        # set ExternalCompilerOptions=/DCOMPILE_FOR_WINXP
+        # msbuild -p:configuration=release -p:platform=x86 -p:platformToolset=v140_xp
+      # shell: cmd
+      
+    # - name: Get current time
+      # uses: 1466587594/current-time@v1
+      # id: current-time
+      # with:
+        # format: YYYYMMDD_HHmmss
+        # utcOffset: "+08:00"
+      
+    # - name : Upload artifact
+      # uses: actions/upload-artifact@v1
+      # with:
+        # name: winXP_${{ steps.current-time.outputs.formattedTime }}_TrafficMonitor
+        # path: Bin/Release/TrafficMonitor.exe