Skip to content

Commit 596f94a

Browse files
committed
feat: prefer build and publish action
1 parent 04a14c8 commit 596f94a

5 files changed

Lines changed: 47 additions & 86 deletions

File tree

.github/workflows/build-pr-mac.yaml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,7 @@ jobs:
1111
build-kernel:
1212
runs-on: macos-15
1313
steps:
14-
- uses: actions/checkout@v5
15-
- uses: DeterminateSystems/nix-installer-action@v20
16-
with:
17-
extra-conf: |
18-
max-jobs = 1
19-
cores = 3
20-
sandbox = relaxed
21-
- name: Nix info
22-
run: nix-shell -p nix-info --run "nix-info -m"
23-
- uses: cachix/cachix-action@v16
24-
with:
25-
name: huggingface
26-
env:
27-
USER: runner
14+
- uses: actions/checkout@v4
2815
- name: Validate kernel directory
2916
id: validate
3017
env:
@@ -38,6 +25,12 @@ jobs:
3825
fi
3926
- name: Build kernel
4027
if: steps.validate.outputs.skip == 'false'
41-
run: |
42-
KERNEL="${{ steps.validate.outputs.kernel }}"
43-
( cd "$KERNEL" && nix build -L .#ci && ls -l result/ )
28+
uses: huggingface/publish-to-the-kernel-hub-action@main
29+
with:
30+
kernel-path: ${{ steps.validate.outputs.kernel }}
31+
build-target: ci
32+
nix-command: build
33+
nix-max-jobs: '1'
34+
nix-cores: '3'
35+
sandbox-mode: relaxed
36+
upload-artifact: 'false'

.github/workflows/build-pr.yaml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,7 @@ jobs:
1212
runs-on:
1313
group: aws-highmemory-32-plus-nix
1414
steps:
15-
- uses: actions/checkout@v5
16-
- uses: DeterminateSystems/nix-installer-action@main
17-
with:
18-
extra-conf: |
19-
max-jobs = 2
20-
cores = 12
21-
sandbox-fallback = false
22-
- name: Nix info
23-
run: nix-shell -p nix-info --run "nix-info -m"
24-
- uses: cachix/cachix-action@v16
25-
with:
26-
name: huggingface
27-
env:
28-
USER: runner
15+
- uses: actions/checkout@v4
2916
- name: Validate kernel directory
3017
id: validate
3118
env:
@@ -39,6 +26,12 @@ jobs:
3926
fi
4027
- name: Build kernel
4128
if: steps.validate.outputs.skip == 'false'
42-
run: |
43-
KERNEL="${{ steps.validate.outputs.kernel }}"
44-
( cd "$KERNEL" && nix build -L .#ci && ls -l result/ )
29+
uses: huggingface/publish-to-the-kernel-hub-action@main
30+
with:
31+
kernel-path: ${{ steps.validate.outputs.kernel }}
32+
build-target: ci
33+
nix-command: build
34+
nix-max-jobs: '2'
35+
nix-cores: '12'
36+
sandbox-mode: fallback
37+
upload-artifact: 'false'

.github/workflows/build-release-mac.yaml

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,6 @@ jobs:
1313
runs-on: macos-15
1414
steps:
1515
- uses: actions/checkout@v4
16-
- uses: DeterminateSystems/nix-installer-action@v20
17-
with:
18-
extra-conf: |
19-
max-jobs = 1
20-
cores = 3
21-
sandbox = relaxed
22-
- name: Nix info
23-
run: nix-shell -p nix-info --run "nix-info -m"
24-
- uses: cachix/cachix-action@v16
25-
with:
26-
name: huggingface
27-
env:
28-
USER: runner
2916
- name: Validate kernel directory
3017
id: validate
3118
run: |
@@ -38,8 +25,14 @@ jobs:
3825
fi
3926
- name: Build and upload kernel
4027
if: steps.validate.outputs.skip == 'false'
28+
uses: huggingface/publish-to-the-kernel-hub-action@main
29+
with:
30+
kernel-path: ${{ steps.validate.outputs.kernel }}
31+
build-target: build-and-upload
32+
nix-command: run
33+
nix-max-jobs: '1'
34+
nix-cores: '3'
35+
sandbox-mode: relaxed
36+
upload-artifact: 'false'
4137
env:
4238
HF_TOKEN: ${{ secrets.HF_TOKEN }}
43-
run: |
44-
KERNEL="${{ steps.validate.outputs.kernel }}"
45-
( cd "$KERNEL" && nix run -L .#build-and-upload )

.github/workflows/build-release.yaml

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,6 @@ jobs:
1414
group: aws-highmemory-32-plus-nix
1515
steps:
1616
- uses: actions/checkout@v4
17-
- uses: DeterminateSystems/nix-installer-action@main
18-
with:
19-
extra-conf: |
20-
max-jobs = 2
21-
cores = 12
22-
sandbox-fallback = false
23-
- name: Nix info
24-
run: nix-shell -p nix-info --run "nix-info -m"
25-
- uses: cachix/cachix-action@v16
26-
with:
27-
name: huggingface
28-
env:
29-
USER: runner
3017
- name: Validate kernel directory
3118
id: validate
3219
run: |
@@ -39,8 +26,14 @@ jobs:
3926
fi
4027
- name: Build and upload kernel
4128
if: steps.validate.outputs.skip == 'false'
29+
uses: huggingface/publish-to-the-kernel-hub-action@main
30+
with:
31+
kernel-path: ${{ steps.validate.outputs.kernel }}
32+
build-target: build-and-upload
33+
nix-command: run
34+
nix-max-jobs: '2'
35+
nix-cores: '12'
36+
sandbox-mode: fallback
37+
upload-artifact: 'false'
4238
env:
4339
HF_TOKEN: ${{ secrets.HF_TOKEN }}
44-
run: |
45-
KERNEL="${{ steps.validate.outputs.kernel }}"
46-
( cd "$KERNEL" && nix run -L .#build-and-upload )

.github/workflows/manual-build-upload.yaml

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,6 @@ jobs:
4242
ref: refs/pull/${{ inputs.pr_number }}/head
4343
fetch-depth: 0
4444

45-
- uses: DeterminateSystems/nix-installer-action@main
46-
with:
47-
extra-conf: |
48-
max-jobs = 2
49-
cores = 12
50-
sandbox-fallback = false
51-
52-
- name: Nix info
53-
run: nix-shell -p nix-info --run "nix-info -m"
54-
55-
- uses: cachix/cachix-action@v16
56-
with:
57-
name: huggingface
58-
env:
59-
USER: runner
60-
6145
- name: Validate kernel directory
6246
id: validate
6347
run: |
@@ -71,10 +55,15 @@ jobs:
7155
fi
7256
7357
- name: Build and copy kernel
74-
run: |
75-
set -eu
76-
KERNEL="${{ steps.validate.outputs.kernel }}"
77-
( cd "$KERNEL" && nix run -L .#build-and-copy )
58+
uses: huggingface/publish-to-the-kernel-hub-action@main
59+
with:
60+
kernel-path: ${{ steps.validate.outputs.kernel }}
61+
build-target: build-and-copy
62+
nix-command: run
63+
nix-max-jobs: '2'
64+
nix-cores: '12'
65+
sandbox-mode: fallback
66+
upload-artifact: 'false'
7867

7968
- name: Upload kernel
8069
env:

0 commit comments

Comments
 (0)