mirror of
https://gitlab.com/famedly/conduit.git
synced 2025-01-14 13:36:27 +03:00
use nix-built binary to produce debian package
Currently just for `x86_64-unknown-linux-musl`. Theoretically, we can use this same mechanism for `aarch64-unknown-linux-musl`. Practically, I'm not sure just this will even work.
This commit is contained in:
parent
4e09c9e58a
commit
d5a9c6ac32
3 changed files with 16 additions and 27 deletions
|
@ -43,13 +43,18 @@ ci:
|
||||||
- target
|
- target
|
||||||
- .gitlab-ci.d
|
- .gitlab-ci.d
|
||||||
|
|
||||||
nix:artifacts:
|
artifacts:
|
||||||
stage: artifacts
|
stage: artifacts
|
||||||
image: nixos/nix:2.20.4
|
image: nixos/nix:2.20.4
|
||||||
script:
|
script:
|
||||||
- ./bin/nix-build-and-cache .#static-x86_64-unknown-linux-musl
|
- ./bin/nix-build-and-cache .#static-x86_64-unknown-linux-musl
|
||||||
- cp result/bin/conduit x86_64-unknown-linux-musl
|
- cp result/bin/conduit x86_64-unknown-linux-musl
|
||||||
|
|
||||||
|
- mkdir -p target/release
|
||||||
|
- cp result/bin/conduit target/release
|
||||||
|
- direnv exec . cargo deb --no-build
|
||||||
|
- mv target/debian/*.deb x86_64-unknown-linux-musl.deb
|
||||||
|
|
||||||
# Since the OCI image package is based on the binary package, this has the
|
# Since the OCI image package is based on the binary package, this has the
|
||||||
# fun side effect of uploading the normal binary too. Conduit users who are
|
# fun side effect of uploading the normal binary too. Conduit users who are
|
||||||
# deploying with Nix can leverage this fact by adding our binary cache to
|
# deploying with Nix can leverage this fact by adding our binary cache to
|
||||||
|
@ -70,29 +75,10 @@ nix:artifacts:
|
||||||
paths:
|
paths:
|
||||||
- x86_64-unknown-linux-musl
|
- x86_64-unknown-linux-musl
|
||||||
- aarch64-unknown-linux-musl
|
- aarch64-unknown-linux-musl
|
||||||
|
- x86_64-unknown-linux-musl.deb
|
||||||
- oci-image-amd64.tar.gz
|
- oci-image-amd64.tar.gz
|
||||||
- oci-image-arm64v8.tar.gz
|
- oci-image-arm64v8.tar.gz
|
||||||
|
|
||||||
debian:x86_64-unknown-linux-gnu:
|
|
||||||
stage: artifacts
|
|
||||||
# See also `rust-toolchain.toml`
|
|
||||||
image: rust:1.75.0
|
|
||||||
script:
|
|
||||||
- apt-get update && apt-get install -y --no-install-recommends libclang-dev
|
|
||||||
- cargo install cargo-deb
|
|
||||||
- cargo deb
|
|
||||||
|
|
||||||
# Make the output less difficult to find
|
|
||||||
- mv target/debian/*.deb conduit.deb
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- conduit.deb
|
|
||||||
cache:
|
|
||||||
key: debian
|
|
||||||
paths:
|
|
||||||
- target
|
|
||||||
- .gitlab-ci.d
|
|
||||||
|
|
||||||
.push-oci-image:
|
.push-oci-image:
|
||||||
stage: publish
|
stage: publish
|
||||||
image: docker:25.0.0
|
image: docker:25.0.0
|
||||||
|
@ -124,7 +110,7 @@ debian:x86_64-unknown-linux-gnu:
|
||||||
docker manifest push $IMAGE_NAME:latest
|
docker manifest push $IMAGE_NAME:latest
|
||||||
fi
|
fi
|
||||||
dependencies:
|
dependencies:
|
||||||
- nix:artifacts
|
- artifacts
|
||||||
only:
|
only:
|
||||||
- next
|
- next
|
||||||
- master
|
- master
|
||||||
|
|
10
DEPLOY.md
10
DEPLOY.md
|
@ -34,11 +34,11 @@ If you use a system with an older glibc version (e.g. RHEL8), you might need to
|
||||||
|
|
||||||
| Target | Type | Download |
|
| Target | Type | Download |
|
||||||
|-|-|-|
|
|-|-|-|
|
||||||
| `x86_64-unknown-linux-gnu` | Dynamically linked Debian package | [link](https://gitlab.com/api/v4/projects/famedly%2Fconduit/jobs/artifacts/next/raw/conduit.deb?job=debian:x86_64-unknown-linux-gnu) |
|
| `x86_64-unknown-linux-musl` | Statically linked Debian package | [link](https://gitlab.com/api/v4/projects/famedly%2Fconduit/jobs/artifacts/next/raw/x86_64-unknown-linux-musl.deb?job=artifacts) |
|
||||||
| `x86_64-unknown-linux-musl` | Statically linked binary | [link](https://gitlab.com/api/v4/projects/famedly%2Fconduit/jobs/artifacts/next/raw/x86_64-unknown-linux-musl?job=nix:artifacts) |
|
| `x86_64-unknown-linux-musl` | Statically linked binary | [link](https://gitlab.com/api/v4/projects/famedly%2Fconduit/jobs/artifacts/next/raw/x86_64-unknown-linux-musl?job=artifacts) |
|
||||||
| `aarch64-unknown-linux-musl` | Statically linked binary | [link](https://gitlab.com/api/v4/projects/famedly%2Fconduit/jobs/artifacts/next/raw/aarch64-unknown-linux-musl?job=nix:artifacts) |
|
| `aarch64-unknown-linux-musl` | Statically linked binary | [link](https://gitlab.com/api/v4/projects/famedly%2Fconduit/jobs/artifacts/next/raw/aarch64-unknown-linux-musl?job=artifacts) |
|
||||||
| `x86_64-unknown-linux-gnu` | OCI image | [link](https://gitlab.com/api/v4/projects/famedly%2Fconduit/jobs/artifacts/next/raw/oci-image-amd64.tar.gz?job=nix:artifacts) |
|
| `x86_64-unknown-linux-gnu` | OCI image | [link](https://gitlab.com/api/v4/projects/famedly%2Fconduit/jobs/artifacts/next/raw/oci-image-amd64.tar.gz?job=artifacts) |
|
||||||
| `aarch64-unknown-linux-musl` | OCI image | [link](https://gitlab.com/api/v4/projects/famedly%2Fconduit/jobs/artifacts/next/raw/oci-image-arm64v8.tar.gz?job=nix:artifacts) |
|
| `aarch64-unknown-linux-musl` | OCI image | [link](https://gitlab.com/api/v4/projects/famedly%2Fconduit/jobs/artifacts/next/raw/oci-image-arm64v8.tar.gz?job=artifacts) |
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ sudo wget -O /usr/local/bin/matrix-conduit <url>
|
$ sudo wget -O /usr/local/bin/matrix-conduit <url>
|
||||||
|
|
|
@ -252,6 +252,9 @@
|
||||||
] ++ (with pkgsHost; [
|
] ++ (with pkgsHost; [
|
||||||
engage
|
engage
|
||||||
|
|
||||||
|
# Needed for producing Debian packages
|
||||||
|
cargo-deb
|
||||||
|
|
||||||
# Needed for Complement
|
# Needed for Complement
|
||||||
go
|
go
|
||||||
olm
|
olm
|
||||||
|
|
Loading…
Reference in a new issue