diff --git a/.github/workflows/pre-release.yaml b/.github/workflows/pre-release.yaml index 3543469..e4c054c 100644 --- a/.github/workflows/pre-release.yaml +++ b/.github/workflows/pre-release.yaml @@ -23,11 +23,10 @@ jobs: os: macos-latest - target: aarch64-apple-darwin os: macos-latest - # TODO: figure out Dioxus bundle format for Windows - # - target: x86_64-pc-windows-msvc - # os: windows-latest - # - target: aarch64-pc-windows-msvc - # os: windows-latest + - target: x86_64-pc-windows-msvc + os: windows-latest + - target: aarch64-pc-windows-msvc + os: windows-latest runs-on: ${{ matrix.os }} steps: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e2d7415..73395b5 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -13,24 +13,31 @@ jobs: matrix: include: - target: x86_64-unknown-linux-gnu - os: ubuntu-latest - output: repoquest.deb + os: ubuntu-latest + ext: deb - target: x86_64-apple-darwin os: macos-latest - output: RepoQuest.app.tar.gz + ext: tar.gz - target: aarch64-apple-darwin os: macos-latest - output: RepoQuest.app.tar.gz - + ext: tar.gz + - target: x86_64-pc-windows-msvc + os: windows-latest + ext: exe + - target: aarch64-pc-windows-msvc + os: windows-latest + ext: exe + + runs-on: ${{ matrix.os }} steps: - name: Checkout uses: actions/checkout@v4 - + - name: Install dependencies (Ubuntu) if: matrix.os == 'ubuntu-latest' run: sudo apt update -y && sudo apt install -y libgtk-3-dev libjavascriptcoregtk-4.1-dev libsoup-3.0-dev libwebkit2gtk-4.1-dev libxdo-dev - + - name: Install Rust toolchain for target uses: actions-rust-lang/setup-rust-toolchain@v1 with: @@ -44,32 +51,48 @@ jobs: - name: Build bundle run: dx bundle --release --target ${{ matrix.target }} - + - name: Prepare artifacts (MacOS) if: matrix.os == 'macos-latest' - run: tar -czf RepoQuest.app.tar.gz dist/bundle/macos/RepoQuest.app + run: | + mv dist/bundle/macos/RepoQuest.app . + tar -czf repo-quest_${{ matrix.target }}.tar.gz RepoQuest.app - name: Prepare artifacts (Ubuntu) if: matrix.os == 'ubuntu-latest' - run: mv dist/bundle/deb/RepoQuest_*.deb RepoQuest.deb + run: mv dist/bundle/deb/repo-quest_*.deb repo-quest_${{ matrix.target }}.deb + + - name: Prepare artifacts (Windows) + if: matrix.os == 'windows-latest' + run: mv dist/bundle/nsis/repo-quest_*.exe repo-quest_${{ matrix.target }}.exe - name: Upload artifacts uses: actions/upload-artifact@v4 with: name: ${{ matrix.target }} - path: ${{ matrix.output }} + path: repo-quest_${{ matrix.target }}.${{ matrix.ext }} publish-artifacts: needs: build-artifacts runs-on: ubuntu-latest steps: + - name: Add a tag for the merged commit + uses: christophebedard/tag-version-commit@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version_regex: 'v([0-9]+\.[0-9]+\.[0-9]+)' + version_tag_prefix: 'v' + - name: Download artifacts uses: actions/download-artifact@v4 + - name: Publish artifacts uses: softprops/action-gh-release@v1 with: tag_name: ${{ github.event.pull_request.title }} files: | - x86_64-unknown-linux-gnu/RepoQuest.deb - x86_64-apple-darwin/RepoQuest.app.tar.gz - aarch64-apple-darwin/RepoQuest.app.tar.gz + x86_64-unknown-linux-gnu/repo-quest_x86_64-unknown-linux-gnu.deb + x86_64-apple-darwin/repo-quest_x86_64-apple-darwin.tar.gz + aarch64-apple-darwin/repo-quest_aarch64-apple-darwin.tar.gz + x86_64-pc-windows-msvc/repo-quest_x86_64-pc-windows-msvc.exe + aarch64-pc-windows-msvc/repo-quest_aarch64-pc-windows-msvc.exe \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 56e0ddf..a7af298 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -817,9 +817,9 @@ dependencies = [ [[package]] name = "dioxus" -version = "0.5.1" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e50735a28b303b0d67e1b5637fb57e4711bf2776266290cbc987c0adfdabb55" +checksum = "b8e7fe217b50d43b27528b0f24c89b411f742a3e7564d1cfbf85253f967954db" dependencies = [ "dioxus-config-macro", "dioxus-core", @@ -834,9 +834,9 @@ dependencies = [ [[package]] name = "dioxus-cli-config" -version = "0.5.0" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5d4661064bad2f0b12929faf6c9cea4d94e60217ba6b11ff4146b505a57124b" +checksum = "c7dffc452ed91af6ef772b0d9a5899573f6785314e97c533733ec55413c01df3" dependencies = [ "once_cell", "serde", @@ -846,9 +846,9 @@ dependencies = [ [[package]] name = "dioxus-config-macro" -version = "0.5.0" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebe244197b320dec9e9f38742985fe98c058136ada770df73e9429878ed92863" +checksum = "cb1a1aa34cc04c1f7fcbb7a10791ba773cc02d834fe3ec1fe05647699f3b101f" dependencies = [ "proc-macro2", "quote", @@ -856,9 +856,9 @@ dependencies = [ [[package]] name = "dioxus-core" -version = "0.5.1" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "088daa3f45aaa729e9eef32dc0a9393dd709ee906b092089e5839cad1cad7c85" +checksum = "3730d2459ab66951cedf10b09eb84141a6eda7f403c28057cbe010495be156b7" dependencies = [ "futures-channel", "futures-util", @@ -867,15 +867,16 @@ dependencies = [ "rustc-hash", "serde", "slab", + "slotmap", "tracing", "tracing-subscriber", ] [[package]] name = "dioxus-core-macro" -version = "0.5.1" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e29a07448245451334eec2883a394e207f28caedf0a57fd1a903e9ccea0b9531" +checksum = "0d9c0dfe0e6a46626fa716c4aa1d2ccb273441337909cfeacad5bb6fcfb947d2" dependencies = [ "constcat", "convert_case 0.6.0", @@ -894,9 +895,9 @@ checksum = "2ea539174bb236e0e7dc9c12b19b88eae3cb574dedbd0252a2d43ea7e6de13e2" [[package]] name = "dioxus-desktop" -version = "0.5.1" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d85f5008be950e1dd255d947d8037e82e424ccc538892cf251b09a22558dc296" +checksum = "a2e0380cfcf44ed9310c6fd28454a7351293134d47b7e0b7baeaad5c5beded68" dependencies = [ "async-trait", "cocoa", @@ -933,9 +934,9 @@ dependencies = [ [[package]] name = "dioxus-fullstack" -version = "0.5.2" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db7fb1a22ff7af8756bc9506eebfbecf374b1c8c57f087c85c752ba8bd767fce" +checksum = "b80f0ac18166302341164e681322e0385131c08a11c3cc1c51ee8df799ab0d3d" dependencies = [ "async-trait", "base64 0.21.7", @@ -955,9 +956,9 @@ dependencies = [ [[package]] name = "dioxus-hooks" -version = "0.5.1" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a8c7019308a6d8381fce84a51006f207407af265aebc5425871399c98d788e4" +checksum = "fa8f9c661eea82295219d25555d5c0b597e74186b029038ceb5e3700ccbd4380" dependencies = [ "dioxus-core", "dioxus-debug-cell", @@ -972,9 +973,9 @@ dependencies = [ [[package]] name = "dioxus-hot-reload" -version = "0.5.0" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d5a28a2af6655473c6521fb5a428538807b985e8e5f1a8c30e2ab71bd54e637" +checksum = "77d01246cb1b93437fb0bbd0dd11cfc66342d86b4311819e76654f2017ce1473" dependencies = [ "dioxus-core", "dioxus-html", @@ -986,9 +987,9 @@ dependencies = [ [[package]] name = "dioxus-html" -version = "0.5.1" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8d612d9732f32adc1852e13e1387a9d5baa710b0b004641b5123def53065c8d" +checksum = "f01a0826f179adad6ea8d6586746e8edde0c602cc86f4eb8e5df7a3b204c4018" dependencies = [ "async-trait", "dioxus-core", @@ -1009,9 +1010,9 @@ dependencies = [ [[package]] name = "dioxus-html-internal-macro" -version = "0.5.0" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1799f34affdb158f6ebec23b46b11f9e65de0bbadbbb781dc68c3eddfe6fd32b" +checksum = "0b96f35a608d0ab8f4ca6f66ce1828354e4ebd41580b12454f490221a11da93c" dependencies = [ "convert_case 0.6.0", "proc-macro2", @@ -1021,9 +1022,9 @@ dependencies = [ [[package]] name = "dioxus-interpreter-js" -version = "0.5.1" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc68a22e33562317b40ccc7b2d140017e510745c5d7e062e911c6a4f9042e4b1" +checksum = "351fad098c657d14f3ac2900362d2b86e83c22c4c620a404839e1ab628f3395b" dependencies = [ "dioxus-core", "dioxus-html", @@ -1034,9 +1035,9 @@ dependencies = [ [[package]] name = "dioxus-lib" -version = "0.5.1" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9af36a9f985ad68783acf62dc276b0a8f0aa928f1c3b42f78e2ae222b19d445c" +checksum = "8bd39b2c41dd1915dcb91d914ea72d8b646f1f8995aaeff82816b862ec586ecd" dependencies = [ "dioxus-core", "dioxus-core-macro", @@ -1060,9 +1061,9 @@ dependencies = [ [[package]] name = "dioxus-rsx" -version = "0.5.1" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa83056104f63fdc6f7f9fc1137208c7b7648bf88d6c86db1e095f15297a0f3" +checksum = "15c400bc8a779107d8f3a67b14375db07dbd2bc31163bf085a8e9097f36f7179" dependencies = [ "dioxus-core", "internment", @@ -1075,9 +1076,9 @@ dependencies = [ [[package]] name = "dioxus-signals" -version = "0.5.1" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fd04e2b3739d5c12255005cbf3185446e750fc2b3eeee9fa4e83c989132415c" +checksum = "7e3e224cd3d3713f159f0199fc088c292a0f4adb94996b48120157f6a8f8342d" dependencies = [ "dioxus-core", "futures-channel", @@ -1091,9 +1092,9 @@ dependencies = [ [[package]] name = "dioxus_server_macro" -version = "0.5.1" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b723da95503f739f9fc5fb23b6ad1e456f1438a496a0427210fa94e4e0d5fe9" +checksum = "b5ef2cad17001c1155f019cb69adbacd620644566d78a77d0778807bb106a337" dependencies = [ "convert_case 0.6.0", "proc-macro2", @@ -1158,6 +1159,15 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +[[package]] +name = "encoding_rs" +version = "0.8.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +dependencies = [ + "cfg-if", +] + [[package]] name = "endi" version = "1.1.0" @@ -1558,9 +1568,9 @@ dependencies = [ [[package]] name = "generational-box" -version = "0.5.1" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f132919c96b85c02a067ceae965fd50ace57111e2f55c7384b95ac191f4d966b" +checksum = "557cf2cbacd0504c6bf8c29f52f8071e0de1d9783346713dc6121d7fa1e5d0e0" dependencies = [ "parking_lot", ] @@ -1798,6 +1808,25 @@ dependencies = [ "syn 2.0.71", ] +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.12", + "indexmap 2.2.6", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "half" version = "2.4.1" @@ -1899,6 +1928,17 @@ dependencies = [ "itoa 1.0.11", ] +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http 0.2.12", + "pin-project-lite", +] + [[package]] name = "http-body" version = "1.0.1" @@ -1918,7 +1958,7 @@ dependencies = [ "bytes", "futures-util", "http 1.1.0", - "http-body", + "http-body 1.0.1", "pin-project-lite", ] @@ -1928,6 +1968,36 @@ version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http 0.2.12", + "http-body 0.4.6", + "httparse", + "httpdate", + "itoa 1.0.11", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + [[package]] name = "hyper" version = "1.4.1" @@ -1938,7 +2008,7 @@ dependencies = [ "futures-channel", "futures-util", "http 1.1.0", - "http-body", + "http-body 1.0.1", "httparse", "itoa 1.0.11", "pin-project-lite", @@ -1955,7 +2025,7 @@ checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" dependencies = [ "futures-util", "http 1.1.0", - "hyper", + "hyper 1.4.1", "hyper-util", "log", "rustls", @@ -1972,7 +2042,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3203a961e5c83b6f5498933e78b6b263e208c197b63e9c6c53cc82ffd3f63793" dependencies = [ - "hyper", + "hyper 1.4.1", "hyper-util", "pin-project-lite", "tokio", @@ -1989,8 +2059,8 @@ dependencies = [ "futures-channel", "futures-util", "http 1.1.0", - "http-body", - "hyper", + "http-body 1.0.1", + "hyper 1.4.1", "pin-project-lite", "socket2", "tokio", @@ -2112,6 +2182,12 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae52f28f45ac2bc96edb7714de995cffc174a395fb0abf5bff453587c980d7b9" +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + [[package]] name = "iri-string" version = "0.7.2" @@ -2364,6 +2440,22 @@ dependencies = [ "autocfg", ] +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + [[package]] name = "miniz_oxide" version = "0.7.4" @@ -2595,9 +2687,9 @@ dependencies = [ "futures", "futures-util", "http 1.1.0", - "http-body", + "http-body 1.0.1", "http-body-util", - "hyper", + "hyper 1.4.1", "hyper-rustls", "hyper-timeout", "hyper-util", @@ -3138,7 +3230,7 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "repo-quest" -version = "0.1.0" +version = "0.0.1" dependencies = [ "anyhow", "dioxus", @@ -3156,6 +3248,45 @@ dependencies = [ "tracing", ] +[[package]] +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "base64 0.21.7", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.30", + "ipnet", + "js-sys", + "log", + "mime", + "mime_guess", + "once_cell", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-util", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "winreg", +] + [[package]] name = "rfd" version = "0.14.1" @@ -3490,6 +3621,7 @@ dependencies = [ "http 1.1.0", "js-sys", "once_cell", + "reqwest", "send_wrapper", "serde", "serde_json", @@ -3651,6 +3783,16 @@ dependencies = [ "rustc-hash", ] +[[package]] +name = "slotmap" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" +dependencies = [ + "serde", + "version_check", +] + [[package]] name = "smallvec" version = "1.13.2" @@ -3795,6 +3937,33 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "system-deps" version = "6.2.2" @@ -4122,7 +4291,7 @@ dependencies = [ "bytes", "futures-util", "http 1.1.0", - "http-body", + "http-body 1.0.1", "http-body-util", "iri-string", "pin-project-lite", @@ -4236,6 +4405,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-bidi" version = "0.3.15" @@ -4899,6 +5077,16 @@ dependencies = [ "memchr", ] +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + [[package]] name = "wry" version = "0.37.0" diff --git a/Cargo.toml b/Cargo.toml index 4d99789..9a9a3b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "repo-quest" -version = "0.1.0" +version = "0.0.1" edition = "2021" [dependencies] diff --git a/src/main.rs b/src/main.rs index 94b72f9..89aaee6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,3 @@ -#![allow(non_snake_case)] - mod git; mod github; mod quest; diff --git a/src/ui.rs b/src/ui.rs index 74c7284..74efeee 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -158,9 +158,6 @@ fn QuestLoader() -> Element { let mut quest_slot = use_signal_sync(|| None::); let state_signal = use_signal_sync(|| None::); let mut loading_signal = use_context::>(); - use_effect(move || { - loading_signal.set(ShowLoading(quest_slot.read_unchecked().is_none())); - }); match &*quest_slot.read_unchecked() { Some(quest) => rsx! { QuestView { quest: quest.clone() }}, None => rsx! { @@ -172,8 +169,10 @@ fn QuestLoader() -> Element { let res = use_resource(move || { let config = config.clone(); async move { + loading_signal.set(ShowLoading(true)); let quest = Quest::load(config, state_signal).await?; quest_slot.set(Some(QuestRef(Arc::new(quest)))); + loading_signal.set(ShowLoading(false)); Ok::<_, anyhow::Error>(()) } });