Skip to content

Commit

Permalink
try to fix CI by not touching target dir
Browse files Browse the repository at this point in the history
  • Loading branch information
wiiznokes committed Dec 10, 2023
1 parent 4e9b679 commit 08f620f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[env]
LMSENSORS_STATIC = "1"
LMSENSORS_INCLUDE_DIR = { value = "target/libsensors_build/include", relative = true }
LMSENSORS_LIB_DIR = { value = "target/libsensors_build/lib", relative = true }
LMSENSORS_INCLUDE_DIR = { value = "build/libsensors/include", relative = true }
LMSENSORS_LIB_DIR = { value = "build/libsensors/lib", relative = true }
RUST_LOG = "fan_control=debug,data=info,hardware=debug,ui=debug"
RUST_BACKTRACE = "full"

Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/upload_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@ jobs:
- name: Install cargo-bundle
run: cargo install cargo-bundle
- name: Package deb
run: make package-deb

- run: |
cp ./target/release/bundle/deb/fan-control*.deb .
echo "ARTIFACT_NAME=$(basename ./fan-control*.deb)" >> $GITHUB_ENV
run: |
make package-deb
echo "ARTIFACT_NAME=$(basename ./bundle/fan-control*.deb)" >> $GITHUB_ENV
- uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: |
./${{ env.ARTIFACT_NAME }}
./bundle/${{ env.ARTIFACT_NAME }}
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ target/

# custom

.test/
temp/
.idea/
.vscode/*
!.vscode/launch.json
Expand All @@ -15,4 +15,6 @@ bin/
obj/
.config/hardware.toml
/scripts/*
!scripts/icons.py
!scripts/icons.py
build/
bundle/
19 changes: 10 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,21 @@

package-deb: export PACKAGE_TYPE=DEB


## Build Libs

libsensors:
git submodule update --init hardware/libsensors
make -C ./hardware/libsensors/ install PREFIX=./../../target/libsensors_build ETCDIR=./../../target/libsensors_build/etc
make -C ./hardware/libsensors/ install PREFIX=./../../build/libsensors ETCDIR=./../../build/libsensors/etc

lhm:
dotnet build ./hardware/LibreHardwareMonitorWrapper/ -c Release

## Packaging

package-deb:
cargo bundle --release --format deb

package-msi:
cargo bundle --release --format msi
cargo bundle --release --format deb
mkdir -p bundle
cp ./target/release/bundle/deb/fan-control*.deb ./bundle/

## Test

Expand All @@ -35,7 +33,7 @@ test:
## Clean

clean-libsensors:
make -C ./hardware/libsensors/ clean uninstall PREFIX=./../../target/libsensors_build ETCDIR=./../../target/libsensors_build/etc
make -C ./hardware/libsensors/ clean uninstall PREFIX=./../../build/libsensors ETCDIR=./../../build/libsensors/etc

clean-lhm:
dotnet clean ./hardware/LibreHardwareMonitorWrapper/
Expand All @@ -53,7 +51,7 @@ fake:
cargo run --features fake_hardware -- -p ./.config -c fake

temp:
cargo run --features fake_hardware -- -p ./.temp
cargo run --features fake_hardware -- -p ./temp

git-cache:
git rm -rf --cached .
Expand All @@ -79,4 +77,7 @@ debinfo:
dpkg-query -s fan-control

debl:
dpkg-query -L fan-control
dpkg-query -L fan-control

package-msi:
cargo bundle --release --format msi
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<OutputPath>.\..\..\target\lhm</OutputPath>
<OutputPath>.\..\..\ressource\windows\build</OutputPath>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions hardware/src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ const CHECK_RESPONSE: &str = "fan-control-ok";
impl HardwareBridge for WindowsBridge {
fn generate_hardware() -> (Hardware, HardwareBridgeT) {
#[cfg(test)]
let path = "./../target/lhm/LibreHardwareMonitorWrapper";
let path = "./../ressource/windows/build/LibreHardwareMonitorWrapper";
#[cfg(not(test))]
let path = "./target/lhm/LibreHardwareMonitorWrapper";
let path = "./ressource/windows/build/LibreHardwareMonitorWrapper";

let handle = process::Command::new(path).spawn().unwrap();

Expand Down

0 comments on commit 08f620f

Please sign in to comment.