Skip to content

Commit

Permalink
change linux build process
Browse files Browse the repository at this point in the history
  • Loading branch information
cars10 committed Jan 14, 2025
1 parent d57e142 commit 708cbf2
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 50 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ yarn-*.log
# Tests
/test-results/
/playwright-report/
/playwright-report-ci/
/playwright/.cache/
playwright/.auth
tests/*.png
Expand All @@ -30,3 +31,4 @@ browser_extension/*
!browser_extension/firefox/manifest.json
tmp
src-tauri/target
scripts/screenshots/*
107 changes: 59 additions & 48 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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"}'
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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 `<kube-{now/d}>` as your index name, when
searching and also in the `REST` view. fixes [#267](https://github.com/cars10/elasticvue/issues/267)
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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 .
Expand All @@ -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 .
Expand Down
69 changes: 69 additions & 0 deletions docker/Dockerfile_tauri
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 8 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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==
Expand Down

0 comments on commit 708cbf2

Please sign in to comment.