|
| 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 }} |
0 commit comments