-
Notifications
You must be signed in to change notification settings - Fork 4
115 lines (99 loc) · 3.43 KB
/
Copy pathbuild-web.yml
File metadata and controls
115 lines (99 loc) · 3.43 KB
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
name: Build Web Artifacts
on:
push:
branches:
- main
paths:
- .github/workflows/build-web.yml
- 'apps/web/**'
- 'packages/shared/**'
- 'packages/ui/**'
- 'packages/configs/**'
pull_request:
branches:
- main
paths:
- .github/workflows/build-web.yml
- 'apps/web/**'
- 'packages/shared/**'
- 'packages/ui/**'
- 'packages/configs/**'
workflow_dispatch:
permissions:
contents: read
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- platform: ubuntu-latest
target: x86_64-unknown-linux-gnu
targetName: linux-x86_64-gnu
- platform: macos-latest
target: x86_64-apple-darwin
targetName: macOS-x86_64
- platform: macos-latest
target: aarch64-apple-darwin
targetName: macOS-aarch64
- platform: windows-latest
target: x86_64-pc-windows-msvc
targetName: windows-x86_64
runs-on: ${{ matrix.platform }}
name: build (${{ matrix.platform }}, ${{ matrix.target }})
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
submodules: 'true'
- name: Install bun
uses: oven-sh/setup-bun@v2
with:
run_install: false
- name: Setup node
uses: actions/setup-node@v6
with:
node-version: lts/*
cache: "bun"
cache-dependency-path: bun.lock
- name: Cache bun store
uses: actions/cache@v4
with:
path: ${{ matrix.platform == 'windows-latest' && '~\\AppData\\Local\\bun-store' || '~/.bun-store' }}
key: ${{ matrix.platform }}-bun-${{ hashFiles('bun.lock') }}
restore-keys: |
${{ matrix.platform }}-bun-
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
${{ matrix.platform == 'windows-latest' && '~\\AppData\\Local\\Cargo\\bin' || '~/.cargo/bin/' }}
${{ matrix.platform == 'windows-latest' && '~\\AppData\\Local\\Cargo\\registry\\index' || '~/.cargo/registry/index/' }}
${{ matrix.platform == 'windows-latest' && '~\\AppData\\Local\\Cargo\\registry\\cache' || '~/.cargo/registry/cache/' }}
${{ matrix.platform == 'windows-latest' && '~\\AppData\\Local\\Cargo\\git\\db' || '~/.cargo/git/db/' }}
target
key: ${{ matrix.platform }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ matrix.platform }}-cargo-
- name: Install NPM dependencies
run: bun install --no-frozen-lockfile
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: ${{ matrix.target }}
- name: Build
env:
IS_ACTION_BUILD: true
run: |
cd apps/web
bun frontend:build
cargo build --release --target ${{ matrix.target }}
- name: Strip Binary (macos & ubuntu only)
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
run: strip target/${{ matrix.target }}/release/mcsl_future_web
- name: Upload Artifact
uses: actions/upload-artifact@v5
with:
name: MCSL-Future-Web-${{ matrix.targetName }}
path: target/${{ matrix.target }}/release/mcsl_future_web${{ matrix.platform == 'windows-latest' && '.exe' || '' }}