Skip to content

Commit b42eece

Browse files
committed
non nixos appimage build
1 parent 0f21a20 commit b42eece

File tree

2 files changed

+32
-137
lines changed

2 files changed

+32
-137
lines changed

.github/workflows/release.yml

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,46 +16,58 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
include:
19-
- system: x86_64-linux
19+
- arch: x86_64
2020
runner: ubuntu-latest
21-
- system: aarch64-linux
21+
- arch: aarch64
2222
runner: ubuntu-24.04-arm
2323

2424
runs-on: ${{ matrix.runner }}
2525

2626
steps:
2727
- uses: actions/checkout@v4
2828

29-
- name: Install Nix
30-
uses: DeterminateSystems/determinate-nix-action@v3
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: 20
33+
cache: npm
34+
35+
- name: Install Rust
36+
uses: dtolnay/rust-action@stable
3137

3238
- name: Setup swap space
3339
uses: actionhippie/swap-space@v1
3440
with:
3541
size: 8G
3642

37-
- name: Build with Nix
38-
run: nix build .#packages.${{ matrix.system }}.default --accept-flake-config
39-
40-
- name: Create portable bundle
43+
- name: Install system dependencies
4144
run: |
42-
# Create a self-contained bundle with all Nix dependencies
43-
nix bundle .#packages.${{ matrix.system }}.default --accept-flake-config -o korppi-bundle
44-
ls -la korppi-bundle* || true
45+
sudo apt-get update
46+
sudo apt-get install -y \
47+
libwebkit2gtk-4.1-dev \
48+
libayatana-appindicator3-dev \
49+
librsvg2-dev \
50+
libfuse2
51+
52+
- name: Install npm dependencies
53+
run: npm ci
4554

46-
- name: Upload bundle
55+
- name: Build with Tauri
56+
run: npm run tauri build
57+
58+
- name: Upload AppImage
4759
uses: actions/upload-artifact@v4
4860
with:
49-
name: korppi-${{ matrix.system }}-bundle
50-
path: korppi-bundle*
61+
name: korppi-linux-${{ matrix.arch }}-appimage
62+
path: src-tauri/target/release/bundle/appimage/*.AppImage
5163
if-no-files-found: warn
5264

53-
- name: Upload binary (for NixOS)
65+
- name: Upload binary
5466
uses: actions/upload-artifact@v4
5567
with:
56-
name: korppi-${{ matrix.system }}-nix
57-
path: result/bin/*
58-
if-no-files-found: error
68+
name: korppi-linux-${{ matrix.arch }}-bin
69+
path: src-tauri/target/release/korppi-prototype
70+
if-no-files-found: warn
5971

6072

6173
# ─────────────────────────────────────────────

flake.nix

Lines changed: 2 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -111,125 +111,8 @@
111111
in
112112
{
113113
############################################################
114-
# PACKAGES
115-
############################################################
116-
packages = rec {
117-
# Build frontend first (needs network access)
118-
frontend = pkgs.buildNpmPackage {
119-
pname = "korppi-frontend";
120-
version = "0.1.0";
121-
src = ./.;
122-
123-
npmDepsHash = "sha256-EQrl4cNLxpkv+2s9kqqP5aFrjOmQLGKqghONdM/p7UM=";
124-
125-
buildPhase = ''
126-
npm run build
127-
'';
128-
129-
installPhase = ''
130-
mkdir -p $out
131-
cp -r dist $out/
132-
'';
133-
};
134-
135-
# Builds the Rust Tauri backend
136-
korppi-bin = pkgs.rustPlatform.buildRustPackage {
137-
pname = "korppi-prototype";
138-
version = "0.1.0";
139-
140-
src = ./.;
141-
142-
cargoRoot = "src-tauri";
143-
144-
cargoLock = {
145-
lockFile = ./src-tauri/Cargo.lock;
146-
};
147-
148-
nativeBuildInputs = [
149-
pkgs.pkg-config
150-
pkgs.cmake
151-
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [
152-
pkgs.mold
153-
pkgs.clang
154-
];
155-
156-
buildInputs = commonDeps ++ darwinDeps ++ linuxDeps ++ [
157-
pkgs.bzip2
158-
];
159-
160-
doCheck = false;
161-
162-
RUSTFLAGS = pkgs.lib.optionalString pkgs.stdenv.isLinux "-C linker=clang -C link-arg=-fuse-ld=mold";
163-
164-
preBuild = ''
165-
cp -r ${frontend}/dist ./dist
166-
cd src-tauri
167-
'';
168-
};
169-
170-
# Create AppImage using nix-bundle approach
171-
appimage = pkgs.stdenv.mkDerivation {
172-
pname = "korppi-appimage";
173-
version = "0.1.0";
174-
175-
nativeBuildInputs = [ pkgs.appimage-run pkgs.squashfsTools ];
176-
177-
# No source needed, we're wrapping an existing derivation
178-
dontUnpack = true;
179-
180-
buildPhase = ''
181-
# Create a wrapper script that sets up the Nix environment
182-
mkdir -p AppDir/usr/bin
183-
184-
# Copy the binary
185-
cp ${korppi-bin}/bin/korppi-prototype AppDir/usr/bin/korppi
186-
187-
# Create desktop file
188-
cat > AppDir/korppi.desktop <<EOF
189-
[Desktop Entry]
190-
Name=Korppi
191-
Exec=korppi
192-
Type=Application
193-
Categories=Utility;Office;
194-
Icon=korppi
195-
Terminal=false
196-
EOF
197-
198-
# Create minimal icon
199-
mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps
200-
echo '' > AppDir/usr/share/icons/hicolor/256x256/apps/korppi.png
201-
202-
# Create AppRun that sets library paths
203-
cat > AppDir/AppRun <<'APPRUN'
204-
#!/bin/bash
205-
SELF=$(readlink -f "$0")
206-
HERE=$(dirname "$SELF")
207-
export PATH="$HERE/usr/bin:$PATH"
208-
export LD_LIBRARY_PATH="$HERE/usr/lib:$LD_LIBRARY_PATH"
209-
exec "$HERE/usr/bin/korppi" "$@"
210-
APPRUN
211-
chmod +x AppDir/AppRun
212-
213-
# Copy all required libraries from Nix store
214-
mkdir -p AppDir/usr/lib
215-
for lib in $(ldd ${korppi-bin}/bin/korppi-prototype | grep "=> /nix" | awk '{print $3}'); do
216-
cp -L "$lib" AppDir/usr/lib/ 2>/dev/null || true
217-
done
218-
'';
219-
220-
installPhase = ''
221-
mkdir -p $out
222-
cp -r AppDir $out/
223-
# The actual AppImage creation would need appimagetool
224-
# For now, output the AppDir which can be run directly
225-
'';
226-
};
227-
228-
default = korppi-bin;
229-
};
230-
231-
############################################################
232-
# DEV SHELL
114+
# DEV SHELL - provides development environment
115+
# CI uses non-Nix approach for building releases
233116
############################################################
234117
devShells.default = pkgs.mkShell {
235118
buildInputs = commonDeps ++ darwinDeps ++ linuxDeps ++ [

0 commit comments

Comments
 (0)