mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew.git
synced 2025-05-13 11:37:33 -05:00
GitHub Actions (#3)
This commit is contained in:
parent
6c45efc4eb
commit
f7552812c9
2 changed files with 127 additions and 0 deletions
120
.github/workflows/rust.yml
vendored
Normal file
120
.github/workflows/rust.yml
vendored
Normal file
|
@ -0,0 +1,120 @@
|
||||||
|
name: Rust Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-x86_64:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '18'
|
||||||
|
|
||||||
|
- name: Install dependencies and build webui
|
||||||
|
run: |
|
||||||
|
cd webui
|
||||||
|
npm install
|
||||||
|
npm run build
|
||||||
|
rustup target add x86_64-pc-windows-msvc
|
||||||
|
|
||||||
|
- name: Set up Rust
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: stable
|
||||||
|
override: true
|
||||||
|
|
||||||
|
- name: Build Rust project for x86_64
|
||||||
|
run: cargo build --release --target x86_64-unknown-linux-gnu
|
||||||
|
|
||||||
|
- name: Archive production artifacts for x86_64
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: Linux_x86_64
|
||||||
|
path: target/x86_64-unknown-linux-gnu/release/ew
|
||||||
|
|
||||||
|
build-aarch64:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest]
|
||||||
|
arch: [aarch64]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '18'
|
||||||
|
|
||||||
|
- name: Install dependencies and build webui
|
||||||
|
run: |
|
||||||
|
cd webui
|
||||||
|
npm install
|
||||||
|
npm run build
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
- name: Set up Rust
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: stable
|
||||||
|
override: true
|
||||||
|
|
||||||
|
- name: Build Rust project for aarch64
|
||||||
|
run: cargo build --release
|
||||||
|
|
||||||
|
- name: Archive production artifacts for aarch64
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: Linux_aarch64
|
||||||
|
path: target/release/ew
|
||||||
|
|
||||||
|
build-windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '18'
|
||||||
|
|
||||||
|
- name: Install dependencies and build webui
|
||||||
|
run: |
|
||||||
|
cd webui
|
||||||
|
npm install
|
||||||
|
npm run build
|
||||||
|
cd ..
|
||||||
|
rustup target add x86_64-pc-windows-msvc
|
||||||
|
|
||||||
|
- name: Set up Rust
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: stable
|
||||||
|
override: true
|
||||||
|
|
||||||
|
- name: Build Rust project for Windows
|
||||||
|
run: cargo build --release --target x86_64-pc-windows-msvc
|
||||||
|
|
||||||
|
- name: Archive production artifacts for Windows
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: Windows_x86_64
|
||||||
|
path: target\x86_64-pc-windows-msvc\release\ew.exe
|
|
@ -10,8 +10,11 @@ A (mostly functioning) server for Love Live! School idol festival 2 MIRACLE LIVE
|
||||||
#### Requirements
|
#### Requirements
|
||||||
- [perl](https://www.perl.org/get.html) (This is normally pre-installed)
|
- [perl](https://www.perl.org/get.html) (This is normally pre-installed)
|
||||||
- [rust](https://www.rust-lang.org/tools/install)
|
- [rust](https://www.rust-lang.org/tools/install)
|
||||||
|
- [npm](https://www.npmjs.com/)
|
||||||
- The [libssl-dev](https://packages.debian.org/buster/libssl-dev) package. This will vary across distros.
|
- The [libssl-dev](https://packages.debian.org/buster/libssl-dev) package. This will vary across distros.
|
||||||
|
|
||||||
|
`apt install -y npm libssl-dev perl`
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
#### Requirements
|
#### Requirements
|
||||||
|
@ -20,5 +23,9 @@ A (mostly functioning) server for Love Live! School idol festival 2 MIRACLE LIVE
|
||||||
|
|
||||||
### Packaging/Running
|
### Packaging/Running
|
||||||
|
|
||||||
|
**Build npm:**
|
||||||
|
`cd webui && npm install && npm run build`
|
||||||
|
|
||||||
|
**Build Rust:**
|
||||||
Debug: `cargo run`
|
Debug: `cargo run`
|
||||||
Release: `cargo build --release`
|
Release: `cargo build --release`
|
||||||
|
|
Loading…
Add table
Reference in a new issue