Skip to content

updated build-verify.yml #439

updated build-verify.yml

updated build-verify.yml #439

Workflow file for this run

name: 'Build Test'
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
inputs:
runner-type:
type: choice
description: 'The type of runner to use'
required: true
default: 'ubuntu-22.04'
options:
- 'ubuntu-22.04'
- 'debian-arm64-latest'
build-for:
type: choice
description: 'The target to build for'
required: true
default: 'desktop'
options:
- 'desktop'
- 'android'
env:
ANDROID_NDK_VERSION: 'r26d'
jobs:
build:
runs-on: ${{ github.event.inputs.runner-type || 'ubuntu-22.04' }}
steps:
- uses: actions/checkout@v4
- name: Install Required Packages
if: runner.os == 'Linux' && github.event.inputs.build-for == 'desktop'
run: |
sudo apt-get update
sudo apt-get install -y build-essential curl wget file libssl-dev libayatana-appindicator3-dev \
libwebkit2gtk-4.1-dev librsvg2-dev
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust Project
uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ runner.os }}-${{ github.event.inputs.runner-type }}-rust
workspaces: src-tauri
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install NPM Dependencies
run: npm ci
- name: Setup JDK
uses: actions/setup-java@v4
if: github.event.inputs.build-for == 'android'
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Android SDK
if: github.event.inputs.build-for == 'android'
uses: nttld/setup-android@v3
with:
packages: "build-tools;34.0.0 ndk;${{ env.ANDROID_NDK_VERSION }} platforms;android-33"
- name: Check lint
run: npm run ng lint
- name: Build the app (desktop)
if: github.event.inputs.build-for == 'desktop'
run: npm run build -- --features=vendored-openssl
- name: Build the app (android)
if: github.event.inputs.build-for == 'android'
run: |
npm run tauri android init
npm run tauri android build
env:
NDK_HOME: "${{ env.ANDROID_HOME }}/ndk/${{ env.ANDROID_NDK_VERSION }}"