Skip to content

Commit

Permalink
Update pub.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilaz authored Jun 29, 2024
1 parent ccbe853 commit c84527f
Showing 1 changed file with 59 additions and 52 deletions.
111 changes: 59 additions & 52 deletions .github/workflows/pub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,64 +11,71 @@ jobs:
contents: write
strategy:
fail-fast: false
matrix:
include:
# - platform: 'macos-latest' # for Arm based macs (M1 and above).
# args: '--target aarch64-apple-darwin'
# - platform: 'macos-latest' # for Intel based macs.
# args: '--target x86_64-apple-darwin'
# - platform: 'ubuntu-20.04' # for x86_64 linux
# args: ''
# - platform: 'ubuntu-20.04' # for ARMv7 linux
# args: '--target armv7-unknown-linux-gnueabihf'
- platform: 'ubuntu-20.04' # for ARM64 linux
args: '--target aarch64-unknown-linux-gnu'
# - platform: 'windows-latest'
# args: ''

runs-on: ${{ matrix.platform }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: setup node
uses: actions/setup-node@v4
- uses: pguyot/[email protected]
with:
node-version: 20

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
base_image: raspios_lite_arm64:latest
bind_mount_repository: true
image_additional_mb: 10240
optimize_image: false
commands: |
# Rust complains (rightly) that $HOME doesn't match 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 upgrade -y
apt-get autoremove -y
apt-get install nodejs curl -y
curl https://sh.rustup.rs -sSf | sh -s -- -y
. "$HOME/.cargo/env"
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash
# Install build tools and tauri-cli requirements
apt-get install -y libwebkit2gtk-4.0-dev build-essential wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
cargo install tauri-cli
# Install frontend dependencies
npm install
# Build the application
cargo tauri build --target aarch64-unknown-linux-gnu
- uses: pguyot/[email protected]
with:
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || matrix.args == '--target aarch64-unknown-linux-gnu' && 'aarch64-unknown-linux-gnu' || '' }}

- name: install dependencies (ubuntu x86 only)
if: matrix.platform == 'ubuntu-20.04' && matrix.args == '' # This must match the platform value defined above.
base_image: raspios_lite:latest
bind_mount_repository: true
image_additional_mb: 10240
optimize_image: false
commands: |
# Rust complains (rightly) that $HOME doesn't match 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 upgrade -y
apt-get autoremove -y
apt-get install nodejs curl -y
curl https://sh.rustup.rs -sSf | sh -s -- -y
. "$HOME/.cargo/env"
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash
# Install build tools and tauri-cli requirements
apt-get install -y libwebkit2gtk-4.0-dev build-essential wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
cargo install tauri-cli
# Install frontend dependencies
npm install
# Build the application
cargo tauri build --target armv7-unknown-linux-gnueabihf
- name: list
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: install dependencies (ubuntu ARM64 only)
if: matrix.platform == 'ubuntu-20.04' && matrix.args == '--target aarch64-unknown-linux-gnu' # This must match the platform value defined above.
run: |
sudo echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports focal main restricted \
deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports focal-updates main restricted \
deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports focal universe \
deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports focal-updates universe \
deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports focal multiverse \
deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports focal-updates multiverse \
deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports focal-backports main restricted universe multiverse \
deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports focal-security main restricted \
deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports focal-security universe \
deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports focal-security multiverse" >> /etc/apt/sources.list
sudo apt-get update
sudo apt install gcc-aarch64-linux-gnu
sudo dpkg --add-architecture arm64
sudo apt-get update && sudo apt-get upgrade -y
sudo apt install libwebkit2gtk-4.0-dev:arm64 libappindicator3-dev:arm64 librsvg2-dev:arm64 patchelf:arm64 libssl-dev:arm64
export PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu/
ls ${{ github.workspace }}/target/release/bundle/deb/
- name: install frontend dependencies
run: npm install # change this to npm or pnpm depending on which one you use
- name: Upload deb bundle
uses: actions/upload-artifact@v3
with:
name: Debian Bundle
path: ${{ github.workspace }}/target/release/bundle/deb/tauri_1.4_arm.deb

- uses: tauri-apps/tauri-action@v0
env:
Expand Down

0 comments on commit c84527f

Please sign in to comment.