-
Notifications
You must be signed in to change notification settings - Fork 11
226 lines (186 loc) · 7.18 KB
/
build.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
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
name: Build and Publish
on:
push:
branches: [ main ]
permissions:
contents: write
jobs:
build:
name: Build (${{ matrix.name }})
strategy:
matrix:
include:
- name: Windows x64
os: windows-latest
extension: ".zip"
runtime: "win-x64"
# - name: Windows ARM64
# os: windows-latest
# extension: ".zip"
# runtime: "win-arm64"
- name: Linux x64
os: ubuntu-latest
extension: ".tar.gz"
runtime: "linux-x64"
# - name: macOS x64
# os: macos-13
# runtime: "osx-x64"
# extension: ".zip"
- name: macOS ARM64
os: macos-latest
runtime: "osx-arm64"
extension: ".zip"
fail-fast: false
runs-on: ${{ matrix.os }}
env:
PROJECT_NAME: "Angor"
SOLUTION_PATH: "src/Angor.sln"
PROJECT_PATH: "src/Angor/Client/Angor.Client.csproj"
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Variables
run: |
echo VERSION=$(npm run version --silent) >> $GITHUB_ENV
shell: bash
- name: Publish
run: dotnet publish -c Release -r ${{matrix.runtime}} /p:Version=${{ env.VERSION }}.${{ github.run_number }} -v m -o publish ${{env.PROJECT_PATH}}
- name: Run Tests
continue-on-error: true
run: dotnet test -c Release -r ${{matrix.runtime}} --verbosity normal ${{env.SOLUTION_PATH}}
- name: Zip Release
run: |
cd publish
if [ "${{ matrix.os }}" = "windows-latest" ]; then
7z a -tzip "../angor-web-${{ env.VERSION }}-${{ matrix.runtime }}.zip" .
elif [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
zip -r "../angor-web-${{ env.VERSION }}-${{ matrix.runtime }}.zip" .
else
zip -r "../angor-web-${{ env.VERSION }}-${{ matrix.runtime }}.zip" .
fi
shell: bash
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: angor-web-${{ env.VERSION }}-${{ matrix.runtime }}.zip
path: angor-web-${{ env.VERSION }}-${{ matrix.runtime }}.zip
- name: Install Rust (Stable)
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev webkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libsoup-3.0-dev libjavascriptcoregtk-4.1-dev
- name: Install and build
run: |
npm install
npm run tauri:build:${{ matrix.runtime }}
- name: Rename Linux files
if: matrix.os == 'ubuntu-latest'
run: |
mv src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/Angor_${{ env.VERSION }}_amd64.AppImage src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/angor-desktop-${{ env.VERSION }}-linux-amd64.AppImage
- name: Rename Mac files
if: matrix.runtime == 'osx-x64'
run: |
mv src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/Angor_${{ env.VERSION }}_aarch64.dmg src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/angor-desktop-${{ env.VERSION }}-mac-aarch64.dmg
- name: Rename Mac files
if: matrix.runtime == 'osx-arm64'
run: |
mv src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/Angor_${{ env.VERSION }}_aarch64.dmg src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/angor-desktop-${{ env.VERSION }}-mac-aarch64.dmg
- name: Rename Windows files
if: matrix.runtime == 'win-x64'
run: |
mv src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/Angor_${{ env.VERSION }}_x64_en-US.msi src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/angor-desktop-${{ env.VERSION }}-win-x64.msi
- name: Rename Windows files
if: matrix.runtime == 'win-arm64'
run: |
mv src-tauri/target/release/bundle/msi/Angor_${{ env.VERSION }}_arm64_en-US.msi src-tauri/target/release/bundle/msi/angor-desktop-${{ env.VERSION }}-win-arm64.msi
- uses: actions/upload-artifact@v4
name: Upload Linux
if: matrix.os == 'ubuntu-latest'
with:
name: angor-desktop-${{ env.VERSION }}-linux-amd64.AppImage
path: src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/angor-desktop-${{ env.VERSION }}-linux-amd64.AppImage
- uses: actions/upload-artifact@v4
name: Upload Mac
if: matrix.os == 'macos-latest'
with:
name: angor-desktop-${{ env.VERSION }}-mac-aarch64.dmg
path: src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/angor-desktop-${{ env.VERSION }}-mac-aarch64.dmg
- uses: actions/upload-artifact@v4
name: Upload Windows
if: matrix.runtime == 'win-x64'
with:
name: angor-desktop-${{ env.VERSION }}-win-x64.msi
path: src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/angor-desktop-${{ env.VERSION }}-win-x64.msi
- uses: actions/upload-artifact@v4
name: Upload Windows
if: matrix.runtime == 'win-arm64'
with:
name: angor-desktop-${{ env.VERSION }}-win-arm64.msi
path: src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/angor-desktop-${{ env.VERSION }}-win-arm64.msi
create-release:
name: Publish (Release)
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Variables
run: |
echo VERSION=$(npm run version --silent) >> $GITHUB_ENV
shell: bash
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: List Files
run: ls -R
- name: Create Release and Upload Assets
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
name: Angor (${{ env.VERSION }})
draft: true
files: |
artifacts/*
deploy-release:
name: Deploy (Test)
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Variables
run: |
echo VERSION=$(npm run version --silent) >> $GITHUB_ENV
shell: bash
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: List Files
run: ls -R
- name: Unzip Artifact
run: |
unzip artifacts/angor-web-${{ env.VERSION }}-linux-x64.zip -d dist
shell: bash
- name: Copy index.html to 404.html
run: cp dist/wwwroot/index.html dist/wwwroot/404.html
- name: Add .nojekyll file
run: touch dist/wwwroot/.nojekyll
- name: Deploy to Github Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: main
folder: dist/wwwroot
repository-name: block-core/angor-test
token: ${{ secrets.ANGOR_DEPLOY_TOKEN }}