diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 195c4d3..88847f0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,6 +9,7 @@ jobs: release: name: release ${{ matrix.target }} runs-on: ubuntu-latest + if: github.event_name == 'release' strategy: fail-fast: false matrix: @@ -28,3 +29,5 @@ jobs: with: RUSTTARGET: ${{ matrix.target }} ARCHIVE_TYPES: ${{ matrix.archive }} + POST_BUILD: "post_build.sh" + EXTRA_FILES: "RoPro-PATCHED.zip" \ No newline at end of file diff --git a/.gitignore b/.gitignore index eb1d4ef..d746890 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target Cargo.lock -.vscode \ No newline at end of file +.vscode +RoPro-PATCHED.zip \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 31ca2e1..666d52d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,3 +12,5 @@ reqwest = { version = "0.11.18", features = ["blocking"] } terminal-menu = "2.0.5" crx-dl = { git = "https://github.com/Stefanuk12/crx-dl.git" } zip-extract = "0.1.2" +zip = "0.6" +zip-extensions = "0.6.1" diff --git a/post_build.sh b/post_build.sh new file mode 100644 index 0000000..0484241 --- /dev/null +++ b/post_build.sh @@ -0,0 +1 @@ +cargo run --release 1 \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 9204a61..e350055 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ // Dependencies use terminal_menu::{run, menu, label, scroll, string, submenu, back_button, button, mut_menu, list}; +use zip_extensions::zip_create_from_directory; use std::{path::PathBuf, fs::{self, File}, io::{Cursor, Write}}; use platform_dirs::AppDirs; use crx_dl::{ChromeCRXQuery, crx_to_zip}; @@ -114,6 +115,15 @@ fn main() { // Download and patch download_patch(selected_proxy.to_string()); + // Zip up + let source_dir = PathBuf::from("RoPro"); + zip_create_from_directory(&PathBuf::from("RoPro-PATCHED.zip"), &source_dir) + .expect("unable to create zip"); + + // Delete directory + fs::remove_dir_all(source_dir) + .expect("unable to remove RoPro folder"); + // Done return }