Skip to content

Commit 29a6e7c

Browse files
committed
added version sync script and fixed artifact paths
1 parent ee090a5 commit 29a6e7c

5 files changed

Lines changed: 41 additions & 8 deletions

File tree

.github/workflows/build.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,16 @@ jobs:
5858
libssl-dev \
5959
libgtk-3-dev \
6060
libayatana-appindicator3-dev \
61-
librsvg2-dev
61+
librsvg2-dev \
62+
libfuse2
6263
6364
# Install linuxdeploy for AppImage bundling
6465
wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
6566
chmod +x linuxdeploy-x86_64.AppImage
66-
sudo mv linuxdeploy-x86_64.AppImage /usr/local/bin/linuxdeploy
67+
# Extract and run without FUSE for CI compatibility
68+
./linuxdeploy-x86_64.AppImage --appimage-extract
69+
sudo mv squashfs-root/AppRun /usr/local/bin/linuxdeploy
70+
sudo cp -r squashfs-root/usr/* /usr/local/
6771
6872
- name: Cache cargo registry
6973
uses: actions/cache@v4
@@ -91,17 +95,21 @@ jobs:
9195

9296
- name: Upload .deb artifact (Linux)
9397
if: matrix.platform == 'ubuntu-22.04'
98+
continue-on-error: true
9499
uses: actions/upload-artifact@v4
95100
with:
96101
name: spent-linux-deb
97102
path: ${{ matrix.artifact_path }}
103+
if-no-files-found: warn
98104

99105
- name: Upload .AppImage artifact (Linux)
100106
if: matrix.platform == 'ubuntu-22.04'
107+
continue-on-error: true
101108
uses: actions/upload-artifact@v4
102109
with:
103110
name: spent-linux-appimage
104111
path: ${{ matrix.appimage_path }}
112+
if-no-files-found: warn
105113

106114
- name: Upload .exe artifact (Windows)
107115
if: matrix.platform == 'windows-latest'

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"name": "spent",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "A minimalist, local-first personal finance tracker",
55
"type": "module",
66
"scripts": {
7-
"dev": "vite",
8-
"build": "vite build",
7+
"sync-version": "node scripts/sync-version.js",
8+
"dev": "npm run sync-version && vite",
9+
"build": "npm run sync-version && vite build",
910
"preview": "vite preview",
1011
"tauri": "tauri",
1112
"check": "svelte-check --tsconfig ./tsconfig.json"

scripts/sync-version.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env node
2+
import { readFileSync, writeFileSync } from 'fs';
3+
import { fileURLToPath } from 'url';
4+
import { dirname, join } from 'path';
5+
6+
const __dirname = dirname(fileURLToPath(import.meta.url));
7+
const rootDir = join(__dirname, '..');
8+
9+
const packageJson = JSON.parse(readFileSync(join(rootDir, 'package.json'), 'utf-8'));
10+
const version = packageJson.version;
11+
12+
console.log(`Syncing version to ${version}...`);
13+
14+
const tauriConfPath = join(rootDir, 'src-tauri', 'tauri.conf.json');
15+
const tauriConf = JSON.parse(readFileSync(tauriConfPath, 'utf-8'));
16+
tauriConf.version = version;
17+
writeFileSync(tauriConfPath, JSON.stringify(tauriConf, null, 2) + '\n');
18+
19+
const cargoTomlPath = join(rootDir, 'src-tauri', 'Cargo.toml');
20+
let cargoToml = readFileSync(cargoTomlPath, 'utf-8');
21+
cargoToml = cargoToml.replace(/^version = ".*"$/m, `version = "${version}"`);
22+
writeFileSync(cargoTomlPath, cargoToml);

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "spent"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
description = "A minimalist, local-first personal finance tracker"
55
authors = ["you"]
66
edition = "2021"

src-tauri/tauri.conf.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2.0",
33
"productName": "Spent",
4-
"version": "1.0.0",
4+
"version": "1.0.1",
55
"identifier": "com.spent.app",
66
"build": {
77
"beforeDevCommand": "npm run dev",
@@ -27,7 +27,9 @@
2727
{
2828
"identifier": "main-capability",
2929
"description": "Main application capabilities",
30-
"windows": ["main"],
30+
"windows": [
31+
"main"
32+
],
3133
"permissions": [
3234
"core:default",
3335
"dialog:allow-save",

0 commit comments

Comments
 (0)