From dfbb5f6221151437ef921d776bf3c00c0a02a2ce Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Fri, 23 Jun 2023 08:27:43 +0100 Subject: [PATCH 1/2] Make FROM version conditional on build type --- .github/workflows/build_libzim_wasm.yml | 9 ++++++++- docker/Dockerfile | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_libzim_wasm.yml b/.github/workflows/build_libzim_wasm.yml index e7b63c9..6e46bb6 100644 --- a/.github/workflows/build_libzim_wasm.yml +++ b/.github/workflows/build_libzim_wasm.yml @@ -42,6 +42,7 @@ env: DISPATCH_TYPE: ${{ github.event.inputs.buildtype }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SSH_KEY: ${{ secrets.SSH_KEY }} + BUILD_TYPE: ${{ github.event.inputs.buildtype }} jobs: build: @@ -51,7 +52,13 @@ jobs: - uses: actions/checkout@v3 # Customizes the Emscripten docker container via the Dockerfile in this repo - name: Build the Docker image - run: docker build -t "docker-emscripten-libzim:v3" ./docker + run: | + if [[ $BUILD_TYPE -eq 'source' ]]; then + BUILD_VERSION='3.1.12' + else + BUILD_VERSION='3.1.41' + fi + docker build -t "docker-emscripten-libzim:v3" ./docker --build-arg VERSION=$BUILD_VERSION # If we're building release version - name: Build release from libzim binaries if: github.event_name == 'pull_request' || github.event_name == 'push' || github.event.inputs.buildtype == 'release' diff --git a/docker/Dockerfile b/docker/Dockerfile index e6d0a79..5cd96c8 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,5 +1,6 @@ # Docker image suitable to build libzim & kiwixlib with emscripten -FROM emscripten/emsdk:3.1.41 +ARG VERSION +FROM emscripten/emsdk:${VERSION} # Install build tools RUN apt-get update && apt-get install -y --no-install-recommends wget ninja-build pkg-config python3 autopoint libtool autoconf patch g++ locales curl git \ From c9c9b48eb8d6400a28f8dfe6425c36c343d0f778 Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Fri, 23 Jun 2023 08:48:06 +0100 Subject: [PATCH 2/2] Adjust the test --- .github/workflows/build_libzim_wasm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_libzim_wasm.yml b/.github/workflows/build_libzim_wasm.yml index 6e46bb6..fbe24d0 100644 --- a/.github/workflows/build_libzim_wasm.yml +++ b/.github/workflows/build_libzim_wasm.yml @@ -53,7 +53,7 @@ jobs: # Customizes the Emscripten docker container via the Dockerfile in this repo - name: Build the Docker image run: | - if [[ $BUILD_TYPE -eq 'source' ]]; then + if [[ $BUILD_TYPE =~ 'source' ]]; then BUILD_VERSION='3.1.12' else BUILD_VERSION='3.1.41'