upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2025-05-27 13:12:39 +0100
committerDanConwayDev <DanConwayDev@protonmail.com>2025-05-27 13:12:39 +0100
commitb98d2819288f86dd5b316c726cda0f84a1f63eb5 (patch)
treea55e12ab80e090dcb850c1f2199186a6b09cbb98
parent557d9295e3fc6145073459da94905765de53be1e (diff)
build: make less, more resilient builds
and cross compile where possible
-rw-r--r--.github/workflows/release.yml70
1 files changed, 47 insertions, 23 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 07820b2..2a5303a 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -19,37 +19,61 @@ jobs:
19 token: ${{ secrets.GITHUB_TOKEN }} 19 token: ${{ secrets.GITHUB_TOKEN }}
20 20
21 upload-assets: 21 upload-assets:
22 needs: create-release
22 strategy: 23 strategy:
23 matrix: 24 matrix:
24 os: 25 include:
25 - ubuntu-latest 26 # NOTE: compatibility according to LLM model o3
26 - ubuntu-24.04 27 # ---------- everything we can build on Linux ----------
27 - ubuntu-22.04 28 # x86_64
28 - ubuntu-24.04-arm 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 - ubuntu-22.04-arm 30 - os: ubuntu-latest
30 - macos-latest 31 target: x86_64-unknown-linux-gnu.2.17 # glibc ≥ 2.17
31 - macos-15 32 build-tool: cargo-zigbuild
32 - macos-14 33 # aarch64
33 - macos-13 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 - windows-latest 35 - os: ubuntu-latest
35 - windows-2022 36 target: aarch64-unknown-linux-gnu.2.17
36 - windows-2019 37 build-tool: cargo-zigbuild
38 # musl (Alpine etc.)
39 # compatibility: Alpine 3.12+, Distroless and scratch containers, and very old glibc systems. Fully static; no external libraries. Still needs a CA-certificate bundle (apk add ca-certificates on Alpine).
40 - os: ubuntu-latest
41 target: x86_64-unknown-linux-musl
42 build-tool: cargo-zigbuild
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.
45 - os: ubuntu-latest
46 target: x86_64-pc-windows-msvc
47 build-tool: cargo-zigbuild
48 # ---------- macOS (needs real mac runner) -------------
49 # compatibility: macOS 10.13 High Sierra (2017) or newer. Intel + Apple Silicon.
50 - os: macos-14
51 target: universal-apple-darwin # universal = x86_64 + arm64
52 build-tool: cargo # native cargo is fastest
53 # ---------- native Windows toolchain ------------------
54 # switch to this if issues are reported with the zig build
55 # - os: windows-latest
56 # target: x86_64-pc-windows-msvc
57 # build-tool: cargo
37 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
38 steps: 66 steps:
39 - uses: actions/checkout@v3 67 - uses: actions/checkout@v3
68 # (optional) cache build artefacts; speeds up repeated releases
69 - uses: Swatinem/rust-cache@v2
40 - uses: taiki-e/upload-rust-binary-action@v1 70 - uses: taiki-e/upload-rust-binary-action@v1
41 with: 71 with:
42 # (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload.
43 # Note that glob pattern is not supported yet.
44 bin: ngit,git-remote-nostr 72 bin: ngit,git-remote-nostr
45 archive: ngit-$tag-${{ matrix.os }} 73 target: ${{ matrix.target }}
46 # (optional) On which platform to distribute the `.tar.gz` file. 74 build-tool: ${{ matrix.build-tool }}
47 # [default value: unix] 75 # final file name: ngit-v1.6.3-x86_64-unknown-linux-gnu.tar.gz …
48 # [possible values: all, unix, windows, none] 76 archive: ngit-$tag-${{ matrix.target }}
49 tar: unix 77 tar: unix
50 # (optional) On which platform to distribute the `.zip` file.
51 # [default value: windows]
52 # [possible values: all, unix, windows, none]
53 zip: windows 78 zip: windows
54 # (required) GitHub token for uploading assets to GitHub Releases.
55 token: ${{ secrets.GITHUB_TOKEN }} 79 token: ${{ secrets.GITHUB_TOKEN }}