Skip to content

build: Let's try android CI. What could go wrong. #14

build: Let's try android CI. What could go wrong.

build: Let's try android CI. What could go wrong. #14

Workflow file for this run

name: Intiface Central Build
# Only build on master pushes for now, otherwise we'll eat CI.
on:
push:
branches:
- main
- dev
- ci
jobs:
# windows:
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v3
# - name: rust toolchain
# uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# toolchain: stable
# override: true
# - uses: subosito/flutter-action@v2
# with:
# channel: 'stable'
# cache: true
# cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
# - run: flutter config --enable-windows-desktop
# name: flutter config
# - run: flutter build windows --release
# name: flutter build
# - uses: dlemstra/code-sign-action@v1
# with:
# certificate: '${{ secrets.NPLABS_WINDOWS_202205_CERT }}'
# password: '${{ secrets.NPLABS_WINDOWS_202205_KEY }}'
# folder: '.\build\windows\runner\Release'
# recursive: false
# files: |
# intiface_central.exe
# description: 'Sign Intiface Central Executable'
# - name: Build Innosetup Installer
# shell: pwsh
# run: |
# iscc .\intiface-central-installer.iss
# - uses: dlemstra/code-sign-action@v1
# with:
# certificate: '${{ secrets.NPLABS_WINDOWS_202205_CERT }}'
# password: '${{ secrets.NPLABS_WINDOWS_202205_KEY }}'
# folder: '.\installer\'
# recursive: false
# files: |
# intiface-central-installer.exe
# description: 'Sign Intiface Central Installer'
# - name: Archive production artifacts
# uses: actions/upload-artifact@v3
# with:
# name: windows-installer
# path: |
# installer/intiface-central-installer.exe
# linux:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: rust toolchain
# uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# toolchain: stable
# override: true
# - uses: subosito/flutter-action@v2
# with:
# channel: 'stable'
# cache: true
# cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
# - run: |
# sudo apt-get update -y
# sudo apt-get install -y ninja-build libudev-dev libgtk-3-dev
# - run: flutter config --enable-linux-desktop
# name: flutter config
# - run: flutter build linux --release
# name: flutter build
# - name: Zip Release
# run: zip -r intiface-central-linux-x64.zip build/linux/x64/release/bundle
# - name: Archive production artifacts
# uses: actions/upload-artifact@v3
# with:
# name: linux-zip
# path: ./intiface-central-linux-x64.zip
# macos:
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v3
# - name: rust toolchain
# uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# toolchain: stable
# override: true
# - uses: subosito/flutter-action@v2
# with:
# channel: 'stable'
# cache: true
# cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
# - run: flutter config --enable-macos-desktop
# name: flutter config
# - run: flutter build macos --release
# name: flutter build
# - name: Zip Release
# run: zip -r intiface-central-macos-universal.zip build/macos/Build/Products/Release/intiface_central.app
# - name: Archive production artifacts
# uses: actions/upload-artifact@v3
# with:
# name: macos-zip
# path: ./intiface-central-macos-universal.zip
android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '17'
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r25b
local-cache: true
- name: rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
target: arm64-v8a
toolchain: stable
override: true
- name: rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
target: armeabi-v7a
toolchain: stable
override: true
- name: Install cargo-make
run: cargo install cargo-make
- name: Build rust android library
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
run: cargo make build-android
working-directory: intiface-central-flutter-bridge
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- run: flutter config
name: flutter config
- run: flutter build apk
name: flutter build apk
- run: flutter build appbundle
name: flutter build appbundle
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: Android APK
path: build\app\outputs\flutter-apk\*.apk