Skip to content

Workflow file for this run

name: Build artifacts for amd64 and arm64
on:
push:
tags:
- '*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-for-amd64:
runs-on: ubuntu-20.04
container: debian:bookworm
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- run: |
apt update -y
apt install -y sudo git git-lfs nodejs npm zip unzip curl file debianutils xz-utils pkg-config build-essential jq docker.io
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
lfs: true
- id: flutter-action
uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path
architecture: x64 # optional, x64 or arm64
- name: Install dependencies
run: |
./install_dependencies_debian.sh
- name: Build amd64 artifacts
run: |
git config --global --add safe.directory ${{ runner.tool_cache }}/flutter/${{ steps.flutter-action.outputs.CHANNEL }}-${{ steps.flutter-action.outputs.VERSION }}-${{ steps.flutter-action.outputs.ARCHITECTURE }}
flutter config --enable-linux-desktop
flutter doctor
flutter pub get
make release_bundle -j16
make deb_package VERSION=${{ github.ref_name }}
- name: Archive amd64 bundle
uses: thedoctor0/zip-release@master
with:
type: 'zip'
directory: 'build/zenith/release/bundle/'
filename: 'bundle_amd64.zip'
- uses: actions/upload-artifact@v3
with:
name: 'amd64_bundle'
path: 'build/zenith/release/bundle/*.zip'
- uses: actions/upload-artifact@v3
with:
name: 'amd64_deb'
path: 'build/zenith/release/deb/*.deb'
build-for-arm64:
runs-on: ubuntu-22.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
lfs: true
- uses: roscale/run-on-arch-action@bookworm-host
name: Build arm64 artifacts
id: arm64_artifacts
with:
arch: aarch64
distro: bookworm
run: |
apt update -y
apt install -y sudo curl file git unzip debianutils xz-utils zip pkg-config build-essential
./install_dependencies_debian.sh
git clone -b stable https://github.com/flutter/flutter.git
export PATH="$PATH:$PWD/flutter/bin"
flutter config --enable-linux-desktop
flutter doctor
# Patch Flutter engine
# https://github.com/flutter/flutter/issues/116703
curl -O https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_`flutter --version | head -n 1 | awk '{print $2}'`-`flutter --version | head -n 1 | awk '{print $5}'`.tar.xz
tar -xvf flutter_linux_`flutter --version | head -n 1 | awk '{print $2}'`-`flutter --version | head -n 1 | awk '{print $5}'`.tar.xz flutter/bin/cache/artifacts/engine/linux-x64/shader_lib
cp -R flutter/bin/cache/artifacts/engine/linux-x64/shader_lib flutter/bin/cache/artifacts/engine/linux-arm64
flutter pub get
make deb_package -j16 VERSION=${{ github.ref_name }}
- uses: actions/upload-artifact@v3
with:
name: 'arm64_deb'
path: 'build/zenith/release/deb/*.deb'
create-release:
needs: [ build-for-amd64, build-for-arm64 ]
runs-on: ubuntu-20.04
steps:
- uses: actions/download-artifact@v3
with:
name: 'amd64_bundle'
- uses: actions/download-artifact@v3
with:
name: 'amd64_deb'
- uses: actions/download-artifact@v3
with:
name: 'arm64_deb'
- name: Create a release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ github.ref_name }}"
title: "Zenith ${{ github.ref_name }}"
prerelease: false
files: |
*.zip
*.deb