From 596f94a3b3f6dcf6317e7312e596af90c7e76587 Mon Sep 17 00:00:00 2001 From: drbh Date: Mon, 15 Dec 2025 13:54:37 -0500 Subject: [PATCH] feat: prefer build and publish action --- .github/workflows/build-pr-mac.yaml | 27 ++++++++------------ .github/workflows/build-pr.yaml | 27 ++++++++------------ .github/workflows/build-release-mac.yaml | 25 +++++++------------ .github/workflows/build-release.yaml | 25 +++++++------------ .github/workflows/manual-build-upload.yaml | 29 +++++++--------------- 5 files changed, 47 insertions(+), 86 deletions(-) diff --git a/.github/workflows/build-pr-mac.yaml b/.github/workflows/build-pr-mac.yaml index 27d3f298..72b21aa5 100644 --- a/.github/workflows/build-pr-mac.yaml +++ b/.github/workflows/build-pr-mac.yaml @@ -11,20 +11,7 @@ jobs: build-kernel: runs-on: macos-15 steps: - - uses: actions/checkout@v5 - - uses: DeterminateSystems/nix-installer-action@v20 - with: - extra-conf: | - max-jobs = 1 - cores = 3 - sandbox = relaxed - - name: Nix info - run: nix-shell -p nix-info --run "nix-info -m" - - uses: cachix/cachix-action@v16 - with: - name: huggingface - env: - USER: runner + - uses: actions/checkout@v4 - name: Validate kernel directory id: validate env: @@ -38,6 +25,12 @@ jobs: fi - name: Build kernel if: steps.validate.outputs.skip == 'false' - run: | - KERNEL="${{ steps.validate.outputs.kernel }}" - ( cd "$KERNEL" && nix build -L .#ci && ls -l result/ ) + uses: huggingface/publish-to-the-kernel-hub-action@main + with: + kernel-path: ${{ steps.validate.outputs.kernel }} + build-target: ci + nix-command: build + nix-max-jobs: '1' + nix-cores: '3' + sandbox-mode: relaxed + upload-artifact: 'false' diff --git a/.github/workflows/build-pr.yaml b/.github/workflows/build-pr.yaml index e7329d7e..aa874ada 100644 --- a/.github/workflows/build-pr.yaml +++ b/.github/workflows/build-pr.yaml @@ -12,20 +12,7 @@ jobs: runs-on: group: aws-highmemory-32-plus-nix steps: - - uses: actions/checkout@v5 - - uses: DeterminateSystems/nix-installer-action@main - with: - extra-conf: | - max-jobs = 2 - cores = 12 - sandbox-fallback = false - - name: Nix info - run: nix-shell -p nix-info --run "nix-info -m" - - uses: cachix/cachix-action@v16 - with: - name: huggingface - env: - USER: runner + - uses: actions/checkout@v4 - name: Validate kernel directory id: validate env: @@ -39,6 +26,12 @@ jobs: fi - name: Build kernel if: steps.validate.outputs.skip == 'false' - run: | - KERNEL="${{ steps.validate.outputs.kernel }}" - ( cd "$KERNEL" && nix build -L .#ci && ls -l result/ ) + uses: huggingface/publish-to-the-kernel-hub-action@main + with: + kernel-path: ${{ steps.validate.outputs.kernel }} + build-target: ci + nix-command: build + nix-max-jobs: '2' + nix-cores: '12' + sandbox-mode: fallback + upload-artifact: 'false' diff --git a/.github/workflows/build-release-mac.yaml b/.github/workflows/build-release-mac.yaml index 16513048..ca4cb865 100644 --- a/.github/workflows/build-release-mac.yaml +++ b/.github/workflows/build-release-mac.yaml @@ -13,19 +13,6 @@ jobs: runs-on: macos-15 steps: - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@v20 - with: - extra-conf: | - max-jobs = 1 - cores = 3 - sandbox = relaxed - - name: Nix info - run: nix-shell -p nix-info --run "nix-info -m" - - uses: cachix/cachix-action@v16 - with: - name: huggingface - env: - USER: runner - name: Validate kernel directory id: validate run: | @@ -38,8 +25,14 @@ jobs: fi - name: Build and upload kernel if: steps.validate.outputs.skip == 'false' + uses: huggingface/publish-to-the-kernel-hub-action@main + with: + kernel-path: ${{ steps.validate.outputs.kernel }} + build-target: build-and-upload + nix-command: run + nix-max-jobs: '1' + nix-cores: '3' + sandbox-mode: relaxed + upload-artifact: 'false' env: HF_TOKEN: ${{ secrets.HF_TOKEN }} - run: | - KERNEL="${{ steps.validate.outputs.kernel }}" - ( cd "$KERNEL" && nix run -L .#build-and-upload ) diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index f91e369e..1f66bd30 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -14,19 +14,6 @@ jobs: group: aws-highmemory-32-plus-nix steps: - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@main - with: - extra-conf: | - max-jobs = 2 - cores = 12 - sandbox-fallback = false - - name: Nix info - run: nix-shell -p nix-info --run "nix-info -m" - - uses: cachix/cachix-action@v16 - with: - name: huggingface - env: - USER: runner - name: Validate kernel directory id: validate run: | @@ -39,8 +26,14 @@ jobs: fi - name: Build and upload kernel if: steps.validate.outputs.skip == 'false' + uses: huggingface/publish-to-the-kernel-hub-action@main + with: + kernel-path: ${{ steps.validate.outputs.kernel }} + build-target: build-and-upload + nix-command: run + nix-max-jobs: '2' + nix-cores: '12' + sandbox-mode: fallback + upload-artifact: 'false' env: HF_TOKEN: ${{ secrets.HF_TOKEN }} - run: | - KERNEL="${{ steps.validate.outputs.kernel }}" - ( cd "$KERNEL" && nix run -L .#build-and-upload ) diff --git a/.github/workflows/manual-build-upload.yaml b/.github/workflows/manual-build-upload.yaml index 72e03a28..fd882c0c 100644 --- a/.github/workflows/manual-build-upload.yaml +++ b/.github/workflows/manual-build-upload.yaml @@ -42,22 +42,6 @@ jobs: ref: refs/pull/${{ inputs.pr_number }}/head fetch-depth: 0 - - uses: DeterminateSystems/nix-installer-action@main - with: - extra-conf: | - max-jobs = 2 - cores = 12 - sandbox-fallback = false - - - name: Nix info - run: nix-shell -p nix-info --run "nix-info -m" - - - uses: cachix/cachix-action@v16 - with: - name: huggingface - env: - USER: runner - - name: Validate kernel directory id: validate run: | @@ -71,10 +55,15 @@ jobs: fi - name: Build and copy kernel - run: | - set -eu - KERNEL="${{ steps.validate.outputs.kernel }}" - ( cd "$KERNEL" && nix run -L .#build-and-copy ) + uses: huggingface/publish-to-the-kernel-hub-action@main + with: + kernel-path: ${{ steps.validate.outputs.kernel }} + build-target: build-and-copy + nix-command: run + nix-max-jobs: '2' + nix-cores: '12' + sandbox-mode: fallback + upload-artifact: 'false' - name: Upload kernel env: