From db14d404fa5f7647e1f3755800a331a7dbb2741e Mon Sep 17 00:00:00 2001 From: williamfzc <178894043@qq.com> Date: Wed, 6 Mar 2024 23:30:46 +0800 Subject: [PATCH] chore(#17): multi targets in releases --- .github/workflows/release.yaml | 42 ++++++++++++++++---------- Cargo.lock | 54 +++++++++++++++++++++++++++++++++- Cargo.toml | 4 ++- 3 files changed, 82 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5ccc963..ca4fd03 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,18 +9,6 @@ on: - v* jobs: - cargo-publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - uses: katyo/publish-crates@v2 - with: - registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} - create-release: runs-on: ubuntu-latest steps: @@ -33,10 +21,19 @@ jobs: needs: create-release strategy: matrix: - os: - - ubuntu-latest - - macos-latest - - windows-latest + include: + # Ubuntu + - target: aarch64-unknown-linux-musl + os: ubuntu-latest + - target: x86_64-unknown-linux-musl + os: ubuntu-latest + # Mac OS + - target: universal-apple-darwin + os: macos-latest + # Windows + - target: x86_64-pc-windows-msvc + os: windows-latest + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -44,4 +41,17 @@ jobs: with: bin: cupido zip: all + target: ${{ matrix.target }} token: ${{ secrets.GITHUB_TOKEN }} + + cargo-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - uses: katyo/publish-crates@v2 + with: + registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/Cargo.lock b/Cargo.lock index d72fbf5..8b7b24c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -368,7 +368,7 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "cupido" -version = "0.3.0" +version = "0.3.1" dependencies = [ "axum", "clap", @@ -376,6 +376,7 @@ dependencies = [ "git2", "indicatif", "lazy_static", + "openssl", "petgraph", "regex", "serde", @@ -426,6 +427,21 @@ 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" @@ -879,12 +895,47 @@ version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" +[[package]] +name = "openssl" +version = "0.10.62" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cde4d2d9200ad5909f8dac647e29482e07c3a35de8a13fce7c9c7747ad9f671" +dependencies = [ + "bitflags 2.4.1", + "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", + "quote", + "syn", +] + [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-src" +version = "300.2.3+3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cff92b6f71555b61bb9315f7c64da3ca43d87531622120fea0195fc761b4843" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" version = "0.9.98" @@ -893,6 +944,7 @@ checksum = "c1665caf8ab2dc9aef43d1c0023bd904633a6a05cb30b0ad59bec2ae986e57a7" dependencies = [ "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] diff --git a/Cargo.toml b/Cargo.toml index 3f78e37..ad68ddd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cupido" -version = "0.3.0" +version = "0.3.1" edition = "2021" description = "Explore your codebase with graph view." license = "Apache-2.0" @@ -19,6 +19,8 @@ tracing-subscriber = "0.3" regex = "1.10.2" clap = { version = "4.4.18", features = ["derive"] } indicatif = "0.17.8" +# for cross: https://github.com/cross-rs/cross/wiki/FAQ#openssl-is-not-installed +openssl = { version = "0.10", features = ["vendored"] } [dev-dependencies] criterion = { version = "0.5.1", features = ["html_reports"] }