Skip to content

Commit c20ce4d

Browse files
fix(release): unique asset names + bump artifact actions
2 parents 6f731d6 + d752d09 commit c20ce4d

5 files changed

Lines changed: 17 additions & 19 deletions

File tree

.github/workflows/build-vmlinux.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
run: bb build "$NAME"
5454

5555
- name: Upload build outputs
56-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
56+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
5757
with:
5858
name: out-${{ matrix.name }}
5959
path: out/
@@ -70,7 +70,7 @@ jobs:
7070
babashka-version: 1.12.218
7171

7272
- name: Download all build outputs
73-
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
73+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
7474
with:
7575
pattern: out-*
7676
path: dist

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-24.04
1515
steps:
1616
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
17-
- uses: DeLaGuardo/clojure-lint-action@2d6013175031096ae07bc9b90a07173029ad7dc9 # master
17+
- uses: DeLaGuardo/clojure-lint-action@2d6013175031096ae07bc9b90a07173029ad7dc9 # master (no usable release tag; v1 Dockerfile broken)
1818
with:
1919
clj-kondo-args: --lint src
2020
check-name: clj-kondo

src/vmlinux/gha/artifacts.clj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@
55
[vmlinux.krn.build :as build]))
66

77
(defrecord VmLinuxArtifact [artifact-name])
8-
(defrecord ArtifactMeta [arch version binary sha256-sum])
8+
(defrecord ArtifactMeta [name arch version binary sha256-sum])
99

1010
(def ^:private stage-dir "out")
1111

12-
(defn- artifact-name
13-
[{:keys [arch version binary-path]}]
14-
(str (fs/file-name binary-path) "-" (name arch) "-" version))
12+
(defn- artifact-name [{:keys [name]}] (str "vmlinux-" name))
1513

1614
(defn prepare-artifact
17-
[{:keys [arch version binary-path sha256-sum], :as vmlinux-build}]
18-
(let [name (artifact-name vmlinux-build)
19-
dir (str stage-dir "/" name)
15+
[{:keys [name arch version binary-path sha256-sum], :as vmlinux-build}]
16+
(let [art-name (artifact-name vmlinux-build)
17+
dir (str stage-dir "/" art-name)
2018
binary (fs/file-name binary-path)]
2119
(fs/create-dirs dir)
2220
(fs/copy binary-path (str dir "/" binary) {:replace-existing true})
23-
(spit (str dir "/meta.edn") (pr-str (into {} (->ArtifactMeta arch version binary sha256-sum))))
24-
(->VmLinuxArtifact name)))
21+
(spit (str dir "/meta.edn")
22+
(pr-str (into {} (->ArtifactMeta name arch version binary sha256-sum))))
23+
(->VmLinuxArtifact art-name)))
2524

2625
(defn load-artifact
2726
[dir]
2827
(let [am (map->ArtifactMeta (edn/read-string (slurp (str dir "/meta.edn"))))]
29-
(build/map->VmLinuxBuild {:arch (:arch am),
28+
(build/map->VmLinuxBuild {:name (:name am),
29+
:arch (:arch am),
3030
:version (:version am),
3131
:binary-path (str dir "/" (:binary am)),
3232
:sha256-sum (:sha256-sum am)})))

src/vmlinux/gha/release.clj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
"VMLinux images used within [Hyper](https://github.com/harmont-dev/hyper) built off of `{{sha}}`."
1515
{:sha sha}))
1616

17-
(defn- asset-name
18-
[{:keys [arch version binary-path]}]
19-
(str (fs/file-name binary-path) "-" (name arch) "-" version))
17+
(defn- asset-name [{:keys [name]}] (str "vmlinux-" name))
2018

2119
(defn exists?
2220
[sha]

src/vmlinux/krn/build.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[babashka.process :refer [shell]]
66
[clojure.string :as str]))
77

8-
(defrecord VmLinuxBuild [arch version binary-path sha256-sum])
8+
(defrecord VmLinuxBuild [name arch version binary-path sha256-sum])
99

1010
(defn- nproc [] (.availableProcessors (Runtime/getRuntime)))
1111

@@ -21,10 +21,10 @@
2121
:aarch64 {:kbuild-arch "arm64", :target "Image", :boot-subpath "arch/arm64/boot/Image"}})
2222

2323
(defn compile
24-
[path {:keys [arch version config-file]}]
24+
[path {:keys [name arch version config-file]}]
2525
(let [{:keys [kbuild-arch target boot-subpath]} (arch-kbuild arch)]
2626
(fs/copy (fs/absolutize config-file) (str path "/.config") {:replace-existing true})
2727
(shell {:dir path} "make" (str "ARCH=" kbuild-arch) "olddefconfig")
2828
(shell {:dir path} "make" (str "ARCH=" kbuild-arch) (str "-j" (nproc)) target)
2929
(let [binary (str path "/" boot-subpath)]
30-
(->VmLinuxBuild arch version binary (file-sha256 binary)))))
30+
(->VmLinuxBuild name arch version binary (file-sha256 binary)))))

0 commit comments

Comments
 (0)