Merge pull request #10 from lsk569937453/the-lines-of-code-increasing… #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Publish Linux Arm builds' | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- release | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write | |
strategy: | |
matrix: | |
arch: [aarch64] | |
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/[email protected] | |
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 frontend dependencies | |
npm install -g pnpm | |
pnpm install | |
# # Build the application | |
pnpm run tauri build -- --verbose | |
# - uses: tauri-apps/tauri-action@v0 | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# with: | |
# tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version. | |
# releaseName: 'App v__VERSION__' | |
# releaseBody: 'See the assets to download this version and install.' | |
# releaseDraft: true | |
# prerelease: false | |
# tauriBuild: false | |
# assets:| | |
# ${{ github.workspace }}/src-tauri/target/release/bundle/deb/git-statistic_${{ env.APP_VERSION }}_${{ matrix.deb }}.deb | |
# ${{ github.workspace }}/src-tauri/target/release/bundle/rpm/git-statistic-${{ env.APP_VERSION }}-1.${{ matrix.rpm }}.rpm | |
# ${{ github.workspace }}/src-tauri/target/release/bundle/appimage/git-statistic_${{ env.APP_VERSION }}_${{ matrix.appimage }}.AppImage | |
# args: ${{ matrix.args }} | |
- name: Get app version | |
run: echo "APP_VERSION=$(cargo metadata --no-deps --format-version 1 --manifest-path src-tauri/Cargo.toml | jq -r '.packages[0].version')" >> $GITHUB_ENV | |
# TODO: Combine this with the basic workflow and upload the files to the Release. | |
- name: Upload deb bundle | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
prerelease: false | |
tag_name: app-v${{ env.APP_VERSION }} | |
release_name: 'App v${{ env.APP_VERSION }}' | |
files: ${{ github.workspace }}/src-tauri/target/release/bundle/deb/git-statistic_${{ env.APP_VERSION }}_${{ matrix.deb }}.deb | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload rpm bundle | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
prerelease: false | |
tag_name: app-v${{ env.APP_VERSION }} | |
release_name: 'App v${{ env.APP_VERSION }}' | |
files: ${{ github.workspace }}/src-tauri/target/release/bundle/rpm/git-statistic-${{ env.APP_VERSION }}-1.${{ matrix.rpm }}.rpm | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload appimage bundle | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
prerelease: false | |
tag_name: app-v${{ env.APP_VERSION }} | |
release_name: 'App v${{ env.APP_VERSION }}' | |
files: ${{ github.workspace }}/src-tauri/target/release/bundle/appimage/git-statistic_${{ env.APP_VERSION }}_${{ matrix.appimage }}.AppImage | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |