-
-
Notifications
You must be signed in to change notification settings - Fork 4
52 lines (50 loc) · 1.57 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
name: test_build
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:
PACKAGE_NAME: ${{ fromJSON('{"windows-latest":"ufc-ripper-win32-x64.zip","ubuntu-latest":"ufc-ripper-linux-x64.zip"}')[ inputs.platform ] }}
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 }}
# Upload build artifact
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ufc-ripper-test-build-${{ github.run_number }}-artifacts
path: package/artifacts/${{ env.PACKAGE_NAME }}