From c503bf2dfacdb506cd939ea2051aa428c51c9382 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A6Ltorio?= Date: Fri, 18 Oct 2024 15:20:17 +0200 Subject: [PATCH] refacctor nightly build --- .github/workflows/macos-intel-build.yml | 17 ++- .github/workflows/ubuntu.yml | 104 +++++++------ .github/workflows/windows.yml | 15 +- Cargo.lock | 191 ++++++------------------ Cargo.toml | 2 +- 5 files changed, 125 insertions(+), 204 deletions(-) diff --git a/.github/workflows/macos-intel-build.yml b/.github/workflows/macos-intel-build.yml index ace42f37..e4bc15f7 100644 --- a/.github/workflows/macos-intel-build.yml +++ b/.github/workflows/macos-intel-build.yml @@ -77,12 +77,13 @@ jobs: uses: actions/attest-build-provenance@v1 with: subject-path: 'target/release/hbbs, target/release/hbbr, target/release/rustdesk-utils' - - - name: Upload Release Assets binaries for Macos amd64 - uses: softprops/action-gh-release@v2 - continue-on-error: true - with: - files: | - /tmp/macos_${{ matrix.job.arch }}_${{ github.event.release.tag_name }}.zip + + - name: Create Release with gh for Macos amd64 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + export TAG_NAME=${{ github.event.release.tag_name }} + export TAG_NAME=${TAG_NAME:-"nightly"} + echo $TAG_NAME + gh release create $TAG_NAME -t "$TAG_NAME" -n "$TAG_NAME" || true + gh release upload $TAG_NAME /tmp/macos_${{ matrix.job.arch }}_$TAG_NAME.zip --clobber \ No newline at end of file diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 6165276e..f1e555e9 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -12,60 +12,76 @@ jobs: contents: write packages: write attestations: write + env: + TARGET: x86_64-unknown-linux-musl steps: - - name: Checkout code - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 - - name: Set up environment - run: | - sudo apt-get update - sudo apt-get install -y curl build-essential debhelper devscripts pkg-config libssl-dev libsqlite3-dev zip + - name: Set up environment + run: | + sudo apt-get update + sudo apt-get install -y curl build-essential debhelper devscripts pkg-config libssl-dev libsqlite3-dev zip musl-dev musl-tools - - name: Install Rust toolchain - uses: crusty-pie/toolchain@main - with: + - name: Install Rust toolchain + uses: crusty-pie/toolchain@main + with: profile: minimal toolchain: stable override: true + targets: ${{env.TARGET}} - - name: Cache cargo registry - uses: actions/cache@v4 - with: - path: ~/.cargo/registry - key: ubuntu-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cargo index - uses: actions/cache@v4 - with: - path: ~/.cargo/git - key: ubuntu-cargo-git-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo registry + uses: actions/cache@v4 + with: + path: ~/.cargo/registry + key: ubuntu-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo index + uses: actions/cache@v4 + with: + path: ~/.cargo/git + key: ubuntu-cargo-git-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cargo build - uses: actions/cache@v4 - with: - path: target - key: ubuntu-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo build + uses: actions/cache@v4 + with: + path: target + key: ubuntu-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" - - name: Build project - run: | - cargo update -p sctgdesk-api-server - DATABASE_URL=sqlite://$(pwd)/db_v2.sqlite3 cargo build --release + - name: Build project + run: | + cargo update -p sctgdesk-api-server + DATABASE_URL=sqlite://$(pwd)/db_v2.sqlite3 cargo build --target=${{env.TARGET}} --release + zip -r /tmp/linux_${{env.TARGET}}.zip target/${{env.TARGET}}/release/hbbs target/${{env.TARGET}}/release/hbbr target/${{env.TARGET}}/release/rustdesk-utils - - name: Attest release - uses: actions/attest-build-provenance@v1 - with: - subject-path: 'target/release/hbbs, target/release/hbbr, target/release/rustdesk-utils' + - name: Attest release + uses: actions/attest-build-provenance@v1 + with: + subject-path: "target/${{env.TARGET}}/release/hbbs, target/${{env.TARGET}}/release/hbbr, target/${{env.TARGET}}/release/rustdesk-utils" - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: ubuntu_amd64 - path: | - target/release/hbbs - target/release/hbbr - target/release/rustdesk-utils \ No newline at end of file + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ubuntu_amd64 + path: | + target/${{env.TARGET}}release/hbbs + target/${{env.TARGET}}release/hbbr + target/${{env.TARGET}}release/rustdesk-utils + /tmp/linux_${{env.TARGET}}.zip + + - name: Create Release with gh + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + export TAG_NAME=${{ github.event.release.tag_name }} + export TAG_NAME=${TAG_NAME:-"nightly"} + echo $TAG_NAME + mv /tmp/linux_${{env.TARGET}}.zip /tmp/linux_${{env.TARGET}}_${TAG_NAME}.zip + gh release create $TAG_NAME -t "$TAG_NAME" -n "$TAG_NAME" || true + gh release upload $TAG_NAME /tmp/linux_${{env.TARGET}}_${TAG_NAME}.zip --clobber \ No newline at end of file diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 14f3fcc2..66cf2eb0 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -73,14 +73,15 @@ jobs: with: subject-path: '/tmp/windows_${{ matrix.job.arch }}_${{ github.event.release.tag_name }}.zip' - - name: Upload Release Assets binaries for Windows - uses: softprops/action-gh-release@v2 - continue-on-error: true - with: - files: | - /tmp/windows_${{ matrix.job.arch }}_${{ github.event.release.tag_name }}.zip + - name: Create Release with gh for Windows amd64 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + export TAG_NAME=${{ github.event.release.tag_name }} + export TAG_NAME=${TAG_NAME:-"nightly"} + echo $TAG_NAME + gh release create $TAG_NAME -t "$TAG_NAME" -n "$TAG_NAME" || true + gh release upload $TAG_NAME /tmp/windows_${{ matrix.job.arch }}_$TAG_NAME.zip --clobber - name: Attest release uses: actions/attest-build-provenance@v1 diff --git a/Cargo.lock b/Cargo.lock index 3c91977a..eec97329 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -547,12 +547,12 @@ dependencies = [ "aws-smithy-types", "bytes", "fastrand", - "h2 0.3.26", + "h2", "http 0.2.12", "http-body 0.4.6", "http-body 1.0.0", "hyper 0.14.28", - "hyper-rustls", + "hyper-rustls 0.24.2", "once_cell", "pin-project-lite", "pin-utils", @@ -1583,21 +1583,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -1799,25 +1784,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "h2" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "816ec7294445779408f36fe57bc5b7fc1cf59664059096c65f905c1c61f58069" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 1.1.0", - "indexmap 2.2.6", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -1891,7 +1857,7 @@ dependencies = [ [[package]] name = "hbbs" -version = "1.1.99-46" +version = "1.1.99-47" dependencies = [ "async-speed-limit", "async-trait", @@ -2096,14 +2062,14 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2 0.3.26", + "h2", "http 0.2.12", "http-body 0.4.6", "httparse", "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.7", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -2119,7 +2085,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.4", "http 1.1.0", "http-body 1.0.0", "httparse", @@ -2143,22 +2108,23 @@ dependencies = [ "rustls 0.21.12", "rustls-native-certs", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", ] [[package]] -name = "hyper-tls" -version = "0.6.0" +name = "hyper-rustls" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" dependencies = [ - "bytes", - "http-body-util", + "futures-util", + "http 1.1.0", "hyper 1.3.1", "hyper-util", - "native-tls", + "rustls 0.22.4", + "rustls-pki-types", "tokio", - "tokio-native-tls", + "tokio-rustls 0.25.0", "tower-service", ] @@ -2601,24 +2567,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "native-tls" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "neli" version = "0.6.4" @@ -2773,7 +2721,7 @@ dependencies = [ [[package]] name = "oauth2" version = "0.1.0" -source = "git+https://github.com/sctg-development/sctgdesk-api-server.git?branch=main#63cb5323e8c6e19054d4163c610eb2ce28c9f9c9" +source = "git+https://github.com/sctg-development/sctgdesk-api-server.git?branch=main#a2f8bccbdceff47a0c4e5db32c505dce1647bad6" dependencies = [ "base64 0.22.1", "log", @@ -2818,50 +2766,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" -[[package]] -name = "openssl" -version = "0.10.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" -dependencies = [ - "bitflags 2.5.0", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2 1.0.81", - "quote 1.0.36", - "syn 2.0.60", -] - [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "openssl-sys" -version = "0.9.102" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "ordered-multimap" version = "0.4.3" @@ -3397,37 +3307,36 @@ checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" dependencies = [ "base64 0.22.1", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2 0.4.4", "http 1.1.0", "http-body 1.0.0", "http-body-util", "hyper 1.3.1", - "hyper-tls", + "hyper-rustls 0.26.0", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "rustls 0.22.4", "rustls-pemfile 2.1.2", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls 0.25.0", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "winreg 0.52.0", ] @@ -3669,6 +3578,20 @@ dependencies = [ "sct", ] +[[package]] +name = "rustls" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +dependencies = [ + "log", + "ring 0.17.8", + "rustls-pki-types", + "rustls-webpki 0.102.8", + "subtle", + "zeroize", +] + [[package]] name = "rustls" version = "0.23.13" @@ -3756,7 +3679,7 @@ checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "s3software" version = "0.1.0" -source = "git+https://github.com/sctg-development/sctgdesk-api-server.git?branch=main#63cb5323e8c6e19054d4163c610eb2ce28c9f9c9" +source = "git+https://github.com/sctg-development/sctgdesk-api-server.git?branch=main#a2f8bccbdceff47a0c4e5db32c505dce1647bad6" dependencies = [ "aws-config", "aws-sdk-s3", @@ -3834,8 +3757,8 @@ dependencies = [ [[package]] name = "sctgdesk-api-server" -version = "1.1.99-46" -source = "git+https://github.com/sctg-development/sctgdesk-api-server.git?branch=main#63cb5323e8c6e19054d4163c610eb2ce28c9f9c9" +version = "1.1.99-47" +source = "git+https://github.com/sctg-development/sctgdesk-api-server.git?branch=main#a2f8bccbdceff47a0c4e5db32c505dce1647bad6" dependencies = [ "base64 0.22.1", "bcrypt", @@ -4350,7 +4273,7 @@ dependencies = [ [[package]] name = "state" version = "0.1.0" -source = "git+https://github.com/sctg-development/sctgdesk-api-server.git?branch=main#63cb5323e8c6e19054d4163c610eb2ce28c9f9c9" +source = "git+https://github.com/sctg-development/sctgdesk-api-server.git?branch=main#a2f8bccbdceff47a0c4e5db32c505dce1647bad6" dependencies = [ "base64 0.22.1", "bcrypt", @@ -4466,27 +4389,6 @@ dependencies = [ "windows 0.51.1", ] -[[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 = "tempfile" version = "3.10.1" @@ -4611,22 +4513,23 @@ dependencies = [ ] [[package]] -name = "tokio-native-tls" -version = "0.3.1" +name = "tokio-rustls" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "native-tls", + "rustls 0.21.12", "tokio", ] [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" dependencies = [ - "rustls 0.21.12", + "rustls 0.22.4", + "rustls-pki-types", "tokio", ] @@ -5013,7 +4916,7 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "utils" version = "0.1.0" -source = "git+https://github.com/sctg-development/sctgdesk-api-server.git?branch=main#63cb5323e8c6e19054d4163c610eb2ce28c9f9c9" +source = "git+https://github.com/sctg-development/sctgdesk-api-server.git?branch=main#a2f8bccbdceff47a0c4e5db32c505dce1647bad6" dependencies = [ "base64 0.22.1", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 747322c9..e24121d9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hbbs" -version = "1.1.99-46" +version = "1.1.99-47" authors = ["sctg ", "rustdesk "] edition = "2021" build = "build.rs"