feat: Add AppImage build flow to release (#271)
* Add files via upload Signed-off-by: Arakandai <113034028+NewMasterDai@users.noreply.github.com> * Update build-appimage.yml requested changes Signed-off-by: Arakandai <113034028+NewMasterDai@users.noreply.github.com> * feat: App image build to release please Signed-off-by: Jacob Schlecht <dadadah@echoha.us> --------- Signed-off-by: Arakandai <113034028+NewMasterDai@users.noreply.github.com> Signed-off-by: Jacob Schlecht <dadadah@echoha.us> Co-authored-by: Arakandai <113034028+NewMasterDai@users.noreply.github.com>
This commit is contained in:
parent
f79b113da1
commit
1fbd6f7dfb
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
echo "Extracting Artifact..."
|
||||
echo "---------------------------------------------------------------"
|
||||
|
||||
mkdir -p ./AppDir/bin
|
||||
unzip /tmp/stoat/Stoat-linux-*.zip
|
||||
mv -v ./Stoat-linux-"$BUILD_ARCH"/* ./AppDir/bin
|
||||
|
||||
echo "Packaging as version $BUILD_VERSION"
|
||||
echo "$BUILD_VERSION" > ~/version
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
echo "Installing package dependencies..."
|
||||
echo "---------------------------------------------------------------"
|
||||
pacman -Syu --noconfirm libnss_nis nss-mdns nss pipewire
|
||||
|
||||
echo "Installing debloated packages..."
|
||||
echo "---------------------------------------------------------------"
|
||||
get-debloated-pkgs --add-common --prefer-nano
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
ARCH=$(uname -m)
|
||||
export ARCH
|
||||
export OUTPATH=./dist
|
||||
export ADD_HOOKS="self-updater.hook"
|
||||
export UPINFO="gh-releases-zsync|${GITHUB_REPOSITORY%/*}|${GITHUB_REPOSITORY#*/}|latest|*$ARCH.AppImage.zsync"
|
||||
export ICON=https://raw.githubusercontent.com/stoatchat/assets/f106946659af67ad4f008588ac51570029b2fd47/desktop/icon.png
|
||||
export DESKTOP=https://raw.githubusercontent.com/stoatchat/for-desktop/refs/heads/main/chat.stoat.StoatDesktop.desktop
|
||||
export DEPLOY_PIPEWIRE=1
|
||||
|
||||
# Deploy dependencies
|
||||
quick-sharun ./AppDir/bin/*
|
||||
|
||||
# Additional changes can be done in between here
|
||||
|
||||
# Turn AppDir into AppImage
|
||||
quick-sharun --make-appimage
|
||||
|
||||
# Test the app for 12 seconds, if the test fails due to the app
|
||||
# having issues running in the CI use --simple-test instead
|
||||
quick-sharun --test ./dist/*.AppImage
|
||||
|
|
@ -20,6 +20,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
release_created: ${{ steps.rp.outputs.release_created }}
|
||||
release_version: ${{ steps.rp.outputs.version }}
|
||||
steps:
|
||||
- id: app-token
|
||||
uses: actions/create-github-app-token@v2
|
||||
|
|
@ -43,7 +44,7 @@ jobs:
|
|||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest, macos-26-intel]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
|
@ -52,6 +53,15 @@ jobs:
|
|||
- name: Checkout assets
|
||||
run: git -c submodule."assets".update=checkout submodule update --init assets
|
||||
|
||||
- name: Install Flatpak Tooling and Runtimes
|
||||
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y flatpak flatpak-builder
|
||||
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
flatpak install -y --user flathub org.freedesktop.Platform//25.08 org.freedesktop.Sdk//25.08
|
||||
flatpak install -y --user flathub org.electronjs.Electron2.BaseApp//stable
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
|
|
@ -73,25 +83,64 @@ jobs:
|
|||
PLATFORM: ${{ matrix.os }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Publish macOS x64
|
||||
if: matrix.os == 'macos-latest'
|
||||
run: pnpm run publish --arch=x64
|
||||
env:
|
||||
PLATFORM: ${{ matrix.os }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Upload artifact for AppImage build
|
||||
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: stoat-linux-package-${{ case(matrix.os == 'ubuntu-latest', 'x64, 'arm64') }}
|
||||
path: ./out/make/zip/linux/${{ case(matrix.os == 'ubuntu-latest', 'x64, 'arm64') }}/Stoat-linux-*.zip
|
||||
|
||||
build-appimage:
|
||||
needs: [release-please, publish-release]
|
||||
if: needs.release-please.outputs.release_created == 'true'
|
||||
runs-on: ${{ matrix.runs-on }}
|
||||
strategy:
|
||||
matrix:
|
||||
runs-on: [ubuntu-latest, ubuntu-24.04-arm]
|
||||
container: ghcr.io/pkgforge-dev/archlinux:latest
|
||||
|
||||
- name: Install Flatpak Tooling and Runtimes
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y flatpak flatpak-builder
|
||||
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
flatpak install -y --user flathub org.freedesktop.Platform//25.08 org.freedesktop.Sdk//25.08
|
||||
flatpak install -y --user flathub org.electronjs.Electron2.BaseApp//stable
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Publish Linux arm64
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: pnpm run publish --arch=arm64
|
||||
- name: Download Artifact
|
||||
uses: actions/download-artifact@v7
|
||||
with:
|
||||
name: stoat-linux-package-${{ case(matrix.os == 'ubuntu-latest', 'x64, 'arm64') }}
|
||||
path: /tmp/stoat
|
||||
|
||||
- name: Preparing Container
|
||||
uses: pkgforge-dev/anylinux-setup-action@0964f2258d6c93d1391359978dde081fd8b3c6af # v2
|
||||
|
||||
- name: Install Dependencies
|
||||
run: /bin/sh ./.github/build/appimage/get-dependencies.sh
|
||||
|
||||
- name: Extract Artifact
|
||||
run: /bin/sh ./.github/build/appimage/extract-artifact.sh
|
||||
env:
|
||||
PLATFORM: ${{ matrix.os }}
|
||||
BUILD_ARCH: ${{ case(matrix.os == 'ubuntu-latest', 'x64, 'arm64') }}
|
||||
BUILD_VERSION: ${{ needs.release-please.outputs.release_version }}
|
||||
|
||||
- name: Make & Test AppImage
|
||||
run: /bin/sh ./.github/build/appimage/make-appimage.sh
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: AppImage-${{ case(matrix.os == 'ubuntu-latest', 'x64, 'arm64') }}
|
||||
path: dist
|
||||
|
||||
publish-appimage:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [release-please, build-appimage]
|
||||
steps:
|
||||
- name: Download Artifact
|
||||
uses: actions/download-artifact@v7
|
||||
with:
|
||||
pattern: AppImage-*
|
||||
merge-multiple: true
|
||||
|
||||
- name: Update release with AppImage
|
||||
run: gh release upload ${{ needs.release-please.outputs.release_version }} Stoat-*.AppImage
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
#MISE description="Make desktop app targets"
|
||||
#USAGE arg "[arch]" help="Make for a specific architecture" {
|
||||
#USAGE choices "x64" "arm64"
|
||||
#USAGE }
|
||||
set -e
|
||||
|
||||
pnpm run make
|
||||
if [[ -z "$usage_arch" ]]; then
|
||||
pnpm run make
|
||||
else
|
||||
pnpm run make --arch=$usage_arch
|
||||
fi
|
||||
Loading…
Reference in New Issue