diff options
| -rw-r--r-- | .github/workflows/release.yml | 36 | ||||
| -rw-r--r-- | Cargo.lock | 10 | ||||
| -rw-r--r-- | Cargo.toml | 8 |
3 files changed, 34 insertions, 20 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2a5303a..c3060b6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml | |||
| @@ -28,7 +28,7 @@ jobs: | |||
| 28 | # x86_64 | 28 | # x86_64 |
| 29 | # compatibility: Ubuntu 14.04+, Debian 8+, RHEL/CentOS 7+, Fedora 21+, openSUSE, Arch, etc. Any x86-64 distro with glibc ≥ 2.17. (Not Alpine) | 29 | # compatibility: Ubuntu 14.04+, Debian 8+, RHEL/CentOS 7+, Fedora 21+, openSUSE, Arch, etc. Any x86-64 distro with glibc ≥ 2.17. (Not Alpine) |
| 30 | - os: ubuntu-latest | 30 | - os: ubuntu-latest |
| 31 | target: x86_64-unknown-linux-gnu.2.17 # glibc ≥ 2.17 | 31 | target: x86_64-unknown-linux-gnu.2.17 |
| 32 | build-tool: cargo-zigbuild | 32 | build-tool: cargo-zigbuild |
| 33 | # aarch64 | 33 | # aarch64 |
| 34 | # compatibility: Ubuntu 20.04+, Debian 11+, Amazon Linux 2, AWS Graviton, Raspberry Pi OS 64-bit, etc. Any aarch64/arm64 distro with glibc ≥ 2.17. | 34 | # compatibility: Ubuntu 20.04+, Debian 11+, Amazon Linux 2, AWS Graviton, Raspberry Pi OS 64-bit, etc. Any aarch64/arm64 distro with glibc ≥ 2.17. |
| @@ -40,37 +40,33 @@ jobs: | |||
| 40 | - os: ubuntu-latest | 40 | - os: ubuntu-latest |
| 41 | target: x86_64-unknown-linux-musl | 41 | target: x86_64-unknown-linux-musl |
| 42 | build-tool: cargo-zigbuild | 42 | build-tool: cargo-zigbuild |
| 43 | # windows - faster alternative to native windows toolchain | 43 | # # windows - faster alternative to native windows toolchain |
| 44 | # compatibility: Windows 7 SP1 / Server 2008 R2 and newer, including Windows 11. Requires the “Universal C Runtime” which is already present on Windows 10+ or via the VC++ 2015-2022 redistributable on older systems. No other DLLs needed. | 44 | # # compatibility: Windows 7 SP1 / Server 2008 R2 and newer, including Windows 11. Requires the “Universal C Runtime” which is already present on Windows 10+ or via the VC++ 2015-2022 redistributable on older systems. No other DLLs needed. |
| 45 | - os: ubuntu-latest | 45 | # - os: ubuntu-latest |
| 46 | target: x86_64-pc-windows-msvc | 46 | # target: x86_64-pc-windows-msvc |
| 47 | build-tool: cargo-zigbuild | 47 | # build-tool: cargo-zigbuild |
| 48 | # ---------- macOS (needs real mac runner) ------------- | 48 | # ---------- macOS (needs real mac runner) ------------- |
| 49 | # compatibility: macOS 10.13 High Sierra (2017) or newer. Intel + Apple Silicon. | 49 | # compatibility: macOS 10.13 High Sierra (2017) or newer. Intel + Apple Silicon. |
| 50 | - os: macos-14 | 50 | - os: macos-14 |
| 51 | target: universal-apple-darwin # universal = x86_64 + arm64 | 51 | target: universal-apple-darwin |
| 52 | build-tool: cargo # native cargo is fastest | 52 | build-tool: cargo |
| 53 | # ---------- native Windows toolchain ------------------ | 53 | # ---------- native Windows toolchain ------------------ |
| 54 | # switch to this if issues are reported with the zig build | 54 | # switch to this if issues are reported with the zig build |
| 55 | # - os: windows-latest | 55 | - os: windows-latest |
| 56 | # target: x86_64-pc-windows-msvc | 56 | target: x86_64-pc-windows-msvc |
| 57 | # build-tool: cargo | 57 | build-tool: cargo |
| 58 | runs-on: ${{ matrix.os }} | 58 | runs-on: ${{ matrix.os }} |
| 59 | env: | ||
| 60 | # make openssl + libgit2 static so the binaries work on old distros | ||
| 61 | OPENSSL_STATIC: 1 | ||
| 62 | # enable Rust LTO + stripping (you can also move this into Cargo.toml) | ||
| 63 | CARGO_PROFILE_RELEASE_LTO: true | ||
| 64 | CARGO_PROFILE_RELEASE_STRIP: symbols | ||
| 65 | |||
| 66 | steps: | 59 | steps: |
| 67 | - uses: actions/checkout@v3 | 60 | - uses: actions/checkout@v3 |
| 68 | # (optional) cache build artefacts; speeds up repeated releases | 61 | - uses: dtolnay/rust-toolchain@stable |
| 69 | - uses: Swatinem/rust-cache@v2 | 62 | - name: Install cargo-zigbuild using Homebrew for macOS |
| 63 | if: runner.os == 'macOS' && matrix.build-tool == 'cargo-zigbuild' | ||
| 64 | run: brew install cargo-zigbuild | ||
| 70 | - uses: taiki-e/upload-rust-binary-action@v1 | 65 | - uses: taiki-e/upload-rust-binary-action@v1 |
| 71 | with: | 66 | with: |
| 72 | bin: ngit,git-remote-nostr | 67 | bin: ngit,git-remote-nostr |
| 73 | target: ${{ matrix.target }} | 68 | target: ${{ matrix.target }} |
| 69 | features: vendored-openssl | ||
| 74 | build-tool: ${{ matrix.build-tool }} | 70 | build-tool: ${{ matrix.build-tool }} |
| 75 | # final file name: ngit-v1.6.3-x86_64-unknown-linux-gnu.tar.gz … | 71 | # final file name: ngit-v1.6.3-x86_64-unknown-linux-gnu.tar.gz … |
| 76 | archive: ngit-$tag-${{ matrix.target }} | 72 | archive: ngit-$tag-${{ matrix.target }} |
| @@ -1590,6 +1590,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
| 1590 | checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" | 1590 | checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" |
| 1591 | 1591 | ||
| 1592 | [[package]] | 1592 | [[package]] |
| 1593 | name = "openssl-src" | ||
| 1594 | version = "300.5.0+3.5.0" | ||
| 1595 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1596 | checksum = "e8ce546f549326b0e6052b649198487d91320875da901e7bd11a06d1ee3f9c2f" | ||
| 1597 | dependencies = [ | ||
| 1598 | "cc", | ||
| 1599 | ] | ||
| 1600 | |||
| 1601 | [[package]] | ||
| 1593 | name = "openssl-sys" | 1602 | name = "openssl-sys" |
| 1594 | version = "0.9.108" | 1603 | version = "0.9.108" |
| 1595 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1604 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -1597,6 +1606,7 @@ checksum = "e145e1651e858e820e4860f7b9c5e169bc1d8ce1c86043be79fa7b7634821847" | |||
| 1597 | dependencies = [ | 1606 | dependencies = [ |
| 1598 | "cc", | 1607 | "cc", |
| 1599 | "libc", | 1608 | "libc", |
| 1609 | "openssl-src", | ||
| 1600 | "pkg-config", | 1610 | "pkg-config", |
| 1601 | "vcpkg", | 1611 | "vcpkg", |
| 1602 | ] | 1612 | ] |
| @@ -55,6 +55,10 @@ members = [ | |||
| 55 | name = "ngit" | 55 | name = "ngit" |
| 56 | path = "src/lib/mod.rs" | 56 | path = "src/lib/mod.rs" |
| 57 | 57 | ||
| 58 | [features] | ||
| 59 | default = [] | ||
| 60 | vendored-openssl = ["git2/vendored-openssl"] | ||
| 61 | |||
| 58 | [[bin]] | 62 | [[bin]] |
| 59 | name = "ngit" | 63 | name = "ngit" |
| 60 | path = "src/bin/ngit/main.rs" | 64 | path = "src/bin/ngit/main.rs" |
| @@ -62,3 +66,7 @@ path = "src/bin/ngit/main.rs" | |||
| 62 | [[bin]] | 66 | [[bin]] |
| 63 | name = "git-remote-nostr" | 67 | name = "git-remote-nostr" |
| 64 | path = "src/bin/git_remote_nostr/main.rs" | 68 | path = "src/bin/git_remote_nostr/main.rs" |
| 69 | |||
| 70 | [profile.release] | ||
| 71 | lto = true | ||
| 72 | strip = "symbols" \ No newline at end of file | ||