fix: fmt #36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
paths: | |
- '.github/workflows/build.yml' | |
- 'Cargo.lock' | |
- 'Cargo.toml' | |
- 'src/**' | |
- 'ext/**' | |
- 'build.rs' | |
pull_request: | |
paths: | |
- '.github/workflows/build.yml' | |
- 'Cargo.lock' | |
- 'Cargo.toml' | |
- 'src/**' | |
- 'ext/**' | |
- 'build.rs' | |
env: | |
CARGO_INCREMENTAL: 0 | |
jobs: | |
build: | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [windows-latest, ubuntu-20.04, macos-latest] | |
steps: | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- uses: ilammy/msvc-dev-cmd@v1 | |
if: matrix.platform == 'windows-latest' | |
- name: Clone WebUI | |
run: git clone -b ext https://github.com/SpikeHD/webui.git | |
- name: Build WebUI | |
if: matrix.platform != 'windows-latest' | |
run: | | |
cd webui | |
make | |
cd .. | |
- name: Build WebUI | |
if: matrix.platform == 'windows-latest' | |
run: | | |
cd webui | |
nmake | |
cd .. | |
- name: Move static WebUI lib to root | |
if: matrix.platform != 'windows-latest' | |
run: mv webui/dist/*webui-2-static* . | |
- name: Move static WebUI lib to root | |
if: matrix.platform == 'windows-latest' | |
run: move webui\dist\*webui-2-static* ./webui-2-static.lib | |
- name: Build | |
run: cargo build --release | |
env: | |
RUSTFLAGS: -Awarnings | |
# Move the binary to the root of the project | |
- name: Move Binary | |
run: mv target/release/flooed* . | |
# Zip up the binary as well as the ext/ folder | |
- name: Compress | |
if: matrix.platform != 'windows-latest' | |
run: | | |
zip -r release.zip ext flooed | |
- name: Compress | |
if: matrix.platform == 'windows-latest' | |
run: | | |
7z a -tzip release.zip ext flooed.exe | |
- name: Upload Release | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ./release.zip | |
name: release-${{ runner.os }}.zip |