mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-07-02 21:54:37 +02:00
Compare commits
6 commits
e508b1197f
...
add5c7052c
Author | SHA1 | Date | |
---|---|---|---|
|
add5c7052c | ||
|
01200d9b54 | ||
|
0ba4a265be | ||
|
08fbcbba69 | ||
|
b526935d45 | ||
|
a737d845a4 |
4 changed files with 442 additions and 253 deletions
|
@ -49,6 +49,7 @@ jobs:
|
||||||
const platforms = ['linux/amd64', 'linux/arm64']
|
const platforms = ['linux/amd64', 'linux/arm64']
|
||||||
core.setOutput('build_matrix', JSON.stringify({
|
core.setOutput('build_matrix', JSON.stringify({
|
||||||
platform: platforms,
|
platform: platforms,
|
||||||
|
target_cpu: ['base'],
|
||||||
include: platforms.map(platform => { return {
|
include: platforms.map(platform => { return {
|
||||||
platform,
|
platform,
|
||||||
slug: platform.replace('/', '-')
|
slug: platform.replace('/', '-')
|
||||||
|
@ -66,6 +67,8 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
{
|
{
|
||||||
|
"target_cpu": ["base"],
|
||||||
|
"profile": ["release"],
|
||||||
"include":
|
"include":
|
||||||
[
|
[
|
||||||
{ "platform": "linux/amd64", "slug": "linux-amd64" },
|
{ "platform": "linux/amd64", "slug": "linux-amd64" },
|
||||||
|
@ -73,6 +76,7 @@ jobs:
|
||||||
],
|
],
|
||||||
"platform": ["linux/amd64", "linux/arm64"],
|
"platform": ["linux/amd64", "linux/arm64"],
|
||||||
}
|
}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Echo strategy
|
- name: Echo strategy
|
||||||
run: echo '${{ toJSON(fromJSON(needs.define-variables.outputs.build_matrix)) }}'
|
run: echo '${{ toJSON(fromJSON(needs.define-variables.outputs.build_matrix)) }}'
|
||||||
|
@ -140,8 +144,8 @@ jobs:
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
cargo-target-${{ matrix.slug }}
|
cargo-target-${{ matrix.target_cpu }}-${{ matrix.slug }}-${{ matrix.profile }}
|
||||||
key: cargo-target-${{ matrix.slug }}-${{hashFiles('**/Cargo.lock') }}-${{steps.rust-toolchain.outputs.rustc_version}}
|
key: cargo-target-${{ matrix.target_cpu }}-${{ matrix.slug }}-${{ matrix.profile }}-${{hashFiles('**/Cargo.lock') }}-${{steps.rust-toolchain.outputs.rustc_version}}
|
||||||
- name: Cache apt cache
|
- name: Cache apt cache
|
||||||
id: cache-apt
|
id: cache-apt
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -163,9 +167,9 @@ jobs:
|
||||||
{
|
{
|
||||||
".cargo/registry": "/usr/local/cargo/registry",
|
".cargo/registry": "/usr/local/cargo/registry",
|
||||||
".cargo/git/db": "/usr/local/cargo/git/db",
|
".cargo/git/db": "/usr/local/cargo/git/db",
|
||||||
"cargo-target-${{ matrix.slug }}": {
|
"cargo-target-${{ matrix.target_cpu }}-${{ matrix.slug }}-${{ matrix.profile }}": {
|
||||||
"target": "/app/target",
|
"target": "/app/target",
|
||||||
"id": "cargo-target-${{ matrix.platform }}"
|
"id": "cargo-target-${{ matrix.target_cpu }}-${{ matrix.slug }}-${{ matrix.profile }}"
|
||||||
},
|
},
|
||||||
"var-cache-apt-${{ matrix.slug }}": "/var/cache/apt",
|
"var-cache-apt-${{ matrix.slug }}": "/var/cache/apt",
|
||||||
"var-lib-apt-${{ matrix.slug }}": "/var/lib/apt"
|
"var-lib-apt-${{ matrix.slug }}": "/var/lib/apt"
|
||||||
|
|
647
Cargo.lock
generated
647
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -1,15 +1,16 @@
|
||||||
ARG RUST_VERSION=1
|
ARG RUST_VERSION=1
|
||||||
|
ARG DEBIAN_VERSION=bookworm
|
||||||
|
|
||||||
FROM --platform=$BUILDPLATFORM docker.io/tonistiigi/xx AS xx
|
FROM --platform=$BUILDPLATFORM docker.io/tonistiigi/xx AS xx
|
||||||
FROM --platform=$BUILDPLATFORM rust:${RUST_VERSION}-slim-bookworm AS base
|
FROM --platform=$BUILDPLATFORM rust:${RUST_VERSION}-slim-${DEBIAN_VERSION} AS base
|
||||||
FROM --platform=$BUILDPLATFORM rust:${RUST_VERSION}-slim-bookworm AS toolchain
|
FROM --platform=$BUILDPLATFORM rust:${RUST_VERSION}-slim-${DEBIAN_VERSION} AS toolchain
|
||||||
|
|
||||||
# Prevent deletion of apt cache
|
# Prevent deletion of apt cache
|
||||||
RUN rm -f /etc/apt/apt.conf.d/docker-clean
|
RUN rm -f /etc/apt/apt.conf.d/docker-clean
|
||||||
|
|
||||||
# Match Rustc version as close as possible
|
# Match Rustc version as close as possible
|
||||||
# rustc -vV
|
# rustc -vV
|
||||||
ARG LLVM_VERSION=19
|
ARG LLVM_VERSION=20
|
||||||
# ENV RUSTUP_TOOLCHAIN=${RUST_VERSION}
|
# ENV RUSTUP_TOOLCHAIN=${RUST_VERSION}
|
||||||
|
|
||||||
# Install repo tools
|
# Install repo tools
|
||||||
|
@ -19,10 +20,18 @@ ARG LLVM_VERSION=19
|
||||||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||||
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
||||||
apt-get update && apt-get install -y \
|
apt-get update && apt-get install -y \
|
||||||
clang-${LLVM_VERSION} lld-${LLVM_VERSION} pkg-config make jq \
|
pkg-config make jq \
|
||||||
curl git \
|
curl git software-properties-common \
|
||||||
file
|
file
|
||||||
|
|
||||||
|
# LLVM packages
|
||||||
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||||
|
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
||||||
|
curl https://apt.llvm.org/llvm.sh > llvm.sh && \
|
||||||
|
chmod +x llvm.sh && \
|
||||||
|
./llvm.sh ${LLVM_VERSION} && \
|
||||||
|
rm llvm.sh
|
||||||
|
|
||||||
# Create symlinks for LLVM tools
|
# Create symlinks for LLVM tools
|
||||||
RUN <<EOF
|
RUN <<EOF
|
||||||
set -o xtrace
|
set -o xtrace
|
||||||
|
@ -39,7 +48,7 @@ EOF
|
||||||
|
|
||||||
# Developer tool versions
|
# Developer tool versions
|
||||||
# renovate: datasource=github-releases depName=cargo-bins/cargo-binstall
|
# renovate: datasource=github-releases depName=cargo-bins/cargo-binstall
|
||||||
ENV BINSTALL_VERSION=1.12.3
|
ENV BINSTALL_VERSION=1.13.0
|
||||||
# renovate: datasource=github-releases depName=psastras/sbom-rs
|
# renovate: datasource=github-releases depName=psastras/sbom-rs
|
||||||
ENV CARGO_SBOM_VERSION=0.9.1
|
ENV CARGO_SBOM_VERSION=0.9.1
|
||||||
# renovate: datasource=crate depName=lddtree
|
# renovate: datasource=crate depName=lddtree
|
||||||
|
@ -140,11 +149,12 @@ ENV GIT_REMOTE_COMMIT_URL=$GIT_REMOTE_COMMIT_URL
|
||||||
ENV CONDUWUIT_VERSION_EXTRA=$CONDUWUIT_VERSION_EXTRA
|
ENV CONDUWUIT_VERSION_EXTRA=$CONDUWUIT_VERSION_EXTRA
|
||||||
ENV CONTINUWUITY_VERSION_EXTRA=$CONTINUWUITY_VERSION_EXTRA
|
ENV CONTINUWUITY_VERSION_EXTRA=$CONTINUWUITY_VERSION_EXTRA
|
||||||
|
|
||||||
|
ARG RUST_PROFILE=release
|
||||||
|
|
||||||
# Build the binary
|
# Build the binary
|
||||||
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
||||||
--mount=type=cache,target=/usr/local/cargo/git/db \
|
--mount=type=cache,target=/usr/local/cargo/git/db \
|
||||||
--mount=type=cache,target=/app/target,id=cargo-target-${TARGETPLATFORM} \
|
--mount=type=cache,target=/app/target,id=cargo-target-${TARGET_CPU}-${TARGETPLATFORM}-${RUST_PROFILE} \
|
||||||
bash <<'EOF'
|
bash <<'EOF'
|
||||||
set -o allexport
|
set -o allexport
|
||||||
set -o xtrace
|
set -o xtrace
|
||||||
|
@ -153,7 +163,7 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
||||||
jq -r ".target_directory"))
|
jq -r ".target_directory"))
|
||||||
mkdir /out/sbin
|
mkdir /out/sbin
|
||||||
PACKAGE=conduwuit
|
PACKAGE=conduwuit
|
||||||
xx-cargo build --locked --release \
|
xx-cargo build --locked --profile ${RUST_PROFILE} \
|
||||||
-p $PACKAGE;
|
-p $PACKAGE;
|
||||||
BINARIES=($(cargo metadata --no-deps --format-version 1 | \
|
BINARIES=($(cargo metadata --no-deps --format-version 1 | \
|
||||||
jq -r ".packages[] | select(.name == \"$PACKAGE\") | .targets[] | select( .kind | map(. == \"bin\") | any ) | .name"))
|
jq -r ".packages[] | select(.name == \"$PACKAGE\") | .targets[] | select( .kind | map(. == \"bin\") | any ) | .name"))
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
# If you're having trouble making the relevant changes, bug a maintainer.
|
# If you're having trouble making the relevant changes, bug a maintainer.
|
||||||
|
|
||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "1.86.0"
|
channel = "1.87.0"
|
||||||
profile = "minimal"
|
profile = "minimal"
|
||||||
components = [
|
components = [
|
||||||
# For rust-analyzer
|
# For rust-analyzer
|
||||||
|
@ -19,11 +19,3 @@ components = [
|
||||||
"rustfmt",
|
"rustfmt",
|
||||||
"clippy",
|
"clippy",
|
||||||
]
|
]
|
||||||
targets = [
|
|
||||||
#"x86_64-apple-darwin",
|
|
||||||
"x86_64-unknown-linux-gnu",
|
|
||||||
"x86_64-unknown-linux-musl",
|
|
||||||
"aarch64-unknown-linux-musl",
|
|
||||||
"aarch64-unknown-linux-gnu",
|
|
||||||
#"aarch64-apple-darwin",
|
|
||||||
]
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue