From 708cbf23b54ed76662c05842e5f4ed9faf995e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nig?= Date: Tue, 14 Jan 2025 20:55:57 +0100 Subject: [PATCH 1/4] change linux build process --- .dockerignore | 2 + .github/workflows/release.yml | 107 +++++++++++++++++++--------------- CHANGELOG.md | 7 ++- Makefile | 9 +++ docker/Dockerfile_tauri | 69 ++++++++++++++++++++++ package.json | 1 + yarn.lock | 9 ++- 7 files changed, 154 insertions(+), 50 deletions(-) create mode 100644 docker/Dockerfile_tauri diff --git a/.dockerignore b/.dockerignore index 0c8c16b2..89b68280 100644 --- a/.dockerignore +++ b/.dockerignore @@ -16,6 +16,7 @@ yarn-*.log # Tests /test-results/ /playwright-report/ +/playwright-report-ci/ /playwright/.cache/ playwright/.auth tests/*.png @@ -30,3 +31,4 @@ browser_extension/* !browser_extension/firefox/manifest.json tmp src-tauri/target +scripts/screenshots/* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ec05643b..5c859346 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,26 +29,72 @@ jobs: - uses: actions/checkout@v4 + ### WINDOWS + - uses: actions/setup-node@v4 with: node-version: '22.5.1' cache: 'yarn' + if: matrix.platform == 'windows-latest' + - run: yarn + if: matrix.platform == 'windows-latest' - run: rustup toolchain install stable + if: matrix.platform == 'windows-latest' + + - name: windows > build + run: yarn tauri:build + if: matrix.platform == 'windows-latest' + + - name: windows > upload artifacts + if: matrix.platform == 'windows-latest' + uses: actions/upload-artifact@v4 + with: + name: windows_artifacts + if-no-files-found: error + path: | + src-tauri/target/release/bundle/msi/elasticvue_*_x64* + src-tauri/target/release/elasticvue.exe + + ### LINUX + + - name: linux > build + run: make TAURI_SIGNING_PRIVATE_KEY="${{ secrets.TAURI_PRIVATE_KEY }}" TAURI_SIGNING_PRIVATE_KEY_PASSWORD="${{ secrets.TAURI_KEY_PASSWORD }}" build_docker_tauri + if: matrix.platform == 'ubuntu-latest' + + - name: linux > upload artifacts + if: matrix.platform == 'ubuntu-latest' + uses: actions/upload-artifact@v4 + with: + name: linux_artifacts + if-no-files-found: error + path: | + src-tauri/target/release/bundle/deb/elasticvue_*_amd64.deb + src-tauri/target/release/bundle/appimage/elasticvue_*_amd64.* + src-tauri/target/release/elasticvue + + ### MAC + + - uses: actions/setup-node@v4 + with: + node-version: '22.5.1' + cache: 'yarn' + if: matrix.platform == 'macos-latest' + + - run: yarn + if: matrix.platform == 'macos-latest' + + - run: rustup toolchain install stable + if: matrix.platform == 'macos-latest' + - name: mac > setup targets if: matrix.platform == 'macos-latest' run: | rustup target add aarch64-apple-darwin rustup target add x86_64-apple-darwin - - name: linux > install dependencies - if: matrix.platform == 'ubuntu-latest' - run: | - sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.1-0=2.44.0-2 libwebkit2gtk-4.1-dev=2.44.0-2 libjavascriptcoregtk-4.1-0=2.44.0-2 libjavascriptcoregtk-4.1-dev=2.44.0-2 gir1.2-javascriptcoregtk-4.1=2.44.0-2 gir1.2-webkit2-4.1=2.44.0-2 build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev - - ### build apple arm + #### build mac arm - name: mac aaarch64 > build run: yarn tauri:build --target aarch64-apple-darwin @@ -70,7 +116,7 @@ jobs: src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/elasticvue_*_aarch64.dmg src-tauri/target/aarch64-apple-darwin/release/bundle/macos/elasticvue_aarch64* - ### build apple x86_64 + #### build mac x86_64 - name: mac x86_64 > build run: yarn tauri:build --target x86_64-apple-darwin @@ -92,39 +138,6 @@ jobs: src-tauri/target/x86_64-apple-darwin/release/bundle/dmg/elasticvue_*_x64.dmg src-tauri/target/x86_64-apple-darwin/release/bundle/macos/elasticvue_x64* - ### build linux - - - name: linux > build - run: yarn tauri:build - if: matrix.platform == 'ubuntu-latest' - - - name: linux > upload artifacts - if: matrix.platform == 'ubuntu-latest' - uses: actions/upload-artifact@v4 - with: - name: linux_artifacts - if-no-files-found: error - path: | - src-tauri/target/release/bundle/deb/elasticvue_*_amd64.deb - src-tauri/target/release/bundle/appimage/elasticvue_*_amd64.* - src-tauri/target/release/elasticvue - - ### build windows - - - name: windows > build - run: yarn tauri:build - if: matrix.platform == 'windows-latest' - - - name: windows > upload artifacts - if: matrix.platform == 'windows-latest' - uses: actions/upload-artifact@v4 - with: - name: windows_artifacts - if-no-files-found: error - path: | - src-tauri/target/release/bundle/msi/elasticvue_*_x64* - src-tauri/target/release/elasticvue.exe - build_docker: name: Build docker images runs-on: ubuntu-latest @@ -221,10 +234,8 @@ jobs: * [Hosted](https://app.elasticvue.com) - name: deploy - uses: fjogeleit/http-request-action@v1 - with: - url: 'https://autodok.cars10k.de/update' - timeout: 60000 - method: 'POST' - customHeaders: '{"Content-Type": "application/json", "authorization": "${{ secrets.AUTODOK_API_KEY }}"}' - data: '{"container": "elasticvue", "image": "cars10/elasticvue:latest"}' + run: | + curl -X POST https://autodok.cars10k.de/update \ + -H "Content-Type: application/json" \ + -H "Authorization: ${{ secrets.AUTODOK_API_KEY }}" \ + -d '{"container": "elasticvue", "image": "cars10/elasticvue:latest"}' diff --git a/CHANGELOG.md b/CHANGELOG.md index b39414ce..f4884fba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog -# 1.2.0 +## 1.3.0 + +Change the build process for the linux desktop app. It now requires glibc `3.36`, so it should run distros using +outdated versions of glibc, like `debian:bookworm`. + +## 1.2.0 * adds support for date math in index names. You can use something like `` as your index name, when searching and also in the `REST` view. fixes [#267](https://github.com/cars10/elasticvue/issues/267) diff --git a/Makefile b/Makefile index da7f422c..15879301 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ CI ?= +TAURI_SIGNING_PRIVATE_KEY ?= +TAURI_SIGNING_PRIVATE_KEY_PASSWORD ?= build_docker_ci: docker build -f docker/Dockerfile_ci -t elasticvue-ci . @@ -9,6 +11,13 @@ ci: build_docker_ci build_tauri: yarn tauri:build +build_docker_tauri: + docker build . -t elasticvue-linux-tauri -f docker/Dockerfile_tauri + docker run --rm -e TAURI_SIGNING_PRIVATE_KEY="$(TAURI_SIGNING_PRIVATE_KEY)" \ + -e TAURI_SIGNING_PRIVATE_KEY_PASSWORD="$(TAURI_SIGNING_PRIVATE_KEY_PASSWORD)" \ + -v .:/app \ + elasticvue-linux-tauri bash -c "yarn && . ~/.cargo/env && yarn tauri:build" + # Build docker image to run elasticvue served by nginx build_docker_nginx: docker build -f docker/Dockerfile -t elasticvue . diff --git a/docker/Dockerfile_tauri b/docker/Dockerfile_tauri new file mode 100644 index 00000000..dbfd3ee6 --- /dev/null +++ b/docker/Dockerfile_tauri @@ -0,0 +1,69 @@ +FROM debian:bookworm + +ENV NODE_VERSION=22 +ENV APP_HOME=/app +ENV BUILD_USER=tauri + +RUN useradd --uid 1000 -m $BUILD_USER +RUN mkdir -p $APP_HOME +RUN chown -R 1000:1000 $APP_HOME + +WORKDIR $APP_HOME + +RUN apt-get update && \ + apt-get install -y wget curl vim gpg \ + && apt-get clean \ + && apt-get autoclean \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* + +USER $BUILD_USER + +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y + +USER root + +RUN mkdir -p /etc/apt/keyrings \ + && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ + && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_VERSION.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \ + && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ + && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ + && apt-get update \ + && apt-get install -y nodejs yarn \ + && apt-get clean \ + && apt-get autoclean \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* + +# download old versions because of EGL issues, see https://github.com/h3poteto/fedistar/issues/1717 +RUN mkdir -p /tmp/ubuntu-packages \ + && cd /tmp/ubuntu-packages \ + && wget https://launchpadlibrarian.net/723972773/libwebkit2gtk-4.1-0_2.44.0-0ubuntu0.22.04.1_amd64.deb \ + && wget https://launchpadlibrarian.net/723972761/libwebkit2gtk-4.1-dev_2.44.0-0ubuntu0.22.04.1_amd64.deb \ + && wget https://launchpadlibrarian.net/723972770/libjavascriptcoregtk-4.1-0_2.44.0-0ubuntu0.22.04.1_amd64.deb \ + && wget https://launchpadlibrarian.net/723972746/libjavascriptcoregtk-4.1-dev_2.44.0-0ubuntu0.22.04.1_amd64.deb \ + && wget https://launchpadlibrarian.net/723972735/gir1.2-javascriptcoregtk-4.1_2.44.0-0ubuntu0.22.04.1_amd64.deb \ + && wget https://launchpadlibrarian.net/723972739/gir1.2-webkit2-4.1_2.44.0-0ubuntu0.22.04.1_amd64.deb \ + && wget https://launchpadlibrarian.net/606433947/libicu70_70.1-2ubuntu1_amd64.deb \ + && wget https://launchpadlibrarian.net/595623693/libjpeg8_8c-2ubuntu10_amd64.deb \ + && wget https://launchpadlibrarian.net/587202140/libjpeg-turbo8_2.1.2-0ubuntu1_amd64.deb \ + && wget https://launchpadlibrarian.net/592959859/xdg-desktop-portal-gtk_1.14.0-1build1_amd64.deb + +RUN apt-get update && \ + apt-get install -y build-essential \ + curl \ + wget \ + file \ + libssl-dev \ + libgtk-3-dev \ + libxdo-dev \ + libayatana-appindicator3-dev \ + librsvg2-dev \ + && apt-get install -y /tmp/ubuntu-packages/*.deb \ + && rm -rf /tmp/ubuntu-packages \ + && apt-get clean \ + && apt-get autoclean \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* + +USER $BUILD_USER diff --git a/package.json b/package.json index a6dba8b6..dbd82399 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "@vitejs/plugin-vue": "^5.2.1", "@vue/eslint-config-typescript": "^13.0.0", "@vue/tsconfig": "^0.7.0", + "cross-env": "^7.0.3", "eslint": "^9.16.0", "eslint-plugin-vue": "^9.32.0", "sass": "^1.82.0", diff --git a/yarn.lock b/yarn.lock index 1f510d6d..75d6602b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1733,7 +1733,14 @@ crelt@^1.0.5: resolved "https://registry.yarnpkg.com/crelt/-/crelt-1.0.6.tgz#7cc898ea74e190fb6ef9dae57f8f81cf7302df72" integrity sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g== -cross-spawn@^7.0.0, cross-spawn@^7.0.3, cross-spawn@^7.0.5: +cross-env@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf" + integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw== + dependencies: + cross-spawn "^7.0.1" + +cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.3, cross-spawn@^7.0.5: version "7.0.6" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== From 63cba81cabd5fb670748f890321fec44460a9417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nig?= Date: Tue, 14 Jan 2025 21:35:46 +0100 Subject: [PATCH 2/4] change linux build process, require glibc 3.35 --- CHANGELOG.md | 4 ++-- Makefile | 2 +- docker/Dockerfile_tauri | 22 +++++++++++----------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4884fba..49970bb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,8 @@ ## 1.3.0 -Change the build process for the linux desktop app. It now requires glibc `3.36`, so it should run distros using -outdated versions of glibc, like `debian:bookworm`. +Change the build process for the linux desktop app. It now requires glibc `3.35`, so it should run distros using +older versions of glibc, like `debian:bookworm` or `ubuntu:jammy`. ## 1.2.0 diff --git a/Makefile b/Makefile index 15879301..4c5d5403 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ build_docker_tauri: docker run --rm -e TAURI_SIGNING_PRIVATE_KEY="$(TAURI_SIGNING_PRIVATE_KEY)" \ -e TAURI_SIGNING_PRIVATE_KEY_PASSWORD="$(TAURI_SIGNING_PRIVATE_KEY_PASSWORD)" \ -v .:/app \ - elasticvue-linux-tauri bash -c "yarn && . ~/.cargo/env && yarn tauri:build" + elasticvue-linux-tauri bash -c "yarn && . ~/.cargo/env && rm -rf src-tauri/target && yarn tauri:build" # Build docker image to run elasticvue served by nginx build_docker_nginx: diff --git a/docker/Dockerfile_tauri b/docker/Dockerfile_tauri index dbfd3ee6..411d92ee 100644 --- a/docker/Dockerfile_tauri +++ b/docker/Dockerfile_tauri @@ -1,4 +1,4 @@ -FROM debian:bookworm +FROM ubuntu:jammy ENV NODE_VERSION=22 ENV APP_HOME=/app @@ -45,20 +45,20 @@ RUN mkdir -p /tmp/ubuntu-packages \ && wget https://launchpadlibrarian.net/723972735/gir1.2-javascriptcoregtk-4.1_2.44.0-0ubuntu0.22.04.1_amd64.deb \ && wget https://launchpadlibrarian.net/723972739/gir1.2-webkit2-4.1_2.44.0-0ubuntu0.22.04.1_amd64.deb \ && wget https://launchpadlibrarian.net/606433947/libicu70_70.1-2ubuntu1_amd64.deb \ + && wget https://launchpadlibrarian.net/606433941/libicu-dev_70.1-2ubuntu1_amd64.deb \ + && wget https://launchpadlibrarian.net/606433945/icu-devtools_70.1-2ubuntu1_amd64.deb \ && wget https://launchpadlibrarian.net/595623693/libjpeg8_8c-2ubuntu10_amd64.deb \ && wget https://launchpadlibrarian.net/587202140/libjpeg-turbo8_2.1.2-0ubuntu1_amd64.deb \ && wget https://launchpadlibrarian.net/592959859/xdg-desktop-portal-gtk_1.14.0-1build1_amd64.deb -RUN apt-get update && \ - apt-get install -y build-essential \ - curl \ - wget \ - file \ - libssl-dev \ - libgtk-3-dev \ - libxdo-dev \ - libayatana-appindicator3-dev \ - librsvg2-dev \ +RUN apt-get update \ + && apt-get install -y build-essential \ + file \ + libssl-dev \ + libgtk-3-dev \ + libxdo-dev \ + libayatana-appindicator3-dev \ + librsvg2-dev \ && apt-get install -y /tmp/ubuntu-packages/*.deb \ && rm -rf /tmp/ubuntu-packages \ && apt-get clean \ From c76a8fba1b5a8c813c6f3135b2bb3296e7b09eb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nig?= Date: Tue, 14 Jan 2025 21:36:00 +0100 Subject: [PATCH 3/4] upload browser extension artifacts to GH release --- .github/workflows/release.yml | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5c859346..1b1823f6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -138,18 +138,37 @@ jobs: src-tauri/target/x86_64-apple-darwin/release/bundle/dmg/elasticvue_*_x64.dmg src-tauri/target/x86_64-apple-darwin/release/bundle/macos/elasticvue_x64* + + build_browser_extensions: + name: Build browser extensions + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: build extensions + run: make build_browser_extensions + + - name: upload artifacts + uses: actions/upload-artifact@v4 + with: + name: browser_extension_artifacts + if-no-files-found: error + path: | + artifacts/*.zip + + build_docker: name: Build docker images runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + - name: Docker hub login uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - uses: actions/checkout@v4 - - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -169,6 +188,7 @@ jobs: tags: cars10/elasticvue:latest,cars10/elasticvue:${{ steps.package-version.outputs.current-version }} #tags: cars10/elasticvue:${{ steps.package-version.outputs.current-version }} + publish: name: Publish release needs: @@ -216,6 +236,7 @@ jobs: github-artifacts/mac_x86_64_artifacts/macos/elasticvue_x64* github-artifacts/windows_artifacts/bundle/msi/elasticvue_*_x64* github-artifacts/windows_artifacts/elasticvue.exe + github-artifacts/browser_extension_artifacts/*.zip body: | ## Changelog ${{ steps.changelog.outputs.changelog }} From 2391eadf79b1232f57986bec25db8def52390e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nig?= Date: Tue, 14 Jan 2025 21:44:32 +0100 Subject: [PATCH 4/4] bumps version to 1.3.0 --- browser_extension/chrome/manifest.json | 2 +- browser_extension/firefox/manifest.json | 2 +- package.json | 2 +- src-tauri/tauri.conf.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/browser_extension/chrome/manifest.json b/browser_extension/chrome/manifest.json index 69871a00..14fcebb8 100644 --- a/browser_extension/chrome/manifest.json +++ b/browser_extension/chrome/manifest.json @@ -1,6 +1,6 @@ { "name": "Elasticvue", - "version": "1.2.0", + "version": "1.3.0", "description": "Elasticsearch frontend", "manifest_version": 3, "icons": { diff --git a/browser_extension/firefox/manifest.json b/browser_extension/firefox/manifest.json index d85ed41c..20693996 100644 --- a/browser_extension/firefox/manifest.json +++ b/browser_extension/firefox/manifest.json @@ -1,6 +1,6 @@ { "name": "Elasticvue", - "version": "1.2.0", + "version": "1.3.0", "description": "Elasticsearch frontend", "manifest_version": 2, "icons": { diff --git a/package.json b/package.json index dbd82399..786e3af0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "elasticvue", "private": true, - "version": "1.2.0", + "version": "1.3.0", "scripts": { "dev": "vite", "build": "vite build", diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 6e3b1446..b4716493 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -42,7 +42,7 @@ }, "productName": "elasticvue", "mainBinaryName": "elasticvue", - "version": "1.2.0", + "version": "1.3.0", "identifier": "com.elasticvue.app", "plugins": { "updater": {