Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ad406a6

Browse files
authored
build sqld debug (tursodatabase#1506)
ship debug images
1 parent 30623f9 commit ad406a6

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed

.github/workflows/publish-server.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,69 @@ jobs:
7373
if-no-files-found: error
7474
retention-days: 1
7575

76+
build-amd64-debug:
77+
permissions: write-all
78+
runs-on: ubuntu-latest
79+
env:
80+
platform: "linux/amd64"
81+
steps:
82+
-
83+
name: Prepare
84+
run: |
85+
platform=${{ env.platform }}
86+
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
87+
-
88+
name: Checkout
89+
uses: actions/checkout@v4
90+
-
91+
name: Docker meta
92+
id: meta
93+
uses: docker/metadata-action@v5
94+
with:
95+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-debug
96+
tags: |
97+
type=match,pattern=libsql-server-(.*),group=1
98+
type=raw,value=debug
99+
type=sha,prefix=,format=short
100+
-
101+
name: Set up QEMU
102+
uses: docker/setup-qemu-action@v3
103+
-
104+
name: Set up Docker Buildx
105+
uses: docker/setup-buildx-action@v3
106+
-
107+
name: Login to Docker Hub
108+
uses: docker/login-action@v3
109+
with:
110+
registry: ${{ env.REGISTRY }}
111+
username: ${{ github.actor }}
112+
password: ${{ secrets.GITHUB_TOKEN }}
113+
-
114+
name: Build and push by digest
115+
id: build
116+
uses: docker/build-push-action@v5
117+
with:
118+
context: .
119+
platforms: ${{ env.platform }}
120+
labels: ${{ steps.meta.outputs.labels }}
121+
outputs: type=image,name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
122+
build-args: |
123+
BUILD_DEBUG=true
124+
-
125+
name: Export digest
126+
run: |
127+
mkdir -p /tmp/digests
128+
digest="${{ steps.build.outputs.digest }}"
129+
touch "/tmp/digests/${digest#sha256:}"
130+
-
131+
name: Upload digest
132+
uses: actions/upload-artifact@v4
133+
with:
134+
name: digests-debug-${{ env.PLATFORM_PAIR }}
135+
path: /tmp/digests/*
136+
if-no-files-found: error
137+
retention-days: 1
138+
76139
build-arm64:
77140
permissions: write-all
78141
runs-on: buildjet-8vcpu-ubuntu-2204-arm

.github/workflows/server-pr-images.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ jobs:
7979
cache-from: type=gha
8080
cache-to: type=gha,mode=max
8181
build-args: |
82+
BUILD_DEBUG=true
8283
ENABLE_FEATURES=durable-wal
8384
8485
- name: Echo image name

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,15 @@ RUN cat rust-toolchain.toml | grep "channel" | awk '{print $3}' | sed 's/\"//g'
1818
&& cargo install cargo-chef
1919

2020
FROM chef AS planner
21+
ARG BUILD_DEBUG=false
22+
ENV CARGO_PROFILE_RELEASE_DEBUG=$BUILD_DEBUG
23+
RUN echo $CARGO_PROFILE_RELEASE_DEBUG
2124
COPY . .
2225
RUN cargo chef prepare --recipe-path recipe.json
2326

2427
FROM chef AS builder
28+
ARG BUILD_DEBUG=false
29+
ENV CARGO_PROFILE_RELEASE_DEBUG=$BUILD_DEBUG
2530
COPY --from=planner /recipe.json recipe.json
2631
RUN cargo chef cook --release --recipe-path recipe.json
2732
COPY . .

0 commit comments

Comments
 (0)