Skip to content

Commit 62da110

Browse files
committed
fix: conflict
2 parents 13c769e + 29569ec commit 62da110

File tree

18 files changed

+665
-397
lines changed

18 files changed

+665
-397
lines changed

.github/workflows/Release.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,22 @@ jobs:
3131
target: ${{ matrix.target }}
3232
override: true
3333

34-
- name: Install MUSL toolchain (Ubuntu)
35-
if: matrix.target == 'x86_64-unknown-linux-musl' && startsWith(matrix.os, 'ubuntu')
36-
run: sudo apt-get update && sudo apt-get install -y musl-tools
34+
- name: Install system dependencies (Ubuntu)
35+
if: startsWith(matrix.os, 'ubuntu') && matrix.target != 'x86_64-unknown-linux-musl'
36+
run: sudo apt-get update && sudo apt-get install -y liburing-dev pkg-config libclang-dev
3737

38-
- name: Configure MUSL environment
38+
- name: Install cross for MUSL builds
3939
if: matrix.target == 'x86_64-unknown-linux-musl'
4040
run: |
41-
echo "CC_x86_64_unknown_linux_musl=musl-gcc" >> $GITHUB_ENV
42-
echo "AR_x86_64_unknown_linux_musl=ar" >> $GITHUB_ENV
43-
echo "CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc" >> $GITHUB_ENV
41+
cargo install cross --git https://github.com/cross-rs/cross
4442
4543
- name: Build binary
46-
run: cargo build --profile maxperf --features jemalloc,asm-keccak --target ${{ matrix.target }}
44+
run: |
45+
if [ "${{ matrix.target }}" = "x86_64-unknown-linux-musl" ]; then
46+
cross build --profile maxperf --features jemalloc,asm-keccak --target ${{ matrix.target }}
47+
else
48+
cargo build --profile maxperf --features jemalloc,asm-keccak --target ${{ matrix.target }}
49+
fi
4750
env:
4851
RUSTFLAGS: ${{ matrix.target == 'x86_64-unknown-linux-gnu' && '-C strip=symbols -C target-cpu=native' || matrix.target == 'x86_64-unknown-linux-musl' && '-C strip=symbols -C target-feature=+crt-static -C default-linker-libraries -Clink-arg=-static-libgcc' || '-C strip=symbols' }}
4952

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Build and Publish Docker Image
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
env:
10+
REGISTRY: ghcr.io
11+
IMAGE_NAME: ${{ github.repository }}
12+
13+
jobs:
14+
build-amd64:
15+
runs-on: ubuntu-latest # x86_64 runner
16+
permissions:
17+
contents: read
18+
packages: write
19+
outputs:
20+
digest: ${{ steps.build.outputs.digest }}
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- uses: docker/setup-buildx-action@v3
25+
26+
- uses: docker/login-action@v3
27+
with:
28+
registry: ${{ env.REGISTRY }}
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Build and push (AMD64)
33+
id: build
34+
uses: docker/build-push-action@v5
35+
with:
36+
context: .
37+
platforms: linux/amd64
38+
push: true
39+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-amd64
40+
cache-from: type=gha,scope=amd64
41+
cache-to: type=gha,mode=max,scope=amd64
42+
provenance: false
43+
44+
build-arm64:
45+
runs-on: ubuntu-24.04-arm
46+
permissions:
47+
contents: read
48+
packages: write
49+
outputs:
50+
digest: ${{ steps.build.outputs.digest }}
51+
steps:
52+
- uses: actions/checkout@v4
53+
54+
- uses: docker/setup-buildx-action@v3
55+
56+
- uses: docker/login-action@v3
57+
with:
58+
registry: ${{ env.REGISTRY }}
59+
username: ${{ github.actor }}
60+
password: ${{ secrets.GITHUB_TOKEN }}
61+
62+
- name: Build and push (ARM64)
63+
id: build
64+
uses: docker/build-push-action@v5
65+
with:
66+
context: .
67+
platforms: linux/arm64
68+
push: true
69+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-arm64
70+
cache-from: type=gha,scope=arm64
71+
cache-to: type=gha,mode=max,scope=arm64
72+
provenance: false
73+
74+
merge-manifests:
75+
needs: [build-amd64, build-arm64]
76+
runs-on: ubuntu-latest
77+
permissions:
78+
packages: write
79+
steps:
80+
- uses: docker/login-action@v3
81+
with:
82+
registry: ${{ env.REGISTRY }}
83+
username: ${{ github.actor }}
84+
password: ${{ secrets.GITHUB_TOKEN }}
85+
86+
- name: Create multi-arch manifest
87+
run: |
88+
docker manifest create ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }} \
89+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-amd64 \
90+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-arm64
91+
92+
docker manifest push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
93+
94+
if [[ "${{ github.ref_name }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
95+
docker manifest create ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \
96+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-amd64 \
97+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-arm64
98+
docker manifest push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
99+
fi

0 commit comments

Comments
 (0)