|
@@ -1,12 +1,12 @@
|
|
-name: Build and Release Electron App and Docker Image
|
|
|
|
|
|
+name: Build electron app
|
|
|
|
|
|
on:
|
|
on:
|
|
push:
|
|
push:
|
|
tags:
|
|
tags:
|
|
- - "*" # Triggers on any tag
|
|
|
|
|
|
+ - "*"
|
|
|
|
|
|
jobs:
|
|
jobs:
|
|
- build_and_release:
|
|
|
|
|
|
+ release:
|
|
runs-on: ${{ matrix.os }}
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
strategy:
|
|
strategy:
|
|
@@ -17,75 +17,27 @@ jobs:
|
|
- name: Check out Git repository
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@v4
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
- - name: Install Node.js, NPM, and Yarn
|
|
|
|
|
|
+ - name: Install Node.js, NPM and Yarn
|
|
uses: actions/setup-node@v4
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
with:
|
|
node-version: 22
|
|
node-version: 22
|
|
|
|
|
|
- - name: Build client (only for non-Docker jobs)
|
|
|
|
|
|
+ - name: Build client
|
|
run: |
|
|
run: |
|
|
cd client
|
|
cd client
|
|
yarn --network-timeout 100000
|
|
yarn --network-timeout 100000
|
|
yarn build
|
|
yarn build
|
|
cp -r build ../server
|
|
cp -r build ../server
|
|
|
|
|
|
- - name: Build and Release Electron App
|
|
|
|
|
|
+ - name: Build/release Electron app
|
|
uses: samuelmeuli/action-electron-builder@v1
|
|
uses: samuelmeuli/action-electron-builder@v1
|
|
with:
|
|
with:
|
|
package_root: "./server"
|
|
package_root: "./server"
|
|
build_script_name: "build-electron"
|
|
build_script_name: "build-electron"
|
|
|
|
+ # GitHub token, automatically provided to the action
|
|
|
|
+ # (No need to define this secret in the repo settings)
|
|
github_token: ${{ secrets.GH_TOKEN }}
|
|
github_token: ${{ secrets.GH_TOKEN }}
|
|
- release: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
|
|
|
|
|
|
- # Job to build each Docker platform separately
|
|
|
|
- docker_build:
|
|
|
|
- runs-on: ubuntu-latest
|
|
|
|
- strategy:
|
|
|
|
- matrix:
|
|
|
|
- platform: [linux/amd64, linux/arm64, linux/arm/v7]
|
|
|
|
-
|
|
|
|
- steps:
|
|
|
|
- - name: Check out Git repository
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
-
|
|
|
|
- - name: Set up Docker Buildx
|
|
|
|
- uses: docker/setup-buildx-action@v3
|
|
|
|
-
|
|
|
|
- - name: Login to DockerHub
|
|
|
|
- uses: docker/login-action@v1
|
|
|
|
- with:
|
|
|
|
- username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
- password: ${{ secrets.DOCKER_PWD }}
|
|
|
|
-
|
|
|
|
- - name: Build and Push Docker Image for ${{ matrix.platform }}
|
|
|
|
- uses: docker/build-push-action@v5
|
|
|
|
- with:
|
|
|
|
- context: .
|
|
|
|
- platforms: ${{ matrix.platform }}
|
|
|
|
- tags: |
|
|
|
|
- zilliz/attu:${{ github.ref_name }}-${{ matrix.platform }}
|
|
|
|
- build-args: |
|
|
|
|
- VERSION=${{ github.ref_name }}
|
|
|
|
- push: true
|
|
|
|
-
|
|
|
|
- # Job to combine platform-specific tags into one multi-platform tag
|
|
|
|
- docker_manifest:
|
|
|
|
- needs: docker_build
|
|
|
|
- runs-on: ubuntu-latest
|
|
|
|
- steps:
|
|
|
|
- - name: Install Docker CLI
|
|
|
|
- run: sudo apt-get update && sudo apt-get install -y docker.io
|
|
|
|
-
|
|
|
|
- - name: Login to DockerHub
|
|
|
|
- uses: docker/login-action@v1
|
|
|
|
- with:
|
|
|
|
- username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
- password: ${{ secrets.DOCKER_PWD }}
|
|
|
|
-
|
|
|
|
- - name: Create and Push Docker Manifest
|
|
|
|
- run: |
|
|
|
|
- docker manifest create zilliz/attu:${{ github.ref_name }} \
|
|
|
|
- --amend zilliz/attu:${{ github.ref_name }}-linux/amd64 \
|
|
|
|
- --amend zilliz/attu:${{ github.ref_name }}-linux/arm64 \
|
|
|
|
- --amend zilliz/attu:${{ github.ref_name }}-linux/arm/v7
|
|
|
|
- docker manifest push zilliz/attu:${{ github.ref_name }}
|
|
|
|
|
|
+ # If the commit is tagged with a version (e.g. "v1.0.0"),
|
|
|
|
+ # release the app after building
|
|
|
|
+ release: ${{ startsWith(github.ref, 'refs/tags/v') }}
|