chore(ci/cd): Modify release workflow to build gpui version of the application and fix appimages (#64)

* fix(ci/cd): release build workflow failing due to wrong github action syntax

* feat(ci/cd): add appimage build script that uses linuxdeploy

* feat(ci/cd): add caching to release workflow
This commit is contained in:
Suyog Tandel
2026-02-19 12:27:34 +05:30
committed by GitHub
parent e990de9ae6
commit c046f60ef0
2 changed files with 74 additions and 6 deletions
+56
View File
@@ -0,0 +1,56 @@
#!/bin/bash
set -e
ARCH=$(uname -m)
if [ "$ARCH" == "x86_64" ]; then
LINUXDEPLOY_ARCH="x86_64"
elif [ "$ARCH" == "aarch64" ]; then
LINUXDEPLOY_ARCH="aarch64"
else
echo "Unsupported architecture: $ARCH"
exit 1
fi
echo "Building AppImage for architecture: $ARCH"
echo "Downloading linuxdeploy..."
wget "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${LINUXDEPLOY_ARCH}.AppImage"
chmod +x linuxdeploy-${LINUXDEPLOY_ARCH}.AppImage
export APPIMAGE_EXTRACT_AND_RUN=1
BINARY_PATH="target/release/picoforge"
DESKTOP_FILE="data/in.suyogtandel.picoforge.desktop"
ICON_FILE="static/appIcons/in.suyogtandel.picoforge.svg"
if [ ! -f "$BINARY_PATH" ]; then
echo "Error: Binary not found at $BINARY_PATH"
exit 1
fi
if [ ! -f "$DESKTOP_FILE" ]; then
echo "Error: Desktop file not found at $DESKTOP_FILE"
exit 1
fi
if [ ! -f "$ICON_FILE" ]; then
echo "Error: Icon file not found at $ICON_FILE"
exit 1
fi
echo "Running linuxdeploy..."
./linuxdeploy-${LINUXDEPLOY_ARCH}.AppImage \
--appdir AppDir \
--executable "$BINARY_PATH" \
--desktop-file "$DESKTOP_FILE" \
--icon-file "$ICON_FILE" \
--exclude-library libpcsclite.so.1 \
--output appimage
rm "linuxdeploy-${LINUXDEPLOY_ARCH}.AppImage"
mkdir -p target/release
mv *.AppImage target/release/
echo "AppImage build complete. Artifacts moved to target/release/"
ls -l target/release/*.AppImage
+18 -6
View File
@@ -43,6 +43,11 @@ jobs:
${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' ||
matrix.platform == 'windows-latest' && 'x86_64-pc-windows-msvc,i686-pc-windows-msvc,aarch64-pc-windows-msvc' || '' }}
- name: Cache Cargo registry and target
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.platform }}-${{ matrix.args }}
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04' || matrix.platform == 'ubuntu-24.04-arm'
run: |
@@ -88,17 +93,25 @@ jobs:
echo "version=$version" >> $GITHUB_ENV
- name: install cargo-packager
uses: taiki-e/install-action@cargo-packager
uses: taiki-e/install-action@v2
with:
tool: cargo-packager
- name: Build Binary
run: cargo build --release ${{ matrix.args }}
# - name: Build and Package (Linux)
# if: matrix.platform == 'ubuntu-22.04' || matrix.platform == 'ubuntu-24.04-arm'
# run: cargo packager --release --formats deb,pacman
- name: Build and Package (Linux)
if: matrix.platform == 'ubuntu-22.04' || matrix.platform == 'ubuntu-24.04-arm'
run: cargo packager --release --formats deb,pacman
- name: Build AppImage
if: matrix.platform == 'ubuntu-22.04' || matrix.platform == 'ubuntu-24.04-arm'
run: |
chmod +x .github/scripts/build_appimage.sh
./.github/scripts/build_appimage.sh
- name: Build and Package
# if: matrix.platform != 'ubuntu-22.04' && matrix.platform != 'ubuntu-24.04-arm'
if: matrix.platform != 'ubuntu-22.04' && matrix.platform != 'ubuntu-24.04-arm'
run: cargo packager --release ${{ matrix.args }}
- name: Upload Release Assets
@@ -118,7 +131,6 @@ jobs:
target/release/*.AppImage
target/release/*.tar.gz
target/release/*.msi
target/release/*.exe
target/release/*.dmg
target/release/*.app
target/x86_64-apple-darwin/release/*.dmg