-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (74 loc) · 2.05 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
name: Build and release binary
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version:
description: 'Version to build'
required: true
default: '0.0.0'
defaults:
run:
shell: bash
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
suffix: -linux
- os: windows-latest
suffix: -windows
- os: macos-latest
suffix: -macos
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt, clippy
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 8
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: "pnpm"
cache-dependency-path: "crates/assets/frontend/pnpm-lock.yaml"
- name: Install dependencies
run: pnpm install
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Build frontend
run: |
cd crates/assets/frontend
pnpm build
- name: Build
run: |
if [ -z "${{ inputs.version }}" ]; then
VERSION=$(echo $GITHUB_REF | sed 's/refs\/tags\/v//')
else
VERSION=${{ inputs.version }}
fi
echo "Building version $VERSION"
cargo install cargo-edit
cargo set-version $VERSION -p cantari
cargo build --release
- name: Archive
run: |
mkdir archive
cp target/release/{cantari,*.so,*.dll,*.dylib,sample.vvm,*.html,dict} archive
zip -r cantari-${{ github.ref_name }}${{ matrix.suffix }}.zip archive
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
cantari-${{ github.ref_name }}${{ matrix.suffix }}.zip