-
-
Notifications
You must be signed in to change notification settings - Fork 5
61 lines (58 loc) · 1.8 KB
/
test_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
name: test_build
run-name: Test build on ${{ inputs.platform }}
on:
workflow_dispatch:
inputs:
platform:
description: 'Platform'
required: true
default: 'windows-latest'
type: choice
options:
- windows-latest
- ubuntu-latest
jobs:
# Build and upload as artifacts
build:
name: Building for tests on ${{ inputs.platform }}
runs-on: ${{ inputs.platform }}
env:
TARGET_PLATFORM: ${{ fromJSON('{"windows-latest":"win32","ubuntu-latest":"linux"}')[ inputs.platform ] }}
steps:
# Checkout repo
- uses: actions/checkout@v4
# Setup Node.js
- uses: actions/setup-node@v4
with:
node-version: 20
# Install npm deps
- name: Install npm dependencies
run: npm install --no-audit
# Build Vue frontend
- name: Build frontend
run: npm run build
# Set up Rust and Cargo
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: 1.77.2
# Build app
- name: Build backend
run: cargo build-${{ env.TARGET_PLATFORM }}
# Package app for release
- name: Package app
run: cargo pack-${{ env.TARGET_PLATFORM }} --tag debug-${{ github.run_number }}
# Create Windows installer
- if: inputs.platform == 'windows-latest'
name: Create Windows installer
shell: bash
run: |
cargo install cargo-packager --version 0.8.1 --locked
cargo create-installer-win32
rm -rf ./package/artifacts/.cargo-packager || true
# Upload build artifact
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ufc-ripper-test-build-${{ github.run_number }}-artifacts
path: package/artifacts/*