Skip to content

update release ci

update release ci #55

Workflow file for this run

name: Build and Release Electron App and Docker Image
on:
push:
tags:
- "*" # Triggers on any tag
jobs:
build_and_release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
name: "macOS Build"
- os: ubuntu-latest
name: "Ubuntu Build"
- os: windows-latest
name: "Windows Build"
- os: ubuntu-latest
name: "Docker Build"
platform: linux/amd64,linux/arm64,linux/arm/v7
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Extract Major.Minor tag
id: extract_version
run: |
# Remove the leading 'v' and split the version into major.minor (e.g., v2.4.11 -> 2.4)
VERSION="${GITHUB_REF##*/}"
MAJOR_MINOR_TAG="$(echo $VERSION | cut -d. -f1,2)"
echo "MAJOR_MINOR_TAG=$MAJOR_MINOR_TAG" >> $GITHUB_ENV
- name: Install Node.js, NPM, and Yarn
uses: actions/setup-node@v4
with:
node-version: 22
- name: Build client (only for non-Docker jobs)
if: matrix.name != 'Docker Build'
run: |
cd client
yarn --network-timeout 100000
yarn build
cp -r build ../server
- name: Build and Release Electron App
if: matrix.name != 'Docker Build'
uses: samuelmeuli/action-electron-builder@v1
with:
package_root: "./server"
build_script_name: "build-electron"
github_token: ${{ secrets.GH_TOKEN }}
release: ${{ startsWith(github.ref, 'refs/tags/') }}
- name: Set up Docker Buildx (only for Docker job)
if: matrix.name == 'Docker Build'
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub (only for Docker job)
if: matrix.name == 'Docker Build'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PWD }}
- name: Build and Push Docker Image
if: matrix.name == 'Docker Build'
uses: docker/build-push-action@v5
with:
context: .
platforms: ${{ matrix.platform }}
tags: |
zilliz/attu:${{ github.ref_name }}
zilliz/attu:${{ env.MAJOR_MINOR_TAG }}
cache-from: type=registry,ref=zilliz/attu:cache
cache-to: type=inline
build-args: |
VERSION=${{ github.ref_name }}
push: true