-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (63 loc) · 1.89 KB
/
Copy pathbuild.yml
File metadata and controls
76 lines (63 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Build with MSVC
on:
push:
branches: [ main, master, develop ]
paths:
- '*.cpp'
- '*.h'
- '*.vcxproj'
- '.github/workflows/build.yml'
pull_request:
branches: [ main, master, develop ]
release:
types: [published]
env:
SOLUTION_FILE_PATH: ./TouchFish.FileMove.sln
BUILD_CONFIGURATION: Release
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
platform: [x64]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{matrix.platform}} ${{env.SOLUTION_FILE_PATH}}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: TouchFish.FileMove-${{matrix.platform}}
path: |
${{matrix.platform}}/${{env.BUILD_CONFIGURATION}}/*.exe
${{matrix.platform}}/${{env.BUILD_CONFIGURATION}}/*.dll
if-no-files-found: warn
release:
if: github.event_name == 'release'
needs: build
runs-on: windows-latest
permissions:
contents: write
steps:
- name: Download x64 artifacts
uses: actions/download-artifact@v4
with:
name: TouchFish.FileMove-x64
path: release/x64
- name: Create release archives
run: |
Compress-Archive -Path release/x64/* -DestinationPath TouchFish.FileMove-x64.zip
- name: Upload release assets
uses: softprops/action-gh-release@v1
with:
files: |
TouchFish.FileMove-x64.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}