Skip to content

Commit 5f8b935

Browse files
Merge branch 'main' into fe/feature/RI-6132
2 parents ed59e58 + 90cede6 commit 5f8b935

File tree

149 files changed

+3463
-4134
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+3463
-4134
lines changed

.circleci/build/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ yarn
66
yarn --cwd redisinsight/api
77

88
# build
9+
910
yarn build:statics
1011
yarn build:ui
1112
yarn --cwd ./redisinsight/api build:prod
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Install all libraries action
2+
description: Install all libraries and dependencies
3+
inputs:
4+
skip-electron-deps:
5+
description: Skip install electron dependencies
6+
default: '0'
7+
required: false
8+
9+
skip-backend-deps:
10+
description: Skip install backend dependencies
11+
default: '0'
12+
required: false
13+
14+
skip-postinstall:
15+
description: Skip postinstall
16+
default: '0'
17+
required: false
18+
19+
keytar-host-mirror:
20+
description: Keytar binary host mirror
21+
required: false
22+
23+
sqlite3-host-mirror:
24+
description: SQLite3 binary host mirror
25+
required: false
26+
27+
#TODO: check !contains
28+
29+
runs:
30+
using: 'composite'
31+
steps:
32+
# OS libraries
33+
- name: Setup Node
34+
uses: actions/[email protected]
35+
with:
36+
node-version: '20.15'
37+
# disable cache for windows
38+
# https://github.com/actions/setup-node/issues/975
39+
cache: ${{ runner.os != 'Windows' && 'yarn' || '' }}
40+
cache-dependency-path: ${{ runner.os != 'Windows' && '**/yarn.lock' || '' }}
41+
42+
# - run: echo "inputs.skip-electron-deps"
43+
# - run: echo "${{inputs.skip-electron-deps}}"
44+
# - run: echo "inputs.skip-backend-deps"
45+
# - run: echo "${{inputs.skip-backend-deps}}"
46+
47+
- name: Setup Python
48+
# if: ${{ contains(inputs.skip-electron-deps, '1') }}
49+
uses: actions/setup-python@v5
50+
with:
51+
python-version: '3.11'
52+
53+
- name: Install linux libraries
54+
if: ${{ runner.os == 'Linux' }}
55+
# if: ${{ runner.os == 'Linux' && !contains(inputs.skip-electron-deps, '1') }}
56+
shell: bash
57+
run: |
58+
sudo apt-get update -qy
59+
sudo apt-get install -qy libsecret-1-dev rpm
60+
61+
- name: Install macos libraries
62+
if: ${{ runner.os == 'macOS' }}
63+
# if: ${{ runner.os == 'macOS' && !contains(inputs.skip-electron-deps, '1') }}
64+
shell: bash
65+
run: |
66+
brew install libsecret
67+
68+
# TODO: matrix?
69+
# Javascript dependencies
70+
- name: Install dependencies for redisinsight package.js
71+
# if: ${{ contains(inputs.skip-electron-deps, '1') }}
72+
uses: ./.github/actions/install-deps
73+
with:
74+
dir-path: './redisinsight'
75+
keytar-host-mirror: ${{ inputs.keytar-host-mirror }}
76+
sqlite3-host-mirror: ${{ inputs.sqlite3-host-mirror }}
77+
78+
- name: Install dependencies for BE package.js
79+
# if: ${{ !contains(inputs.skip-backend-deps, '1') }}
80+
uses: ./.github/actions/install-deps
81+
with:
82+
dir-path: './redisinsight/api'
83+
84+
- name: Install dependencies for root package.js
85+
# if: ${{ contains(inputs.skip-electron-deps, '1') }}
86+
uses: ./.github/actions/install-deps
87+
with:
88+
dir-path: './'
89+
keytar-host-mirror: ${{ inputs.keytar-host-mirror }}
90+
sqlite3-host-mirror: ${{ inputs.sqlite3-host-mirror }}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Add certs to the keychain (macos)
2+
3+
inputs:
4+
CSC_P12_BASE64:
5+
required: true
6+
CSC_MAC_INSTALLER_P12_BASE64:
7+
required: true
8+
CSC_MAS_P12_BASE64:
9+
required: true
10+
CSC_KEY_PASSWORD:
11+
required: true
12+
CSC_MAS_PASSWORD:
13+
required: true
14+
CSC_MAC_INSTALLER_PASSWORD:
15+
required: true
16+
17+
runs:
18+
using: 'composite'
19+
steps:
20+
- name: Setup sign certificates
21+
shell: bash
22+
env:
23+
CSC_P12_BASE64: ${{ inputs.CSC_P12_BASE64 }}
24+
CSC_MAC_INSTALLER_P12_BASE64: ${{ inputs.CSC_MAC_INSTALLER_P12_BASE64 }}
25+
CSC_MAS_P12_BASE64: ${{ inputs.CSC_MAS_P12_BASE64 }}
26+
run: |
27+
mkdir -p certs
28+
echo "$CSC_P12_BASE64" | base64 -d > certs/mac-developer.p12
29+
echo "$CSC_MAC_INSTALLER_P12_BASE64" | base64 -d > certs/mac-installer.p12
30+
echo "$CSC_MAS_P12_BASE64" | base64 -d > certs/mas-distribution.p12
31+
32+
- name: Add certs to the keychain
33+
shell: bash
34+
env:
35+
KEYCHAIN: redisinsight.keychain
36+
CSC_KEY_PASSWORD: ${{ inputs.CSC_KEY_PASSWORD }}
37+
CSC_MAS_PASSWORD: ${{ inputs.CSC_MAS_PASSWORD }}
38+
CSC_MAC_INSTALLER_PASSWORD: ${{ inputs.CSC_MAC_INSTALLER_PASSWORD }}
39+
run: |
40+
security create-keychain -p mysecretpassword $KEYCHAIN
41+
security default-keychain -s $KEYCHAIN
42+
security unlock-keychain -p mysecretpassword $KEYCHAIN
43+
security set-keychain-settings -u -t 10000000 $KEYCHAIN
44+
security import certs/mac-developer.p12 -k $KEYCHAIN -P "$CSC_KEY_PASSWORD" -T /usr/bin/codesign -T /usr/bin/productbuild
45+
security import certs/mas-distribution.p12 -k $KEYCHAIN -P "$CSC_MAS_PASSWORD" -T /usr/bin/codesign -T /usr/bin/productbuild
46+
security import certs/mac-installer.p12 -k $KEYCHAIN -P "$CSC_MAC_INSTALLER_PASSWORD" -T /usr/bin/codesign -T /usr/bin/productbuild
47+
security set-key-partition-list -S apple-tool:,apple: -s -k mysecretpassword $KEYCHAIN
48+
security list-keychain -d user -s $KEYCHAIN
49+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Install Dependencies action
2+
description: Caches and installs dependencies for a given path
3+
inputs:
4+
dir-path:
5+
description: Path to the directory
6+
required: true
7+
keytar-host-mirror:
8+
description: Keytar binary host mirror
9+
required: false
10+
sqlite3-host-mirror:
11+
description: SQLite3 binary host mirror
12+
required: false
13+
skip-postinstall:
14+
description: Skip postinstall
15+
required: false
16+
default: '0'
17+
18+
runs:
19+
using: 'composite'
20+
steps:
21+
- name: Install dependencies
22+
working-directory: ${{ inputs.dir-path }}
23+
shell: bash
24+
25+
# env:
26+
# SKIP_POSTINSTALL: ${{ inputs.skip-postinstall }}
27+
# run: yarn install
28+
run: |
29+
export npm_config_keytar_binary_host_mirror=${{ inputs.keytar-host-mirror }}
30+
export npm_config_node_sqlite3_binary_host_mirror=${{ inputs.sqlite3-host-mirror }}
31+
32+
yarn install
33+
echo $SKIP_POSTINSTALL
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Install Windows certs
2+
3+
inputs:
4+
WIN_CSC_PFX_BASE64:
5+
required: true
6+
7+
runs:
8+
using: 'composite'
9+
steps:
10+
- name: Setup sign certificates
11+
shell: bash
12+
env:
13+
WIN_CSC_PFX_BASE64: ${{ inputs.WIN_CSC_PFX_BASE64 }}
14+
run: |
15+
mkdir -p certs
16+
echo "$WIN_CSC_PFX_BASE64" | base64 -d > certs/redislabs_win.pfx

.github/codeql/config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
paths-ignore:
2+
- 'tests/**'
3+
- '**/*.test.ts'
4+
- '**/*.spec.ts'
5+
- '**/*.spec.tsx'
6+
- '**/__mocks__/**'
7+
- './redisinsight/api/test'

.github/workflows/build.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
target:
7+
description: Build target
8+
required: false
9+
default: 'all'
10+
type: choice
11+
options:
12+
- all
13+
- docker
14+
- windows:x64
15+
- macos
16+
- macos:x64
17+
- macos:arm64
18+
- linux:appimage:x64
19+
- linux:deb:x64
20+
- linux:rpm:x64
21+
- linux:snap:x64
22+
23+
environment:
24+
description: Environment to run build
25+
type: environment
26+
default: 'staging'
27+
required: false
28+
29+
jobs:
30+
build_linux:
31+
if: startsWith(inputs.target, 'linux') || inputs.target == 'all'
32+
# concurrency: build
33+
uses: ./.github/workflows/pipeline-build-linux.yml
34+
secrets: inherit
35+
with:
36+
target: ${{ inputs.target }}
37+
38+
build_macos:
39+
if: startsWith(inputs.target, 'macos') || inputs.target == 'all'
40+
uses: ./.github/workflows/pipeline-build-macos.yml
41+
secrets: inherit
42+
with:
43+
target: ${{ inputs.target }}
44+
45+
build_windows:
46+
if: startsWith(inputs.target, 'windows') || inputs.target == 'all'
47+
uses: ./.github/workflows/pipeline-build-windows.yml
48+
secrets: inherit
49+
50+
build_docker:
51+
if: startsWith(inputs.target, 'docker') || inputs.target == 'all'
52+
uses: ./.github/workflows/pipeline-build-docker.yml
53+
secrets: inherit

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
uses: github/codeql-action/init@v1
4646
with:
4747
languages: ${{ matrix.language }}
48+
config-file: ./.github/codeql/config.yml
4849
# If you wish to specify custom queries, you can do so here or in a config file.
4950
# By default, queries listed here will override any specified in a config file.
5051
# Prefix the list here with "+" to use these queries and those in the config file.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Compress Images
2+
on:
3+
pull_request:
4+
# Run Image Actions when JPG, JPEG, PNG or WebP files are added or changed.
5+
# See https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpaths for reference.
6+
paths:
7+
- '**.jpg'
8+
- '**.jpeg'
9+
- '**.png'
10+
- '**.webp'
11+
jobs:
12+
build:
13+
# Only run on Pull Requests within the same repository, and not from forks.
14+
if: github.event.pull_request.head.repo.full_name == github.repository
15+
name: calibreapp/image-actions
16+
permissions: write-all
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout Repo
20+
uses: actions/checkout@v4
21+
22+
- name: Compress Images
23+
uses: calibreapp/image-actions@main
24+
with:
25+
# The `GITHUB_TOKEN` is automatically generated by GitHub and scoped only to the repository that is currently running the action. By default, the action can’t update Pull Requests initiated from forked repositories.
26+
# See https://docs.github.com/en/actions/reference/authentication-in-a-workflow and https://help.github.com/en/articles/virtual-environments-for-github-actions#token-permissions
27+
githubToken: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Build docker pipeline
2+
on:
3+
workflow_call:
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-24.04
8+
name: Build doker job
9+
10+
steps:
11+
- uses: actions/[email protected]
12+
13+
- name: Set up QEMU
14+
uses: docker/setup-qemu-action@v3
15+
16+
- name: Install all libs and dependencies
17+
uses: ./.github/actions/install-all-build-libs
18+
with:
19+
keytar-host-mirror: ${{ secrets.NPM_CONFIG_KEYTAR_BINARY_HOST_MIRROR }}
20+
sqlite3-host-mirror: ${{ secrets.NPM_CONFIG_NODE_SQLITE3_BINARY_HOST_MIRROR }}
21+
22+
- name: Build sources
23+
run: ./.circleci/build/build.sh
24+
25+
# todo: matrix
26+
- name: Build web archives
27+
run: |
28+
unset npm_config_keytar_binary_host_mirror
29+
unset npm_config_node_sqlite3_binary_host_mirror
30+
# Docker sources
31+
PLATFORM=linux ARCH=x64 LIBC=musl .circleci/build/build_modules.sh
32+
PLATFORM=linux ARCH=arm64 LIBC=musl .circleci/build/build_modules.sh
33+
# Redis Stack + VSC Linux
34+
PLATFORM=linux ARCH=x64 .circleci/build/build_modules.sh
35+
PLATFORM=linux ARCH=arm64 .circleci/build/build_modules.sh
36+
# VSC Darwin
37+
PLATFORM=darwin ARCH=x64 .circleci/build/build_modules.sh
38+
PLATFORM=darwin ARCH=arm64 .circleci/build/build_modules.sh
39+
# VSC Windows
40+
PLATFORM=win32 ARCH=x64 .circleci/build/build_modules.sh
41+
- name: Build Docker (x64, arm64)
42+
env:
43+
ENV: ${{ vars.ENV }}
44+
RI_SEGMENT_WRITE_KEY: ${{ secrets.RI_SEGMENT_WRITE_KEY }}
45+
run: |
46+
# Build alpine x64 image
47+
docker buildx build \
48+
-f .circleci/build/build.Dockerfile \
49+
--platform linux/amd64 \
50+
--build-arg DIST=release/web/Redis-Insight-web-linux-musl.x64.tar.gz \
51+
--build-arg NODE_ENV="$ENV" \
52+
--build-arg RI_SEGMENT_WRITE_KEY="$RI_SEGMENT_WRITE_KEY" \
53+
-t redisinsight:amd64 \
54+
.
55+
56+
# Build alpine arm64 image
57+
docker buildx build \
58+
-f .circleci/build/build.Dockerfile \
59+
--platform linux/arm64 \
60+
--build-arg DIST=release/web/Redis-Insight-web-linux-musl.arm64.tar.gz \
61+
--build-arg NODE_ENV="$ENV" \
62+
--build-arg RI_SEGMENT_WRITE_KEY="$RI_SEGMENT_WRITE_KEY" \
63+
-t redisinsight:arm64 \
64+
.
65+
66+
mkdir -p release/docker
67+
docker image save -o release/docker/docker-linux-alpine.amd64.tar redisinsight:amd64
68+
docker image save -o release/docker/docker-linux-alpine.arm64.tar redisinsight:arm64
69+
70+
- uses: actions/[email protected]
71+
name: Upload docker images
72+
with:
73+
if-no-files-found: error
74+
name: docker
75+
path: ./release

0 commit comments

Comments
 (0)