-
-
Notifications
You must be signed in to change notification settings - Fork 2
198 lines (176 loc) · 6.42 KB
/
fw-lite.yaml
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
name: FieldWorks Lite
on:
workflow_dispatch:
push:
paths:
- 'backend/FwLite/**'
- 'backend/harmony/**'
- 'frontend/viewer/**'
- '.github/workflows/fw-lite.yaml'
branches:
- develop
pull_request:
paths:
- 'backend/FwLite/**'
- 'backend/harmony/**'
- 'frontend/viewer/**'
- '.github/workflows/fw-lite.yaml'
branches:
- develop
jobs:
build-and-test:
name: Build FW Lite and run tests
timeout-minutes: 20
runs-on: windows-latest
env:
NuGetPackageSourceCredentials_github: ${{ secrets.GH_NUGET_PACKAGE_CREDS }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- uses: actions/setup-node@v4
with:
node-version-file: './frontend/package.json'
- name: Dotnet build
working-directory: backend/FwLite/FwLiteDesktop
run: |
dotnet nuget enable source github
dotnet build --configuration Release
- name: Dotnet test
working-directory: backend/FwLite/LcmCrdt.Tests
run: dotnet test --configuration Release --logger GitHubActions
- name: Build viewer
working-directory: frontend/viewer
run: |
corepack enable
pnpm install
pnpm run build-app
publish-app:
name: Publish FW Lite app
# only publish if tag matches fwlite-v* pattern
# iif: startsWith(github.ref, 'refs/tags/fwlite-v')
needs: build-and-test
timeout-minutes: 20
runs-on: windows-latest
env:
NuGetPackageSourceCredentials_github: ${{ secrets.GH_NUGET_PACKAGE_CREDS }}
enable-msix: false #we can't sign the msix installer so we'll disable the build for now
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- uses: actions/setup-node@v4
with:
node-version-file: './frontend/package.json'
- name: Setup Maui
run: dotnet workload install maui-windows
- name: Enable GitHub Packages
working-directory: backend/FwLite
run: dotnet nuget enable source github
- name: Build viewer
working-directory: frontend/viewer
run: |
corepack enable
pnpm install
pnpm run build-app
- name: Dotnet build
working-directory: backend/FwLite/LocalWebApp
run: dotnet build --configuration Release
- name: Publish Linux
working-directory: backend/FwLite/LocalWebApp
run: dotnet publish -r linux-x64 --artifacts-path ../artifacts
- name: Publish OSX
working-directory: backend/FwLite/LocalWebApp
run: dotnet publish -r osx-x64 --artifacts-path ../artifacts
- name: Publish OSX ARM
working-directory: backend/FwLite/LocalWebApp
run: dotnet publish -r osx-arm64 --artifacts-path ../artifacts
- name: Publish Windows
working-directory: backend/FwLite/LocalWebApp
run: dotnet publish -r win-x64 --artifacts-path ../artifacts
- name: Publish Windows ARM
working-directory: backend/FwLite/LocalWebApp
run: dotnet publish -r win-arm64 --artifacts-path ../artifacts
- name: Upload local web app artifacts
uses: actions/upload-artifact@v4
with:
name: fw-lite-local-web-app
if-no-files-found: error
path: backend/FwLite/artifacts/publish/LocalWebApp/*
- name: Publish Windows MAUI unpackaged app
working-directory: backend/FwLite/FwLiteDesktop
run: |
dotnet publish -r win-x64 --artifacts-path ../artifacts -p:WindowsPackageType=None
dotnet publish -r win-arm64 --artifacts-path ../artifacts -p:WindowsPackageType=None
- name: Upload FWLite Desktop artifacts
uses: actions/upload-artifact@v4
with:
name: fw-lite-unpackaged
if-no-files-found: error
path: backend/FwLite/artifacts/publish/FwLiteDesktop/*
- name: Publish Windows MAUI msix app
if: ${{env.enable-msix}}
working-directory: backend/FwLite/FwLiteDesktop
run: |
dotnet publish -f net8.0-windows10.0.19041.0 -r win-x64 --artifacts-path ../artifacts -p:Platform=x64
dotnet publish -f net8.0-windows10.0.19041.0 -r win-arm64 --artifacts-path ../artifacts -p:Platform=arm64
mkdir -p ../artifacts/msix
cp ../artifacts/bin/FwLiteDesktop/*/AppPackages/*/*.msix ../artifacts/msix/
- name: Upload FWLite Desktop artifacts
uses: actions/upload-artifact@v4
if: ${{env.enable-msix}}
with:
name: fw-lite-msix
if-no-files-found: error
path: backend/FwLite/artifacts/msix/*.msix
sign-installer:
#disabled as this doesn't work since ltops-signing doesn't have the signtool
if: false
name: Sign FWLite MSIX installer
needs: publish-app
runs-on: [self-hosted, ltops-signing]
steps:
- uses: actions/download-artifact@v4
with:
name: fw-lite-msix
path: target-msix
- name: Sign MSIX installer
shell: pwsh
env:
signtool: C:/"Program Files (x86)"/"Windows Kits"/10/bin/10.0.17763.0/x86/signtool.exe
run: |
$PublicCert = [System.Convert]::FromBase64String('${{ secrets.CODESIGN_LSDEVSECTIGOEV }}')
Set-Content $ENV:TEMP\certificate -Value ($PublicCert) -AsByteStream
${{env.signtool}} sign /f $ENV:TEMP\certificate /fd sha256 /du https://software.sil.org /tr http://timestamp.sectigo.com /td sha256 /v target-msix/*.msix
- name: Upload signed MSIX installer
uses: actions/upload-artifact@v4
with:
name: fw-lite-msix-signed
if-no-files-found: error
path: target-msix/*.msix
create-release:
#disabled since we don't have a release yet
if: false
name: Create Release
needs: sign-installer
runs-on: windows-latest
steps:
- uses: actions/download-artifact@v4
with:
name: fw-lite
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
backend/FwLite/artifacts/bin/FwLiteDesktop/*/AppPackages/FwLiteDesktop_1.0.0.1_Test/*.msix
body: |
Release for version ${{ github.ref }}
draft: true