chore(release): 0.6.2 #2086
Workflow file for this run
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: | |
workflow_dispatch: | |
inputs: | |
debug_enabled: | |
description: 'Run the build with tmate debugging enabled' | |
required: false | |
default: false | |
jobs: | |
fmt_clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup tmate session | |
uses: mxschmitt/action-tmate@v3 | |
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} | |
- name: Lint (rustfmt) | |
run: cargo fmt -- --check | |
- name: Lint (clippy) | |
run: cargo clippy --all-targets --all-features -- -D warnings | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
job: | |
- { target: x86_64-unknown-linux-musl, pretty: x86_64 } | |
- { target: arm-unknown-linux-musleabihf, pretty: armv6l } | |
- { target: armv7-unknown-linux-musleabihf, pretty: armv7l } | |
- { target: aarch64-unknown-linux-musl, pretty: aarch64 } | |
- { target: x86_64-unknown-linux-musl, pretty: x86_64-backend, args: --no-default-features } | |
- { target: arm-unknown-linux-musleabihf, pretty: armv6l-backend, args: --no-default-features } | |
- { target: armv7-unknown-linux-musleabihf, pretty: armv7l-backend, args: --no-default-features } | |
- { target: aarch64-unknown-linux-musl, pretty: aarch64-backend, args: --no-default-features } | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
target: ${{ matrix.job.target }} | |
- uses: Swatinem/rust-cache@v1 | |
with: | |
key: ${{ matrix.job.pretty }} | |
- name: Setup tmate session | |
uses: mxschmitt/action-tmate@v3 | |
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} | |
- name: Install set-cargo-version | |
run: cargo install set-cargo-version | |
- name: Change frontend version to commit hash | |
working-directory: frontend | |
run: npm version $(git describe --tags) --allow-same-version | |
- name: Change backend version to commit hash | |
run: set-cargo-version Cargo.toml $(git describe --tags | cut -c 2-) | |
- name: Build DietPi-Dashboard | |
uses: actions-rs/cargo@v1 | |
with: | |
use-cross: true | |
command: build | |
args: --release --target ${{ matrix.job.target }} ${{ matrix.job.args }} | |
- name: Upload binary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dietpi-dashboard-${{ matrix.job.pretty }} | |
path: target/${{ matrix.job.target }}/release/dietpi-dashboard |