Skip to content

Commit 27c236f

Browse files
committed
upload code
0 parents  commit 27c236f

21 files changed

Lines changed: 4239 additions & 0 deletions

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: ["calagopus", "0x7d8"]
2+
ko_fi: "rjansen"

.github/workflows/build.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Build Multi-Architecture
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
include:
15+
- arch: x86_64
16+
distro: ubuntu22.04
17+
artifact_name: fusequota-x86_64-linux
18+
- arch: aarch64
19+
distro: ubuntu22.04
20+
artifact_name: fusequota-aarch64-linux
21+
- arch: riscv64
22+
distro: ubuntu22.04
23+
artifact_name: fusequota-riscv64-linux
24+
- arch: ppc64le
25+
distro: ubuntu22.04
26+
artifact_name: fusequota-ppc64le-linux
27+
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v4
31+
with:
32+
submodules: recursive
33+
34+
- name: Build on ${{ matrix.arch }}
35+
uses: uraimo/run-on-arch-action@v2
36+
id: build
37+
with:
38+
arch: ${{ matrix.arch }}
39+
distro: ${{ matrix.distro }}
40+
41+
githubToken: ${{ github.token }}
42+
43+
install: |
44+
apt-get update -q -y
45+
apt-get install -q -y \
46+
build-essential \
47+
cmake \
48+
ninja-build \
49+
meson \
50+
pkg-config \
51+
libfuse3-dev \
52+
fuse3 \
53+
python3-pip \
54+
git
55+
56+
run: |
57+
echo "Building fusequota for ${{ matrix.arch }}"
58+
59+
# Build libfuse from external submodule
60+
echo "--- Building libfuse ---"
61+
if [ ! -d "external/libfuse/build" ]; then
62+
meson setup external/libfuse external/libfuse/build
63+
fi
64+
65+
make all
66+
67+
- name: Upload artifact
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: ${{ matrix.artifact_name }}
71+
path: ./fusequota/fusequota-binary
72+
if-no-files-found: error
73+
74+
create-release:
75+
needs: build
76+
runs-on: ubuntu-latest
77+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
78+
79+
steps:
80+
- name: Download all artifacts
81+
uses: actions/download-artifact@v4
82+
with:
83+
path: binaries
84+
85+
- name: Display structure of downloaded files
86+
run: ls -R binaries
87+
88+
- name: Rename binaries
89+
run: |
90+
mkdir -p release
91+
mv binaries/fusequota-x86_64-linux/fusequota-binary release/fusequota-x86_64-linux
92+
mv binaries/fusequota-aarch64-linux/fusequota-binary release/fusequota-aarch64-linux
93+
mv binaries/fusequota-riscv64-linux/fusequota-binary release/fusequota-riscv64-linux
94+
mv binaries/fusequota-ppc64le-linux/fusequota-binary release/fusequota-ppc64le-linux
95+
chmod +x release/*
96+
97+
- name: Create Release
98+
uses: softprops/action-gh-release@v1
99+
if: startsWith(github.ref, 'refs/tags/')
100+
with:
101+
files: release/*
102+
env:
103+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "external/libfuse"]
2+
path = external/libfuse
3+
url = https://github.com/libfuse/libfuse.git

CMakeLists.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
cmake_minimum_required(VERSION 3.10)
2+
project(fuse_quota_passthrough LANGUAGES CXX)
3+
4+
set(CMAKE_CXX_STANDARD 23)
5+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
6+
7+
set(LIBFUSE_DIR "${CMAKE_SOURCE_DIR}/external/libfuse/build")
8+
set(ENV{PKG_CONFIG_PATH} "${LIBFUSE_DIR}/meson-uninstalled:$ENV{PKG_CONFIG_PATH}")
9+
10+
find_package(PkgConfig REQUIRED)
11+
12+
pkg_check_modules(FUSE3 REQUIRED IMPORTED_TARGET fuse3)
13+
14+
add_executable(fusequota
15+
src/main.cpp
16+
src/operations.cpp
17+
src/quota.cpp
18+
src/socket_server.cpp
19+
)
20+
21+
target_link_libraries(fusequota PRIVATE PkgConfig::FUSE3)
22+
23+
find_package(Threads REQUIRED)
24+
target_link_libraries(fusequota PRIVATE Threads::Threads)

0 commit comments

Comments
 (0)