-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (84 loc) · 2.83 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
name: Build
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
arch: [x86_64, aarch64]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Build backend
run: cargo build
- name: Upload artifact (Linux)
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'x86_64'
uses: actions/upload-artifact@v3
with:
name: ubuntu-latest-romichan-server
path: target/debug/server
- name: Upload artifact (Linux aarch64)
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'aarch64'
uses: actions/upload-artifact@v3
with:
name: ubuntu-latest-romichan-server-aarch64
path: target/debug/server
- name: Upload artifact (macOS)
if: matrix.os == 'macos-latest' && matrix.arch == 'x86_64'
uses: actions/upload-artifact@v3
with:
name: macos-latest-romichan-server
path: target/debug/server
- name: Upload artifact (macOS aarch64)
if: matrix.os == 'macos-latest' && matrix.arch == 'aarch64'
uses: actions/upload-artifact@v3
with:
name: macos-latest-romichan-server-aarch64
path: target/debug/server
- name: Upload artifact (Windows)
if: matrix.os == 'windows-latest' && matrix.arch == 'x86_64'
uses: actions/upload-artifact@v3
with:
name: windows-latest-romichan-server
path: target/debug/server.exe
- name: Upload artifact (Windows aarch64)
if: matrix.os == 'windows-latest' && matrix.arch == 'aarch64'
uses: actions/upload-artifact@v3
with:
name: windows-latest-romichan-server-aarch64
path: target/debug/server.exe
- name: Set up Node.js
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'x86_64'
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install pnpm
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'x86_64'
uses: pnpm/action-setup@v2
with:
version: 9
- name: Build frontend
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'x86_64'
run: |
pnpm install --no-frozen-lockfile
cd client
pnpm build
tar -czf dist.tar.gz dist/client
cd ../
- name: Upload artifact (Frontend)
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'x86_64'
uses: actions/upload-artifact@v3
with:
name: romichan-client
path: client/dist.tar.gz