From 45aa2af875d5ca6d0f354ae1d31ace4a30af99d9 Mon Sep 17 00:00:00 2001 From: Shish Date: Sat, 4 May 2024 21:53:46 +0100 Subject: [PATCH] [ml] devkit --- .docker/ocaml.dockerfile | 12 ++++++++++++ .github/workflows/devkit-ocaml.yml | 28 ++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .docker/ocaml.dockerfile create mode 100644 .github/workflows/devkit-ocaml.yml diff --git a/.docker/ocaml.dockerfile b/.docker/ocaml.dockerfile new file mode 100644 index 0000000..cc88e7d --- /dev/null +++ b/.docker/ocaml.dockerfile @@ -0,0 +1,12 @@ +FROM debian:unstable AS build +ARG VERSION +RUN apt update && apt install -y gcc build-essential curl unzip bubblewrap +RUN adduser --disabled-password dev +RUN echo | bash -c "sh <(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)" && mkdir -p /home/dev/.opam/bin && mv /usr/local/bin/opam /home/dev/.opam/bin && chown -R dev /home/dev/.opam +USER dev +ENV PATH="/home/dev/.opam/bin:$PATH" +RUN opam init --compiler=${VERSION} --yes +RUN opam install ocamlsdl2 ocaml-lsp-server odoc ocamlformat utop --yes + +FROM scratch +COPY --from=build /home/dev/.opam /home/dev/.opam diff --git a/.github/workflows/devkit-ocaml.yml b/.github/workflows/devkit-ocaml.yml new file mode 100644 index 0000000..2bb2e39 --- /dev/null +++ b/.github/workflows/devkit-ocaml.yml @@ -0,0 +1,28 @@ +name: Devkit (ocaml) + +on: + workflow_dispatch: + +jobs: + build: + name: Build + runs-on: ubuntu-22.04 + strategy: + matrix: + lang: ["ocaml"] + version: ["5.1.1"] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Publish + uses: elgohr/Publish-Docker-Github-Action@main + with: + name: shish2k/rosettaboy-devkit-${{ matrix.lang }} + dockerfile: .docker/${{ matrix.lang }}.dockerfile + buildoptions: "--build-arg VERSION=${{ matrix.version }}" + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + tags: ${{ matrix.version }} + platforms: linux/amd64,linux/arm64