Skip to content

Commit

Permalink
Version 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-pro committed Jan 10, 2024
1 parent 62a3d5c commit dc84954
Show file tree
Hide file tree
Showing 81 changed files with 7,541 additions and 7,592 deletions.
91 changes: 30 additions & 61 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,89 +4,58 @@ on: [push, pull_request]

env:
CARGO_TERM_COLOR: always
IMAGE_NAME: solar-screen-brightness

jobs:

build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
include:
- os: windows-latest
exe_suffix: .exe
exe_name: windows
- os: ubuntu-latest
exe_name: ubuntu20
windows:
runs-on: windows-latest

steps:
- if: ${{ matrix.os == 'windows-latest' }}
name: Install LLVM and Clang # required for bindgen to work, see https://github.com/rust-lang/rust-bindgen/issues/1797
uses: KyleMayes/[email protected]
with:
version: "11.0"
directory: ${{ runner.temp }}/llvm
- if: ${{ matrix.os == 'windows-latest' }}
name: Set LIBCLANG_PATH
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV

- if: ${{ matrix.os == 'ubuntu-latest' }}
name: Install Ubuntu dependencies
run: sudo apt update && sudo apt install -y qtbase5-dev libudev-dev

- uses: actions/checkout@v2
with:
submodules: recursive

- name: Cargo Clippy (App)
run: cargo clippy -- -D warnings
working-directory: ./app

- name: Cargo Test (App)
- name: Cargo Test
run: cargo test
working-directory: ./app

- name: Cargo Clippy (Installer)
- name: Cargo Clippy
run: cargo clippy -- -D warnings
working-directory: ./installer

- name: Cargo Test (Installer)
run: cargo test
working-directory: ./installer

- if: ${{ matrix.os == 'windows-latest' }}
name: Cargo Clippy (Windows)
run: cargo clippy -- -D warnings
working-directory: ./windows

- if: startsWith(github.ref, 'refs/tags/')
name: Compile Release
- name: Cargo Release Build
run: cargo build --release
working-directory: ./installer

- if: startsWith(github.ref, 'refs/tags/')
name: Copy Binary
run: cp ./installer/target/release/solar-screen-brightness-installer${{ matrix.exe_suffix }} ./installer-${{ matrix.exe_name }}${{ matrix.exe_suffix }}
- name: Create installer
run: makensis installer/windows.nsi

- if: startsWith(github.ref, 'refs/tags/')
name: Github Release
name: Publish Release Artifacts
uses: softprops/action-gh-release@v1
with:
files: ./installer-${{ matrix.exe_name }}${{ matrix.exe_suffix }}
files: |
./target/release/ssb.exe
./target/release/ssb-cli.exe
./installer/ssb-installer.exe
ubuntu:
runs-on: ubuntu-latest

steps:
- name: Install Ubuntu dependencies
run: sudo apt update && sudo apt install -y libudev-dev libgtk-3-dev libxdo-dev

- uses: actions/checkout@v2

- name: Cargo Test
run: cargo test

- name: Cargo Clippy
run: cargo clippy -- -D warnings

check_style:
strategy:
matrix:
dir: [ app, installer, windows ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Cargo Format Check
- name: Cargo Format
run: cargo fmt -- --check
working-directory: ./${{ matrix.dir }}

- name: Cargo Sort Check
run: cargo install cargo-sort && cargo-sort --check
working-directory: ./${{ matrix.dir }}
- name: Cargo Sort
run: cargo install cargo-sort --debug && cargo-sort --check --workspace
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
**/target
**/*.rs.bk
.idea/

*.exe
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

Loading

0 comments on commit dc84954

Please sign in to comment.