Skip to content

Commit 18edfda

Browse files
authored
Merge pull request #668 from tarides/dune-pkg
Github action to build releases with Dune package management
2 parents 56676c4 + 58edd66 commit 18edfda

127 files changed

Lines changed: 2641 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build and upload binary releases
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
release-unix:
9+
name: Release for ${{ matrix.name }}
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
include:
14+
- os: macos-15-intel
15+
name: x86_64-macos
16+
- os: macos-15
17+
name: aarch64-macos
18+
- os: ubuntu-latest
19+
name: x86_64-linux-gnu
20+
steps:
21+
22+
- uses: actions/checkout@v6
23+
24+
- uses: ocaml-dune/setup-dune@v2
25+
26+
- name: Build the project
27+
run: dune build @install --release --only-packages vpnkit --display=short
28+
29+
- name: Release a tarball of build outputs
30+
run: |
31+
OUT_NAME=vpnkit-${{ github.ref_name }}-${{ matrix.name }}
32+
mkdir -p "$OUT_NAME"
33+
cp -rlf _build/install/default/* "$OUT_NAME"
34+
tar --format=posix -cf "$OUT_NAME.tar" "$OUT_NAME"
35+
gzip -v9 "${OUT_NAME}.tar"
36+
37+
- name: Upload assets
38+
uses: ncipollo/release-action@v1
39+
with:
40+
allowUpdates: true
41+
artifacts: "*.tar.gz"

dune-workspace

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
(lang dune 3.19)
2+
3+
(repository
4+
(name archive-without-constraint)
5+
(url git+https://github.com/tarides/moby-vpnkit-opam-repository-archive#remove-dune-upper-constraint))
6+
7+
(lock_dir
8+
(repositories upstream overlay archive-without-constraint))

dune.lock/alcotest.1.5.0.pkg

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
(version 1.5.0)
2+
3+
(build
4+
(all_platforms
5+
((action
6+
(progn
7+
(when %{pkg-self:dev} (run dune subst))
8+
(run dune build -p %{pkg-self:name} -j %{jobs} @install))))))
9+
10+
(depends
11+
(all_platforms
12+
(dune ocaml fmt astring cmdliner re stdlib-shims uutf ocaml-syntax-shims)))
13+
14+
(source
15+
(fetch
16+
(url
17+
https://github.com/mirage/alcotest/releases/download/1.5.0/alcotest-js-1.5.0.tbz)
18+
(checksum
19+
sha256=54281907e02d78995df246dc2e10ed182828294ad2059347a1e3a13354848f6c)))

dune.lock/angstrom.0.16.1.pkg

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
(version 0.16.1)
2+
3+
(build
4+
(all_platforms
5+
((action
6+
(progn
7+
(when %{pkg-self:dev} (run dune subst))
8+
(run dune build -p %{pkg-self:name} -j %{jobs}))))))
9+
10+
(depends
11+
(all_platforms
12+
(ocaml dune bigstringaf ocaml-syntax-shims)))
13+
14+
(source
15+
(fetch
16+
(url https://github.com/inhabitedtype/angstrom/archive/0.16.1.tar.gz)
17+
(checksum md5=a9e096b4b2b8e4e3bb17d472bbccaad0)))

dune.lock/arp.3.1.1.pkg

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
(version 3.1.1)
2+
3+
(build
4+
(all_platforms
5+
((action
6+
(progn
7+
(when %{pkg-self:dev} (run dune subst))
8+
(run dune build -p %{pkg-self:name} -j %{jobs}))))))
9+
10+
(depends
11+
(all_platforms
12+
(ocaml
13+
dune
14+
cstruct
15+
ipaddr
16+
macaddr
17+
logs
18+
mirage-time
19+
lwt
20+
duration
21+
ethernet
22+
fmt)))
23+
24+
(source
25+
(fetch
26+
(url https://github.com/mirage/arp/releases/download/v3.1.1/arp-3.1.1.tbz)
27+
(checksum
28+
sha256=ea33c589e9deea300fb62bc2ba0b557cfdfeea4f40e600685b3a68c6868f06f1)))

dune.lock/astring.0.8.5.pkg

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
(version 0.8.5)
2+
3+
(build
4+
(all_platforms
5+
((action (run ocaml pkg/pkg.ml build --pinned %{pkg-self:pinned})))))
6+
7+
(depends
8+
(all_platforms
9+
(ocaml ocamlfind ocamlbuild topkg)))
10+
11+
(source
12+
(fetch
13+
(url https://erratique.ch/software/astring/releases/astring-0.8.5.tbz)
14+
(checksum
15+
sha256=865692630c07c3ab87c66cdfc2734c0fdfc9c34a57f8e89ffec7c7d15e7a70fa)))

dune.lock/base-bytes.base.pkg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
(version base)
2+
3+
(depends
4+
(all_platforms
5+
(ocaml ocamlfind)))

dune.lock/base-threads.base.pkg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(version base)

dune.lock/base-unix.base.pkg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(version base)

dune.lock/base.v0.14.4.pkg

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
(version v0.14.4)
2+
3+
(build
4+
(all_platforms ((action (run dune build -p %{pkg-self:name} -j %{jobs})))))
5+
6+
(depends
7+
(all_platforms
8+
(ocaml sexplib0 dune dune-configurator)))
9+
10+
(source
11+
(fetch
12+
(url https://github.com/janestreet/base/archive/refs/tags/v0.14.4.tar.gz)
13+
(checksum md5=89c571906217b5513682123b74327522)))

0 commit comments

Comments
 (0)