Skip to content

Commit fee8ca0

Browse files
committed
Test result of tasks TODO from README [ci] [cd]
1 parent 9a5ab7d commit fee8ca0

File tree

5 files changed

+30
-20
lines changed

5 files changed

+30
-20
lines changed

.github/workflows/actions.yaml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,20 @@ jobs:
2424
runs-on: ${{ matrix.runner }}
2525
steps:
2626
- uses: actions/checkout@v4
27-
- name: Кэш зависимостей
27+
- name: Кэш cargo зависимостей
2828
uses: actions/cache@v4
2929
with:
3030
path: |
3131
~/.cargo/registry
3232
~/.cargo/git
3333
target
3434
key: ${{ matrix.runner }}-cargo-${{ hashFiles('**/Cargo.lock') }}
35-
- name: Установка зависимостей (Linux)
35+
- name: Кэш apt зависимостей (Linux)
3636
if: matrix.os == 'linux'
37-
run: sudo apt install -y build-essential libssl-dev pkg-config cmake libgtk-3-dev libclang-dev
37+
uses: awalsh128/cache-apt-pkgs-action@latest
38+
with:
39+
packages: build-essential libssl-dev pkg-config cmake libgtk-3-dev libclang-dev
40+
version: 1.0
3841
- name: Сборка бинарного файла
3942
run: cargo build --release
4043
- name: Сохранение файла в артифакты
@@ -64,8 +67,12 @@ jobs:
6467
uses: dante-signal31/rust-app-version@v1.2.0
6568
with:
6669
cargo_toml_folder: ./
70+
- name: Переименование файлов
71+
run: |
72+
mv artifacts/sd-image-to-params artifacts/sd-image-to-params_v${{ steps.app_version.outputs.app_version }}_linux_x64 && \
73+
mv artifacts/sd-image-to-params.exe artifacts/sd-image-to-params_v${{ steps.app_version.outputs.app_version }}_windows_x64.exe
6774
- name: Публикация файлов
6875
run: |
6976
gh release create "v${{ steps.app_version.outputs.app_version }}" \
70-
'artifacts/sd-image-to-params#sd-image-to-params_v${{ steps.app_version.outputs.app_version }}_linux_x64' \
71-
'artifacts/sd-image-to-params.exe#sd-image-to-params_v${{ steps.app_version.outputs.app_version }}_windows_x64'
77+
'artifacts/sd-image-to-params_v${{ steps.app_version.outputs.app_version }}_linux_x64' \
78+
'artifacts/sd-image-to-params_v${{ steps.app_version.outputs.app_version }}_windows_x64.exe'

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sd-image-to-params"
3-
version = "1.0.0"
3+
version = "1.1.0"
44
edition = "2024"
55

66
[dependencies]

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# TODO:
2-
- [ ] [Add signing commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)
3-
- [ ] Rename files in CI/CD publish
4-
- [ ] [Cache APT packages for Linux CI/CD](https://github.com/marketplace/actions/cache-apt-packages)
5-
- [ ] Fix directory adding duplicates
2+
- [x] [Add signing commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)
3+
- [x] Rename files in CI/CD publish
4+
- [x] [Cache APT packages for Linux CI/CD](https://github.com/marketplace/actions/cache-apt-packages)
5+
- [x] Fix directory adding duplicates
66

77
Readme soon

src/core/file.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,24 @@ pub fn check_file(files: Signal<Vec<PathBuf>>, file: Event<FileData>) -> DnDStat
1111
None => return DnDStatus::Wrong
1212
};
1313
if path.is_dir(){
14-
let mut correct = false;
14+
let mut status = DnDStatus::Wrong;
1515
for entry in WalkDir::new(path)
1616
.into_iter().filter_map(|e| e.ok()){
1717
let path = entry.path().to_path_buf();
1818
match check_image(&path){
1919
true => {
20-
correct = true;
21-
break;
20+
if files.read().contains(&path){
21+
status = DnDStatus::Exists;
22+
} else{
23+
status = DnDStatus::Ok;
24+
break;
25+
}
2226
},
2327
false => continue
2428
}
2529
}
2630

27-
return match correct{
28-
true => DnDStatus::Ok,
29-
false => DnDStatus::Wrong
30-
}
31+
return status
3132
} else{
3233
if files.read().contains(path){
3334
return DnDStatus::Exists;
@@ -76,7 +77,9 @@ pub fn write(
7677
let path = entry.path().to_path_buf();
7778
match check_image(&path){
7879
true => {
79-
files.write().push(path.clone());
80+
if !files.read().contains(&path){
81+
files.write().push(path.clone());
82+
}
8083
},
8184
false => continue
8285
}
@@ -85,7 +88,7 @@ pub fn write(
8588
files.write().push(path.clone());
8689
}
8790
},
88-
DnDStatus::Exists => file_hover.set(DnDStatus::None),
91+
DnDStatus::Exists => file_hover.set(DnDStatus::Exists),
8992
status => file_hover.set(status)
9093
}
9194
}

0 commit comments

Comments
 (0)