Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Broken-Deer committed Aug 14, 2024
1 parent 8e98a77 commit 2300489
Showing 1 changed file with 83 additions and 84 deletions.
167 changes: 83 additions & 84 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,90 +8,89 @@ env:
VERSION: 0.1.0

jobs:
build-arm-linux:
runs-on: ubuntu-22.04

strategy:
matrix:
arch: [aarch64, armv7l]
include:
- arch: aarch64
cpu: cortex-a72
base_image: https://dietpi.com/downloads/images/DietPi_RPi-ARMv8-Bookworm.img.xz
deb: arm64
rpm: aarch64
appimage: aarch64
- arch: armv7l
cpu: cortex-a53
deb: armhfp
rpm: arm
appimage: armhf
base_image: https://dietpi.com/downloads/images/DietPi_RPi-ARMv7-Bookworm.img.xz

steps:
- uses: actions/checkout@v3

- name: Cache rust build artifacts
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
cache-on-failure: true

- name: Build app
uses: pguyot/arm-runner-action@v2.6.5
with:
base_image: ${{ matrix.base_image }}
cpu: ${{ matrix.cpu }}
bind_mount_repository: true
image_additional_mb: 10240
optimize_image: no
#exit_on_fail: no
commands: |
# Prevent Rust from complaining about $HOME not matching eid home
export HOME=/root
# Workaround to CI worker being stuck on Updating crates.io index
export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
# Install setup prerequisites
apt-get update -y --allow-releaseinfo-change
apt-get autoremove -y
apt-get install -y --no-install-recommends --no-install-suggests curl libwebkit2gtk-4.1-dev build-essential libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev patchelf libfuse2 file
curl https://sh.rustup.rs -sSf | sh -s -- -y
. "$HOME/.cargo/env"
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash
apt-get install -y nodejs
# Install yarn
npm install -g yarn
# Install frontend dependencies
yarn install
# Build the application
yarn tauri build -- --verbose
- name: Get app version
run: echo "APP_VERSION=$(jq -r .version src-tauri/tauri.conf.json)" >> $GITHUB_ENV

# TODO: Combine this with the basic workflow and upload the files to the Release.
- name: Upload deb bundle
uses: actions/upload-artifact@v3
with:
name: Debian Bundle
path: ${{ github.workspace }}/src-tauri/target/release/bundle/deb/appname_${{ env.APP_VERSION }}_${{ matrix.deb }}.deb

- name: Upload rpm bundle
uses: actions/upload-artifact@v3
with:
name: RPM Bundle
path: ${{ github.workspace }}/src-tauri/target/release/bundle/rpm/appname-${{ env.APP_VERSION }}-1.${{ matrix.rpm }}.rpm

- name: Upload appimage bundle
uses: actions/upload-artifact@v3
with:
name: AppImage Bundle
path: ${{ github.workspace }}/src-tauri/target/release/bundle/appimage/appname_${{ env.APP_VERSION }}_${{ matrix.appimage }}.AppImage
# build-arm-linux:
# runs-on: ubuntu-22.04
#
# strategy:
# matrix:
# arch: [aarch64, armv7l]
# include:
# - arch: aarch64
# cpu: cortex-a72
# base_image: https://dietpi.com/downloads/images/DietPi_RPi-ARMv8-Bookworm.img.xz
# deb: arm64
# rpm: aarch64
# appimage: aarch64
# - arch: armv7l
# cpu: cortex-a53
# deb: armhfp
# rpm: arm
# appimage: armhf
# base_image: https://dietpi.com/downloads/images/DietPi_RPi-ARMv7-Bookworm.img.xz
#
# steps:
# - uses: actions/checkout@v3
#
# - name: Cache rust build artifacts
# uses: Swatinem/rust-cache@v2
# with:
# workspaces: src-tauri
# cache-on-failure: true
#
# - name: Build app
# uses: pguyot/arm-runner-action@v2.6.5
# with:
# base_image: ${{ matrix.base_image }}
# cpu: ${{ matrix.cpu }}
# bind_mount_repository: true
# image_additional_mb: 10240
# optimize_image: no
# #exit_on_fail: no
# commands: |
# # Prevent Rust from complaining about $HOME not matching eid home
# export HOME=/root
#
# # Workaround to CI worker being stuck on Updating crates.io index
# export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
#
# # Install setup prerequisites
# apt-get update -y --allow-releaseinfo-change
# apt-get autoremove -y
# apt-get install -y --no-install-recommends --no-install-suggests curl libwebkit2gtk-4.1-dev build-essential libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev patchelf libfuse2 file
# curl https://sh.rustup.rs -sSf | sh -s -- -y
# . "$HOME/.cargo/env"
# curl -fsSL https://deb.nodesource.com/setup_lts.x | bash
# apt-get install -y nodejs
#
# # Install yarn
# npm install -g yarn
#
# # Install frontend dependencies
# yarn install
#
# # Build the application
# yarn tauri build -- --verbose
#
# - name: Get app version
# run: echo "APP_VERSION=$(jq -r .version src-tauri/tauri.conf.json)" >> $GITHUB_ENV
#
# - name: Upload deb bundle
# uses: actions/upload-artifact@v3
# with:
# name: Debian Bundle
# path: ${{ github.workspace }}/src-tauri/target/release/bundle/deb/appname_${{ env.APP_VERSION }}_${{ matrix.deb }}.deb
#
# - name: Upload rpm bundle
# uses: actions/upload-artifact@v3
# with:
# name: RPM Bundle
# path: ${{ github.workspace }}/src-tauri/target/release/bundle/rpm/appname-${{ env.APP_VERSION }}-1.${{ matrix.rpm }}.rpm
#
# - name: Upload appimage bundle
# uses: actions/upload-artifact@v3
# with:
# name: AppImage Bundle
# path: ${{ github.workspace }}/src-tauri/target/release/bundle/appimage/appname_${{ env.APP_VERSION }}_${{ matrix.appimage }}.AppImage
build-other:
permissions:
contents: write
Expand Down

0 comments on commit 2300489

Please sign in to comment.