-
Notifications
You must be signed in to change notification settings - Fork 0
149 lines (126 loc) · 4.64 KB
/
CI.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
name: CI
on: [push, pull_request]
jobs:
conventions:
name: Check style & commit msg conventions
runs-on: ubuntu-22.04
container:
image: "ubuntu:22.04"
steps:
- uses: actions/checkout@v1
with:
submodules: false
- name: Install dependencies
run: |
apt update
apt install --yes sudo
sudo apt install --yes --no-install-recommends git npm
# workaround for https://github.com/actions/runner/issues/2033
- name: ownership workaround
run: git config --global --add safe.directory '*'
- name: Install .NET6
run: |
apt update && apt install --yes sudo
sudo apt install --yes curl dotnet6
- name: Check F# style with fantomless
run: |
dotnet new tool-manifest
dotnet tool install fantomless-tool --version 4.7.996
dotnet fantomless --recurse .
git diff --exit-code
- name: Check C# style with dotnet format
run: |
dotnet format whitespace ./src --folder
git diff --exit-code
- name: Check XAML style with prettier
run: |
sudo npm install --save-dev prettier @prettier/plugin-xml
./node_modules/.bin/prettier --xml-whitespace-sensitivity ignore --tab-width 4 --prose-wrap preserve --write '**/*.xaml'
git diff --exit-code
- name: Check if gitPush1by1 was used
if: github.event_name == 'pull_request'
run: dotnet fsi ./conventions/scripts/detectNotUsingGitPush1by1.fsx
build-windows:
name: (Windows) Build Android Frontend
needs: conventions
runs-on: windows-2022
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 7.0.x
- name: Install Maui workload
run: dotnet workload install maui
- name: Build Frontend (Android)
run: dotnet build src\Frontend\Frontend.csproj --framework net7.0-android
build-macOS:
name: (macOS) Build+Test Android Frontend
needs: conventions
runs-on: macos-latest
steps:
# beware about using v2 because https://github.com/actions/checkout/issues/100
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 7.0.x
- name: Install Maui workload
run: dotnet workload install maui
- name: Build Frontend (Android)
run: dotnet build src/Frontend/Frontend.csproj --framework net7.0-android
build-linux-frontend-android:
name: (Linux) Build Android Frontend
needs: conventions
runs-on: ubuntu-22.04
steps:
- name: Check for Secret availability
id: secret-check
# perform secret check & put boolean result as an output
shell: bash
run: |
if [ "${{ secrets.KEYSTORE_PASSWORD }}" != '' ]; then
echo "available=true" >> $GITHUB_OUTPUT;
else
echo "available=false" >> $GITHUB_OUTPUT;
fi
# beware about using v2 because https://github.com/actions/checkout/issues/100
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 7.0.x
- name: Install Maui workloads
run: sudo dotnet workload install maui-android
- name: Build Frontend (Android)
run: |
sudo dotnet build src/Frontend/Frontend.csproj \
--framework net7.0-android \
--configuration Debug \
-p:AndroidSdkDirectory=/usr/local/lib/android/sdk \
-p:AndroidOnly=true
- name: Publish Frontend (Android)
if: ${{ steps.secret-check.outputs.available == 'true' }}
run: |
sudo dotnet publish src/Frontend/Frontend.csproj \
--framework net7.0-android \
--configuration Release \
-p:AndroidSdkDirectory=/usr/local/lib/android/sdk \
-p:AndroidSigningKeyPass="${{ secrets.KEYSTORE_PASSWORD }}" \
-p:AndroidSigningStorePass="${{ secrets.KEYSTORE_PASSWORD }}" \
-p:AndroidOnly=true
# Upload artifact fails with "permission denied" error without this
- name: Fix permissions
if: ${{ steps.secret-check.outputs.available == 'true' }}
run: sudo chmod -R 755 src/Frontend/bin/Release/net7.0-android/publish
- uses: actions/upload-artifact@v3
if: ${{ steps.secret-check.outputs.available == 'true' }}
with:
name: publishedPackages
path: src/Frontend/bin/Release/net7.0-android/publish