From e36d874551f453231142fdabf8971ea708437687 Mon Sep 17 00:00:00 2001 From: Erik Martin-Dorel Date: Fri, 4 Mar 2022 14:45:57 +0100 Subject: [PATCH] feat: Build `learn-ocaml-www.zip` (`learn-ocaml --contents-dir=www`) (#469) --- .github/workflows/release.yml | 1 + .github/workflows/static-builds.yml | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f65cbbb0f..a4b79ac40 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,6 +66,7 @@ jobs: mv -v -- "$d/$b" "target/$b-$d-x86_64" done done + mv -v -- learn-ocaml-www.zip target/learn-ocaml-www.zip - name: Add binaries to release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/static-builds.yml b/.github/workflows/static-builds.yml index 23a417beb..da30f4088 100644 --- a/.github/workflows/static-builds.yml +++ b/.github/workflows/static-builds.yml @@ -12,6 +12,29 @@ on: # test master every Saturday at 08:00 UTC - cron: '0 8 * * 6' jobs: + learn-ocaml-www-zip: + name: Build learn-ocaml-www.zip archive + if: ${{ github.event_name != 'schedule' || github.repository == 'ocaml-sf/learn-ocaml' }} + runs-on: ubuntu-latest + strategy: + matrix: + archive: ["learn-ocaml-www.zip"] + # we could use an env var, albeit it would be less convenient + steps: + - name: Check out the repo + uses: actions/checkout@v2 + - name: Build learn-ocaml-compilation + run: 'docker build -t learn-ocaml-compilation --target=compilation .' + - name: Build ${{ matrix.archive }} + run: | + docker run -i --rm -w /home/opam/install-prefix/share/learn-ocaml -u 0 --entrypoint='' learn-ocaml-compilation sh -c \ + 'apk add --no-cache zip >&2 && zip -r ${{ matrix.archive }} www >&2 && tar c ${{ matrix.archive }}' | \ + tar vx + - name: Upload ${{ matrix.archive }} + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.archive }} + path: ${{ matrix.archive }} static-bin-linux: name: Builds static Linux binaries if: ${{ github.event_name != 'schedule' || github.repository == 'ocaml-sf/learn-ocaml' }}