maybe fix weird matrix issue? #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Multi-Architecture | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| dist: | |
| name: Dist | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build: | |
| - x86_64-linux | |
| - aarch64-linux | |
| - riscv64-linux | |
| - ppc64le-linux | |
| include: | |
| - arch: x86_64 | |
| - arch: aarch64 | |
| - arch: riscv64 | |
| - arch: ppc64le | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Dist (Native x86_64) | |
| if: matrix.arch == 'x86_64' | |
| run: | | |
| sudo apt-get update -q -y | |
| sudo apt-get install -q -y \ | |
| build-essential \ | |
| gcc-14 g++-14 \ | |
| cmake ninja-build meson pkg-config fuse3 git | |
| export CC=gcc-14 | |
| export CXX=g++-14 | |
| echo "Building fusequota for ${{ matrix.arch }}" | |
| make all | |
| - name: Dist (Emulated ${{ matrix.arch }}) | |
| if: matrix.arch != 'x86_64' | |
| uses: uraimo/run-on-arch-action@v3 | |
| with: | |
| arch: ${{ matrix.arch }} | |
| distro: ubuntu24.04 | |
| githubToken: ${{ github.token }} | |
| install: | | |
| apt-get update -q -y | |
| apt-get install -q -y \ | |
| build-essential \ | |
| gcc-14 g++-14 \ | |
| cmake ninja-build meson pkg-config fuse3 git | |
| run: | | |
| export CC=gcc-14 | |
| export CXX=g++-14 | |
| echo "Building fusequota for ${{ matrix.arch }}" | |
| make all | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: fusequota-${{ matrix.arch }}-linux | |
| path: build/fusequota | |
| publish: | |
| name: Publish | |
| needs: [dist] | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: binaries | |
| - name: Get tag or commit id | |
| id: get-version-id | |
| uses: iawia002/get-tag-or-commit-id@v1 | |
| - name: Rename binaries | |
| run: | | |
| mkdir -p release | |
| find binaries/ -type f -name "fusequota" | while read -r file; do | |
| ARCH_NAME=$(basename $(dirname "$file")) | |
| cp "$file" "release/$ARCH_NAME" | |
| done | |
| chmod +x release/* | |
| - name: Create Release | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| file: release/* | |
| file_glob: true | |
| tag: ${{ steps.get-version-id.outputs.id }} | |
| overwrite: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |