-
Notifications
You must be signed in to change notification settings - Fork 3
160 lines (139 loc) · 4.26 KB
/
main.yml
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Wpf Continuous Integration
on:
push
jobs:
build:
strategy:
matrix:
targetplatform: [x86]
runs-on: windows-2019
name: Build
env:
App_Packages_Directory: LINKaWPF
Solution_Path: LINKaLooks.sln
Wpf_Project_Path: LINKaWPF\Linkaa.Looks.csproj
Actions_Allow_Unsecure_Commands: true # Allows AddPAth and SetEnv commands
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: Use Nerdbank.GitVersioning to set version variables
uses: aarnott/[email protected]
with:
setAllVars: true
- name: Install .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.302'
- name: Setup MSBuild.exe
uses: microsoft/[email protected]
- name: Restore packages
run: nuget restore $env:Solution_Path
- name: Build solution
run: msbuild $env:Solution_Path /t:Build /p:Configuration=Release
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: Release-bin
path: LinkaWPF/bin/Release
tests:
name: Test
needs: build
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: Download artifacts
uses: actions/[email protected]
with:
name: Release-bin
path: LinkaWPF/bin/Release
- name: Start app
run: .\LinkaWPF\bin\Release\Linka.looks.exe
- name: Wait starting (10s)
run: sleep 10
- name: Take Screen
uses: OrbitalOwen/[email protected]
with:
file-name: 'main.jpg'
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: Main
path: main.jpg
- name: Start editor
run: .\LinkaWPF\bin\Release\Linka.looks.exe -e
- name: Wait starting (10s)
run: sleep 10
- name: Take Screen
uses: OrbitalOwen/[email protected]
with:
file-name: 'Editor.jpg'
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: Editor
path: Editor.jpg
- name: Start set
run: .\LinkaWPF\bin\Release\Linka.looks.exe -p .\test\testset.linka
- name: Wait starting (10s)
run: sleep 10
- name: Take Screen
uses: OrbitalOwen/[email protected]
with:
file-name: 'set.jpg'
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: set
path: set.jpg
installer:
name: Create installer
needs: build
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: Download artifacts
uses: actions/[email protected]
with:
name: Release-bin
path: LinkaWPF/bin/Release
- name: Building the installer
run: |
"%programfiles(x86)%\Inno Setup 6\iscc.exe" "Linka.looks.iss"
shell: cmd
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: Installer-bin
path: Releases/linka.looks.setup.exe
deploy:
name: Deploy to server
needs: installer
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: Download artifacts
uses: actions/[email protected]
with:
name: Installer-bin
path: Releases/
- run: set -eu
- run: mkdir "$HOME/.ssh"
- run: echo "${{ secrets.SSH_KEY }}" > "$HOME/.ssh/key"
- run: chmod 600 "$HOME/.ssh/key"
- name: Deploy to server
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
run: |
cat Releases/linka.looks.setup.exe | ssh -i ~/.ssh/key -o StrictHostKeyChecking=no [email protected] sh /var/www/wordpress/dist/linka.looks/updatefile.sh