Skip to content

Build juicefs

Build juicefs #6

Workflow file for this run

name: Build juicefs
on:
- workflow_dispatch
jobs:
sdist:
name: sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: git submodule update --init -- juicefs/juicefs
- uses: astral-sh/setup-uv@v6
- run: uv build --sdist
working-directory: ./juicefs
- run: ls juicefs/dist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: juicefs/dist
build:
name: build-${{ matrix.os }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: nu {0}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
post-command: uvx wheel tags --remove --platform-tag manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_2_x86_64 dist/*.whl
cc: musl-gcc
- os: ubuntu-24.04-arm
post-command: uvx wheel tags --remove --platform-tag manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_2_aarch64 dist/*.whl
cc: musl-gcc
- os: macos-latest
post-command: uvx wheel tags --remove --platform-tag macosx_11_0_arm64 dist/*.whl
- os: windows-latest
post-command: uvx wheel tags --remove --platform-tag win_amd64 dist/*.whl
cc: gcc
cxx: g++
steps:
- uses: hustcer/setup-nu@v3
- uses: actions/checkout@v4
- run: git submodule update --init -- juicefs/juicefs
- uses: astral-sh/setup-uv@v6
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: actions/setup-go@v5
with:
go-version: "stable"
- name: Install musl
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install -y musl musl-dev musl-tools
- name: Copy WinFsp headers
if: runner.os == 'Windows'
run: |
mkdir ${{ github.workspace }}/include_
cp -r ./juicefs/juicefs/hack/winfsp_headers/* ${{ github.workspace }}/include_
- name: Build wheel non-Windows
if: runner.os != 'Windows'
run: |
uv build --wheel
working-directory: ./juicefs
env:
CC: ${{ matrix.cc }}
CGO_ENABLED: "1"
- name: Build wheel Windows
if: runner.os == 'Windows'
run: |
uv build --wheel
working-directory: ./juicefs
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
CGO_ENABLED: "1"
CGO_CFLAGS: "-I${{ github.workspace }}/include_"
- name: Post Processing wheel
shell: bash
run: |
${{ matrix.post-command }}
working-directory: ./juicefs
- name: Test wheel
run: |
pip install --no-index -f juicefs/dist/ juicefs-bin
juicefs --version
do -i { objdump -T (which juicefs | get path.0) }
juicefs format sqlite3://myjfs.db myjfs
- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.os }}-${{ github.run_attempt }}
path: juicefs/dist
- run: ls juicefs/dist
publish:
name: publish
runs-on: ubuntu-latest
needs: [sdist, build]
environment: publish
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist
- run: ls -R dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist