Skip to content

core: Fix formatting (NFC) #169

core: Fix formatting (NFC)

core: Fix formatting (NFC) #169

Workflow file for this run

on:
push:
branches:
- main
tags:
- v*
pull_request:
name: Build
jobs:
check:
name: Check and lint
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Check build
uses: actions-rs/cargo@v1
with:
command: check
args: --all
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Check lints
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all -- -D warnings
build_lib:
name: Build (xdvdfs)
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: -p xdvdfs
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: -p xdvdfs
build_cli_linux:
name: Build for Linux (xdvdfs-cli)
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: -p xdvdfs-cli --release
- name: Package artifact
run: zip -j xdvdfs-linux-${{ github.sha }}.zip LICENSE target/release/xdvdfs
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: xdvdfs-linux-${{ github.sha }}
path: xdvdfs-linux-${{ github.sha }}.zip
build_cli_windows:
name: Build for Windows (xdvdfs-cli)
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: x86_64-pc-windows-gnu
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: -p xdvdfs-cli --release --target=x86_64-pc-windows-gnu
use-cross: true
- name: Package artifact
run: zip -j xdvdfs-windows-${{ github.sha }}.zip LICENSE target/x86_64-pc-windows-gnu/release/xdvdfs.exe
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: xdvdfs-windows-${{ github.sha }}
path: xdvdfs-windows-${{ github.sha }}.zip
build_web:
name: Build (web)
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
target: wasm32-unknown-unknown
- name: Install Trunk
uses: jetli/[email protected]
with:
version: 'latest'
- name: Build
run: trunk build --release
working-directory: ./xdvdfs-web
- name: Package artifact
run: zip xdvdfs-web-${{ github.sha }}.zip -r dist
working-directory: ./xdvdfs-web
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: xdvdfs-web-${{ github.sha }}
path: xdvdfs-web/xdvdfs-web-${{ github.sha }}.zip
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [build_cli_linux, build_cli_windows, build_web]
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: out
- name: Publish release
uses: softprops/action-gh-release@v1
with:
draft: false
prerelease: false
files: |
out/**/*.zip