-
Notifications
You must be signed in to change notification settings - Fork 4
Automatically create binaries when creating releases #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
patricoferris
merged 4 commits into
quantifyearth:main
from
tarides:dune-pkg-binary-release
Apr 30, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
78ed3af
Add dune pkg binary release workflow
gridbugs 52ef88a
Update lockfile, action and add documentation
Leonidas-from-XIV dcca298
Remove caching on every push to main
Leonidas-from-XIV bc0c92f
Offload non-pproject specific documentation to the Dune docs
Leonidas-from-XIV File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| name: Build and upload binary releases | ||
|
|
||
| on: | ||
| release: | ||
| types: [released] | ||
|
|
||
| jobs: | ||
| release-unix: | ||
| name: Release for ${{ matrix.name }} | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - os: macos-15-intel | ||
| name: x86_64-macos | ||
| - os: macos-15 | ||
| name: aarch64-macos | ||
| - os: ubuntu-latest | ||
| name: x86_64-linux | ||
| steps: | ||
|
|
||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: ocaml-dune/setup-dune@v2 | ||
|
|
||
| - name: Build the project | ||
| run: dune build @install --only-packages container-image --release | ||
|
|
||
| - name: Release a tarball of build outputs | ||
| run: | | ||
| OUT_NAME="container-image-${{ github.ref_name }}-${{ matrix.name }}" | ||
| mkdir -p "${OUT_NAME}" | ||
| cp -rlf _build/install/default/* "${OUT_NAME}" | ||
| tar --format=posix -cf "${OUT_NAME}.tar" "${OUT_NAME}" | ||
| gzip -9 "${OUT_NAME}.tar" | ||
|
|
||
| - name: Upload assets | ||
| uses: ncipollo/release-action@v1 | ||
| with: | ||
| allowUpdates: true | ||
| artifacts: "*.tar.gz" | ||
|
|
||
|
|
||
| release-x86_64-linux-musl-static: | ||
| name: Release for x86_64-linux-musl-static | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
|
|
||
| - uses: actions/checkout@v6 | ||
|
|
||
| - run: echo OUT_NAME=container-image-${{ github.ref_name }}-x86_64-linux-statically-linked >> $GITHUB_ENV | ||
|
|
||
| - run: mkdir -p $OUT_NAME | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v4 | ||
| - run: docker buildx build --output type=local,dest=$OUT_NAME -f scripts/build-static.Dockerfile . | ||
|
|
||
| - uses: actions/upload-artifact@v7 | ||
| with: | ||
| path: ${{ env.OUT_NAME }} | ||
| name: release-x86_64-linux-musl-static | ||
|
|
||
| - name: Basic sanity checks on the built executable | ||
| run: | | ||
| # make sure the executable is static | ||
| file $OUT_NAME/bin/image | ||
| # make sure it doesn't link with anything | ||
| if ldd $OUT_NAME/bin/image; then | ||
| # if ldd exists with 0 it means it links to dynamic libraries | ||
| exit 1 | ||
| fi | ||
| # call the executable | ||
| $OUT_NAME/bin/image | ||
|
|
||
| - name: Make a tarball of build outputs | ||
| run: | | ||
| tar --format=posix -cf "$OUT_NAME.tar" "$OUT_NAME" | ||
| gzip -9 "${OUT_NAME}.tar" | ||
|
|
||
| - name: Upload assets | ||
| uses: ncipollo/release-action@v1 | ||
| with: | ||
| allowUpdates: true | ||
| artifacts: "*.tar.gz" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,3 +15,8 @@ | |
| fmt.cli | ||
| logs.fmt | ||
| fmt.tty)) | ||
|
|
||
| (env | ||
| (static | ||
| (link_flags | ||
| (:standard -cclib -static)))) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| (version 1.9.1) | ||
|
|
||
| (build | ||
| (all_platforms | ||
| ((action | ||
| (progn | ||
| (when %{pkg-self:dev} (run dune subst)) | ||
| (run dune build -p %{pkg-self:name} -j %{jobs} @install)))))) | ||
|
|
||
| (depends | ||
| (all_platforms | ||
| (dune ocaml fmt astring cmdliner re stdlib-shims uutf ocaml-syntax-shims))) | ||
|
|
||
| (source | ||
| (fetch | ||
| (url | ||
| https://github.com/mirage/alcotest/releases/download/1.9.1/alcotest-1.9.1.tbz) | ||
| (checksum | ||
| sha256=1e29c3b41d4329062105b723dfda3aff86b8cef5e7c7500d0e491fc5fd78e482))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| (version 0.16.1) | ||
|
|
||
| (build | ||
| (all_platforms | ||
| ((action | ||
| (progn | ||
| (when %{pkg-self:dev} (run dune subst)) | ||
| (run dune build -p %{pkg-self:name} -j %{jobs})))))) | ||
|
|
||
| (depends | ||
| (all_platforms | ||
| (ocaml dune bigstringaf ocaml-syntax-shims))) | ||
|
|
||
| (source | ||
| (fetch | ||
| (url https://github.com/inhabitedtype/angstrom/archive/0.16.1.tar.gz) | ||
| (checksum md5=a9e096b4b2b8e4e3bb17d472bbccaad0))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| (version 0.3.2) | ||
|
|
||
| (build | ||
| (all_platforms | ||
| ((action | ||
| (progn | ||
| (when %{pkg-self:dev} (run dune subst)) | ||
| (run dune build -p %{pkg-self:name} -j %{jobs})))))) | ||
|
|
||
| (depends | ||
| (all_platforms | ||
| (ocaml dune ptime))) | ||
|
|
||
| (source | ||
| (fetch | ||
| (url | ||
| https://github.com/mirleft/ocaml-asn1-combinators/releases/download/v0.3.2/asn1-combinators-0.3.2.tbz) | ||
| (checksum | ||
| sha256=2b26985f6e2722073dcd9f84355bd6757e12643b5a48e30b3c07ff7cfb0d8a7f))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| (version 0.8.5) | ||
|
|
||
| (build | ||
| (all_platforms | ||
| ((action (run ocaml pkg/pkg.ml build --pinned %{pkg-self:pinned}))))) | ||
|
|
||
| (depends | ||
| (all_platforms | ||
| (ocaml ocamlfind ocamlbuild topkg))) | ||
|
|
||
| (source | ||
| (fetch | ||
| (url https://erratique.ch/software/astring/releases/astring-0.8.5.tbz) | ||
| (checksum | ||
| sha256=865692630c07c3ab87c66cdfc2734c0fdfc9c34a57f8e89ffec7c7d15e7a70fa))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| (version base) | ||
|
|
||
| (depends | ||
| (all_platforms (ocaml))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| (version base) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| (version base) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| (version v0.17.3) | ||
|
|
||
| (build | ||
| (all_platforms ((action (run dune build -p %{pkg-self:name} -j %{jobs}))))) | ||
|
|
||
| (depends | ||
| (all_platforms | ||
| (ocaml ocaml_intrinsics_kernel sexplib0 dune dune-configurator))) | ||
|
|
||
| (source | ||
| (fetch | ||
| (url https://github.com/janestreet/base/archive/refs/tags/v0.17.3.tar.gz) | ||
| (checksum md5=2100b0ed13fecf43be86ed45c5b2cc4d))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| (version 3.5.2) | ||
|
|
||
| (build | ||
| (all_platforms | ||
| ((action | ||
| (progn | ||
| (when %{pkg-self:dev} (run dune subst)) | ||
| (run dune build -p %{pkg-self:name} -j %{jobs})))))) | ||
|
|
||
| (depends | ||
| (all_platforms | ||
| (ocaml dune))) | ||
|
|
||
| (source | ||
| (fetch | ||
| (url | ||
| https://github.com/mirage/ocaml-base64/releases/download/v3.5.2/base64-3.5.2.tbz) | ||
| (checksum | ||
| sha256=b3f5ce301aa72c7032ef90be2332d72ff3962922c00ee2aec6bcade187a2f59b))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| (version 0.10.0) | ||
|
|
||
| (build | ||
| (all_platforms | ||
| ((action | ||
| (progn | ||
| (when %{pkg-self:dev} (run dune subst)) | ||
| (run dune build -p %{pkg-self:name} -j %{jobs} @install)))))) | ||
|
|
||
| (depends | ||
| (all_platforms | ||
| (dune dune-configurator ocaml))) | ||
|
|
||
| (source | ||
| (fetch | ||
| (url https://github.com/inhabitedtype/bigstringaf/archive/0.10.0.tar.gz) | ||
| (checksum md5=be0a44416840852777651150757a0a3b))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| (version 0.2.1) | ||
|
|
||
| (build | ||
| (all_platforms | ||
| ((action (run ocaml pkg/pkg.ml build --dev-pkg %{pkg-self:dev}))))) | ||
|
|
||
| (depends | ||
| (all_platforms | ||
| (ocaml ocamlfind ocamlbuild topkg base-unix rresult astring fpath fmt logs))) | ||
|
|
||
| (source | ||
| (fetch | ||
| (url https://erratique.ch/software/bos/releases/bos-0.2.1.tbz) | ||
| (checksum | ||
| sha512=8daeb8a4c2dd1f2460f6274ada19f4f1b6ebe875ff83a938c93418ce0e6bdb74b8afc5c9a7d410c1c9df2dad030e4fa276b6ed2da580639484e8b5bc92610b1d))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| (version 0.5.2) | ||
|
|
||
| (build | ||
| (all_platforms ((action (run dune build -p %{pkg-self:name} -j %{jobs}))))) | ||
|
|
||
| (depends | ||
| (all_platforms | ||
| (ocaml dune dune-configurator optint))) | ||
|
|
||
| (source | ||
| (fetch | ||
| (url | ||
| https://github.com/mirage/checkseum/releases/download/v0.5.2/checkseum-0.5.2.tbz) | ||
| (checksum | ||
| sha256=9e5e4fd4405cb4a8b4df00877543251833e08a6499ef42ccb8dba582df0dafc8))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| (version 2.1.0) | ||
|
|
||
| (install | ||
| (all_platforms | ||
| (progn | ||
| (run | ||
| %{make} | ||
| install | ||
| BINDIR=%{pkg-self:bin} | ||
| LIBDIR=%{pkg-self:lib} | ||
| DOCDIR=%{pkg-self:doc} | ||
| SHAREDIR=%{share} | ||
| MANDIR=%{man}) | ||
| (run | ||
| %{make} | ||
| install-doc | ||
| LIBDIR=%{pkg-self:lib} | ||
| DOCDIR=%{pkg-self:doc} | ||
| SHAREDIR=%{share} | ||
| MANDIR=%{man})))) | ||
|
|
||
| (build | ||
| (all_platforms ((action (run %{make} all PREFIX=%{prefix}))))) | ||
|
|
||
| (depends | ||
| (all_platforms (ocaml))) | ||
|
|
||
| (source | ||
| (fetch | ||
| (url https://erratique.ch/software/cmdliner/releases/cmdliner-2.1.0.tbz) | ||
| (checksum | ||
| sha512=2ca8c9a2b392e031f88aa0e76f2ab50c8e9e28d77852d04ca2d5b62326630ca41567ce0832e9a9334d9b130b48deede66c7880a9d0aee75a1afe7541097e249f))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| (version 6.2.1) | ||
|
|
||
| (build | ||
| (all_platforms | ||
| ((action | ||
| (progn | ||
| (when %{pkg-self:dev} (run dune subst)) | ||
| (run dune build -p %{pkg-self:name} -j %{jobs} @install)))))) | ||
|
|
||
| (depends | ||
| (all_platforms | ||
| (dune base-domains cohttp eio ipaddr logs uri fmt ptime http))) | ||
|
|
||
| (source | ||
| (fetch | ||
| (url | ||
| https://github.com/mirage/ocaml-cohttp/releases/download/v6.2.1/cohttp-6.2.1.tbz) | ||
| (checksum | ||
| sha256=65080247763442d1dc3cd90678b8233b798772f036ac81cd1eaade1f5d66a65f))) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.