Skip to content

Commit fd084f1

Browse files
committed
upload files
0 parents  commit fd084f1

89 files changed

Lines changed: 16095 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: ["calagopus"]
2+
ko_fi: "rjansen"
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Bug Report
2+
description: Report a bug or unexpected behavior in db-agent
3+
labels: ["bug"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Before submitting, please search existing issues to avoid duplicates.
9+
For security vulnerabilities, follow the process in [SECURITY.md](../../SECURITY.md) instead.
10+
For panel related bugs, create an issue in [calagopus/panel](https://github.com/calagopus/panel/issues) instead.
11+
12+
- type: input
13+
id: version
14+
attributes:
15+
label: Version
16+
description: What version of db-agent are you running?
17+
placeholder: "e.g. 1.0.0"
18+
validations:
19+
required: true
20+
21+
- type: dropdown
22+
id: backend
23+
attributes:
24+
label: Backend
25+
description: Which backend were you proxying to?
26+
options:
27+
- PostgreSQL
28+
- MariaDB/MySQL
29+
- Redis
30+
- Other / N/A
31+
validations:
32+
required: true
33+
34+
- type: textarea
35+
id: description
36+
attributes:
37+
label: What happened?
38+
description: A clear and concise description of the bug.
39+
validations:
40+
required: true
41+
42+
- type: textarea
43+
id: expected
44+
attributes:
45+
label: What should happen?
46+
description: What did you expect to happen?
47+
validations:
48+
required: true
49+
50+
- type: textarea
51+
id: steps
52+
attributes:
53+
label: Steps to reproduce
54+
validations:
55+
required: true
56+
57+
- type: textarea
58+
id: logs
59+
attributes:
60+
label: Relevant logs
61+
description: Paste any relevant log output. This will be automatically formatted as code.
62+
render: shell
63+
64+
- type: textarea
65+
id: environment
66+
attributes:
67+
label: Environment
68+
description: Any additional environment details (OS, client/driver, panel version, etc.)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Feature Request
2+
description: Suggest a new feature or improvement for db-agent
3+
labels: ["feature"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Before submitting, please search existing issues to see if this has already been suggested.
9+
For panel related bugs, create an issue in [calagopus/panel](https://github.com/calagopus/panel/issues) instead.
10+
11+
- type: textarea
12+
id: problem
13+
attributes:
14+
label: What problem does this solve?
15+
description: A clear description of the problem or limitation you're facing.
16+
validations:
17+
required: true
18+
19+
- type: textarea
20+
id: solution
21+
attributes:
22+
label: Describe the solution you'd like
23+
description: A clear description of the feature or change you want.
24+
validations:
25+
required: true
26+
27+
- type: textarea
28+
id: alternatives
29+
attributes:
30+
label: Alternatives considered
31+
description: Any alternative solutions or workarounds you've considered.
32+
33+
- type: textarea
34+
id: context
35+
attributes:
36+
label: Additional context
37+
description: Any other context, mockups, or screenshots about the feature request.

.github/workflows/build.yml

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
name: Release Nightly
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
env:
9+
BIN_NAME: db-agent
10+
PROJECT_NAME: db-agent
11+
12+
jobs:
13+
dist:
14+
name: Dist
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
build:
20+
- x86_64-linux
21+
- aarch64-linux
22+
- riscv64-linux
23+
- ppc64le-linux
24+
include:
25+
- build: x86_64-linux
26+
os: ubuntu-24.04
27+
target: x86_64-unknown-linux-musl
28+
- build: aarch64-linux
29+
os: ubuntu-24.04
30+
target: aarch64-unknown-linux-musl
31+
- build: riscv64-linux
32+
os: ubuntu-24.04
33+
target: riscv64gc-unknown-linux-gnu
34+
- build: ppc64le-linux
35+
os: ubuntu-24.04
36+
target: powerpc64le-unknown-linux-gnu
37+
38+
steps:
39+
- name: Checkout sources
40+
uses: actions/checkout@v6
41+
42+
- name: Install Rust toolchain
43+
uses: actions-rust-lang/setup-rust-toolchain@v1
44+
with:
45+
toolchain: stable
46+
target: ${{ matrix.target }}
47+
cache-key: ${{ matrix.target }}
48+
49+
- name: Install cross
50+
run: cargo install cross --git https://github.com/cross-rs/cross
51+
52+
- name: Run cargo test
53+
run: cross test --release --target ${{ matrix.target }}
54+
55+
- name: Build release binary
56+
run: |
57+
RUSTFLAGS="-C target-feature=+crt-static" \
58+
cross build --release --target ${{ matrix.target }}
59+
60+
- name: Prepare binary with platform name
61+
run: |
62+
mkdir -p dist
63+
cp "target/${{ matrix.target }}/release/$BIN_NAME" "dist/$BIN_NAME-${{ matrix.build }}"
64+
65+
- name: Upload binary artifact
66+
uses: actions/upload-artifact@v7
67+
with:
68+
name: ${{ env.PROJECT_NAME }}-${{ matrix.build }}
69+
path: dist/${{ env.BIN_NAME }}-${{ matrix.build }}
70+
71+
create-multiarch-image:
72+
name: Create multi-arch Docker image
73+
needs: [dist]
74+
runs-on: ubuntu-24.04
75+
permissions:
76+
contents: read
77+
packages: write
78+
id-token: write
79+
attestations: write
80+
81+
steps:
82+
- name: Checkout code
83+
uses: actions/checkout@v6
84+
85+
- name: Generate source SBOM
86+
uses: anchore/sbom-action@v0
87+
with:
88+
path: .
89+
format: cyclonedx-json
90+
output-file: sbom-source.cyclonedx.json
91+
upload-artifact: false
92+
93+
- name: Download all artifacts
94+
uses: actions/download-artifact@v8
95+
with:
96+
path: dist
97+
98+
- name: Set up QEMU
99+
uses: docker/setup-qemu-action@v4
100+
101+
- name: Set up Docker Buildx
102+
uses: docker/setup-buildx-action@v4
103+
104+
- name: Login to GitHub Container Registry
105+
uses: docker/login-action@v4
106+
with:
107+
registry: ghcr.io
108+
username: ${{ github.actor }}
109+
password: ${{ secrets.GITHUB_TOKEN }}
110+
111+
- name: Prepare binaries
112+
run: |
113+
mkdir -p .docker/amd64 .docker/arm64 .docker/riscv64 .docker/ppc64le
114+
cp dist/${{ env.PROJECT_NAME }}-x86_64-linux/${{ env.BIN_NAME }}-x86_64-linux .docker/amd64/calagopus-db-agent
115+
cp dist/${{ env.PROJECT_NAME }}-aarch64-linux/${{ env.BIN_NAME }}-aarch64-linux .docker/arm64/calagopus-db-agent
116+
cp dist/${{ env.PROJECT_NAME }}-riscv64-linux/${{ env.BIN_NAME }}-riscv64-linux .docker/riscv64/calagopus-db-agent
117+
cp dist/${{ env.PROJECT_NAME }}-ppc64le-linux/${{ env.BIN_NAME }}-ppc64le-linux .docker/ppc64le/calagopus-db-agent
118+
119+
chmod +x .docker/*/calagopus-db-agent
120+
121+
- name: Extract version
122+
id: version
123+
run: echo "val=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[0].version')" >> $GITHUB_OUTPUT
124+
125+
- name: Build & push multi-arch image (main)
126+
id: build
127+
uses: docker/build-push-action@v7
128+
with:
129+
context: .
130+
platforms: linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le
131+
push: true
132+
tags: ghcr.io/${{ github.repository }}:nightly
133+
sbom: true
134+
provenance: true
135+
cache-from: type=gha
136+
cache-to: type=gha,mode=max
137+
138+
- name: Attach source SBOM attestation to image
139+
uses: actions/attest-sbom@v4
140+
with:
141+
subject-name: ghcr.io/${{ github.repository }}
142+
subject-digest: ${{ steps.build.outputs.digest }}
143+
sbom-path: sbom-source.cyclonedx.json
144+
push-to-registry: true

0 commit comments

Comments
 (0)