From 5fe2d3d129a45aa324da18f495fa9ea221ff95bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 11:16:11 +0000 Subject: [PATCH 1/4] build(deps): bump actions/upload-artifact from 4 to 6 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 6. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v4...v6) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb137aa..2b1e138 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,7 +55,7 @@ jobs: mv -f target/${{ matrix.target }}/release/znotify target/${{ matrix.target }}/release/znotify-${{ matrix.target }} - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: ${{ matrix.target }} path: | @@ -96,7 +96,7 @@ jobs: mv -f target/${{ matrix.target }}/release/znotify target/${{ matrix.target }}/release/znotify-${{ matrix.target }} - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: ${{ matrix.target }} path: target/${{ matrix.target }}/release/znotify-${{ matrix.target }} @@ -135,7 +135,7 @@ jobs: mv -f target/${{ matrix.target }}/release/znotify.exe target/${{ matrix.target }}/release/znotify-${{ matrix.target }}.exe - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: ${{ matrix.target }} path: target/${{ matrix.target }}/release/znotify-${{ matrix.target }}.exe From a80df038bb276a9d9e02ac0af789d08b52f8eaa6 Mon Sep 17 00:00:00 2001 From: Zxilly Date: Wed, 7 Oct 2026 04:41:50 -0700 Subject: [PATCH 2/4] build(deps): consolidate validated CLI dependency group [skip ci] --- Cargo.lock | 257 +++++++++++++++++++++++++++++++++-------------------- Cargo.toml | 8 +- 2 files changed, 165 insertions(+), 100 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 177dc98..c89ca5b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,21 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "addr2line" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - [[package]] name = "aho-corasick" version = "0.7.20" @@ -107,21 +92,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "backtrace" -version = "0.3.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - [[package]] name = "base64" version = "0.21.0" @@ -177,9 +147,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.34" +version = "4.5.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e958897981290da2a852763fe9cdb89cd36977a5d729023127095fa94d95e2ff" +checksum = "0c2cfd7bf8a6017ddaa4e32ffe7403d547790db06bd171c1c53926faab501623" dependencies = [ "clap_builder", "clap_derive", @@ -187,9 +157,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.34" +version = "4.5.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83b0f35019843db2160b5bb19ae09b4e6411ac33fc6a712003c33e03090e2489" +checksum = "0a4c05b9e80c5ccd3a7ef080ad7b6ba7d6fc00a985b8b157197075677c82c7a0" dependencies = [ "anstream", "anstyle", @@ -199,18 +169,18 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.45" +version = "4.5.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e3040c8291884ddf39445dc033c70abc2bc44a42f0a3a00571a0f483a83f0cd" +checksum = "2348487adcd4631696ced64ccdb40d38ac4d31cae7f2eec8817fcea1b9d1c43c" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "4.5.32" +version = "4.5.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" +checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671" dependencies = [ "heck", "proc-macro2", @@ -506,12 +476,6 @@ dependencies = [ "wasi", ] -[[package]] -name = "gimli" -version = "0.27.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" - [[package]] name = "git2" version = "0.20.0" @@ -565,9 +529,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" [[package]] name = "heck" @@ -795,9 +759,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.5.0" +version = "2.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5" dependencies = [ "equivalent", "hashbrown", @@ -874,15 +838,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.169" +version = "0.2.177" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" [[package]] name = "libgit2-sys" -version = "0.18.0+1.9.0" +version = "0.18.1+1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1a117465e7e1597e8febea8bb0c410f1c7fb93b1e1cddf34363f8390367ffec" +checksum = "e1dcb20f84ffcdd825c7a311ae347cce604a6f084a767dec4a4929829645290e" dependencies = [ "cc", "libc", @@ -938,15 +902,6 @@ version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" -dependencies = [ - "adler", -] - [[package]] name = "mio" version = "1.0.1" @@ -998,15 +953,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" -[[package]] -name = "object" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" -dependencies = [ - "memchr", -] - [[package]] name = "once_cell" version = "1.17.0" @@ -1300,12 +1246,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - [[package]] name = "rustix" version = "0.38.28" @@ -1442,18 +1382,28 @@ checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" [[package]] name = "serde" -version = "1.0.218" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.218" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -1473,11 +1423,11 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.8" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +checksum = "e24345aa0fe688594e73770a5f6d1b216508b4f93484c0026d521acd30134392" dependencies = [ - "serde", + "serde_core", ] [[package]] @@ -1546,6 +1496,16 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "socket2" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + [[package]] name = "spin" version = "0.9.8" @@ -1684,17 +1644,16 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.43.0" +version = "1.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" +checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" dependencies = [ - "backtrace", "bytes", "libc", "mio", "pin-project-lite", - "socket2 0.5.5", - "windows-sys 0.52.0", + "socket2 0.6.1", + "windows-sys 0.61.2", ] [[package]] @@ -1734,26 +1693,43 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.8" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533" dependencies = [ - "serde", + "serde_core", ] [[package]] name = "toml_edit" -version = "0.22.24" +version = "0.23.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" +checksum = "6485ef6d0d9b5d0ec17244ff7eb05310113c3f316f2d14200d4de56b3cb98f8d" dependencies = [ "indexmap", - "serde", + "serde_core", "serde_spanned", "toml_datetime", + "toml_parser", + "toml_writer", "winnow", ] +[[package]] +name = "toml_parser" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e" +dependencies = [ + "winnow", +] + +[[package]] +name = "toml_writer" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2" + [[package]] name = "tower" version = "0.4.13" @@ -2047,6 +2023,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + [[package]] name = "windows-sys" version = "0.42.0" @@ -2080,6 +2062,24 @@ dependencies = [ "windows-targets 0.52.0", ] +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-targets" version = "0.48.0" @@ -2110,6 +2110,23 @@ dependencies = [ "windows_x86_64_msvc 0.52.0", ] +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.1" @@ -2128,6 +2145,12 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + [[package]] name = "windows_aarch64_msvc" version = "0.42.1" @@ -2146,6 +2169,12 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + [[package]] name = "windows_i686_gnu" version = "0.42.1" @@ -2164,6 +2193,18 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + [[package]] name = "windows_i686_msvc" version = "0.42.1" @@ -2182,6 +2223,12 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + [[package]] name = "windows_x86_64_gnu" version = "0.42.1" @@ -2200,6 +2247,12 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.1" @@ -2218,6 +2271,12 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + [[package]] name = "windows_x86_64_msvc" version = "0.42.1" @@ -2236,11 +2295,17 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + [[package]] name = "winnow" -version = "0.7.0" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e49d2d35d3fad69b39b94139037ecfb4f359f08958b9c11e7315ce770462419" +checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index 1692a2b..e081603 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,16 +12,16 @@ categories = ["command-line-interface"] build = "build.rs" [dependencies] -clap = { version = "4.5.34", features = ["derive", "cargo", "std"] } -tokio = { version = "1.43.0", features = ["rt-multi-thread"] } +clap = { version = "4.5.50", features = ["derive", "cargo", "std"] } +tokio = { version = "1.48.0", features = ["rt-multi-thread"] } serde = { version = "1.0", features = ["derive"] } znotify = "0.2.0" dirs = "5.0.1" -toml_edit = { version = "0.22.24", features = ["serde"] } +toml_edit = { version = "0.23.7", features = ["serde"] } self_update = "0.42.0" async-trait = "0.1.86" shadow-rs = "0.38.1" -clap_complete = "4.5.45" +clap_complete = "4.5.59" [build-dependencies] shadow-rs = "0.38.1" From ef6c5d35a43b8ea37b5a2e9ddd4f5daeb9fe2d52 Mon Sep 17 00:00:00 2001 From: Zxilly Date: Wed, 7 Oct 2026 04:46:23 -0700 Subject: [PATCH 3/4] test: cover CLI configuration compatibility [skip ci] --- src/helper/config.rs | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/helper/config.rs b/src/helper/config.rs index 0d8f30c..3f1598f 100644 --- a/src/helper/config.rs +++ b/src/helper/config.rs @@ -110,3 +110,38 @@ pub(crate) fn get_config() -> Config { }); config } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn parses_existing_config() { + let input = "# Existing CLI configuration\nuser_secret = \"test-secret\"\nendpoint = \"https://example.com/notify\"\n"; + let config: Config = de::from_str(input).unwrap(); + assert_eq!(config.user_secret.as_deref(), Some("test-secret")); + assert_eq!(config.endpoint.as_deref(), Some("https://example.com/notify")); + } + + #[test] + fn config_updates_preserve_comments_and_round_trip_strings() { + let input = "# Keep this comment\nuser_secret = \"old\"\nendpoint = \"https://example.com\"\n"; + let mut document = DocumentMut::from_str(input).unwrap(); + let secret = "test-\"quoted\"-\\-通知"; + let endpoint = "https://example.com/通知?key=value"; + document["user_secret"] = value(secret); + document["endpoint"] = value(endpoint); + let output = document.to_string(); + assert!(output.contains("# Keep this comment")); + let config: Config = de::from_str(&output).unwrap(); + assert_eq!(config.user_secret.as_deref(), Some(secret)); + assert_eq!(config.endpoint.as_deref(), Some(endpoint)); + } + + #[test] + fn optional_config_fields_remain_optional() { + let config: Config = de::from_str("endpoint = \"https://example.com\"\n").unwrap(); + assert_eq!(config.user_secret, None); + assert_eq!(config.endpoint.as_deref(), Some("https://example.com")); + } +} From 5aeadd5beb353716b44c5099c9ad231d9dc09bef Mon Sep 17 00:00:00 2001 From: Zxilly Date: Wed, 7 Oct 2026 04:47:27 -0700 Subject: [PATCH 4/4] ci: validate grouped CLI upgrades across all build targets --- .github/workflows/build.yml | 69 +++++++++++++++++++++++++++++++------ 1 file changed, 59 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b1e138..b9549b9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,7 +23,7 @@ jobs: steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Rust Setup id: setup @@ -43,9 +43,27 @@ jobs: sudo apt-get install -qq -y gcc-aarch64-linux-gnu fi + - name: Set up Python for PR validation + if: github.event_name == 'pull_request' && matrix.target == 'x86_64-unknown-linux-gnu' + uses: actions/setup-python@v6 + with: + python-version: '3.11' + cache: 'pip' + cache-dependency-path: 'scripts/requirements.txt' + + - name: Validate release script syntax without running scripts + if: github.event_name == 'pull_request' && matrix.target == 'x86_64-unknown-linux-gnu' + env: + PYTHONPYCACHEPREFIX: ${{ runner.temp }}/znotify-python-cache + run: python -m py_compile scripts/version.py scripts/winget.py + + - name: Test CLI on native host + if: startsWith(matrix.target, 'x86_64-') + run: cargo test --locked --bins + - name: Build binary run: | - cargo build --release --bins --target ${{ matrix.target }} + cargo build --locked --release --bins --target ${{ matrix.target }} cargo deb --target ${{ matrix.target }} @@ -71,7 +89,7 @@ jobs: - aarch64-apple-darwin steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Rust Setup id: setup @@ -86,9 +104,13 @@ jobs: run: | rustup target add ${{ matrix.target }} + - name: Test CLI on native host + if: startsWith(matrix.target, 'x86_64-') + run: cargo test --locked --bins + - name: Build binary run: | - cargo build --release --bins --target ${{ matrix.target }} + cargo build --locked --release --bins --target ${{ matrix.target }} - name: Rename binary shell: bash @@ -104,13 +126,14 @@ jobs: build_binary_windows: runs-on: windows-latest strategy: + fail-fast: false matrix: target: - x86_64-pc-windows-msvc - aarch64-pc-windows-msvc steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Rust Setup id: setup @@ -125,9 +148,13 @@ jobs: run: | rustup target add ${{ matrix.target }} + - name: Test CLI on native host + if: startsWith(matrix.target, 'x86_64-') + run: cargo test --locked --bins + - name: Build binary run: | - cargo build --release --bins --target ${{ matrix.target }} + cargo build --locked --release --bins --target ${{ matrix.target }} - name: Rename binary shell: bash @@ -140,13 +167,35 @@ jobs: name: ${{ matrix.target }} path: target/${{ matrix.target }}/release/znotify-${{ matrix.target }}.exe + verify_artifacts: + if: github.event_name == 'pull_request' + needs: [ build_binary_linux, build_binary_macos, build_binary_windows ] + runs-on: ubuntu-latest + steps: + - name: Download PR artifacts + uses: actions/download-artifact@v7.0.0 + with: + path: binary + - name: Verify platform binaries + shell: bash + run: | + for target in x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu; do + test -s "binary/$target/release/znotify-$target" + done + for target in x86_64-apple-darwin aarch64-apple-darwin; do + test -s "binary/$target/znotify-$target" + done + for target in x86_64-pc-windows-msvc aarch64-pc-windows-msvc; do + test -s "binary/$target/znotify-$target.exe" + done + release_nightly: if: github.event_name == 'push' needs: [ build_binary_linux, build_binary_macos, build_binary_windows ] runs-on: ubuntu-latest steps: - name: Get all artifacts - uses: actions/download-artifact@v4.3.0 + uses: actions/download-artifact@v7.0.0 with: path: binary @@ -165,11 +214,11 @@ jobs: needs: [ build_binary_linux, build_binary_macos, build_binary_windows ] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: ref: 'master' - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: '3.11' cache: 'pip' @@ -181,7 +230,7 @@ jobs: pip install -r scripts/requirements.txt - name: Get all artifacts - uses: actions/download-artifact@v4.3.0 + uses: actions/download-artifact@v7.0.0 with: path: binary