Skip to content

Commit 0e9c485

Browse files
authored
Merge pull request #156 from terraphim/autoupdate
Autoupdate
2 parents 901aa3f + e90178c commit 0e9c485

44 files changed

Lines changed: 18381 additions & 264 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.tauri-release

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Terraphim AI Release Environment Variables
2+
# These references point to secrets stored in 1Password
3+
# Use with: op run --env-file=.env.tauri-release -- <command>
4+
5+
# Tauri signing keys for auto-update
6+
TAURI_PRIVATE_KEY="op://Terraphim-Deployment/Tauri Update Signing/TAURI_PRIVATE_KEY"
7+
TAURI_KEY_PASSWORD="op://Terraphim-Deployment/Tauri Update Signing/TAURI_KEY_PASSWORD"
8+
9+
# GitHub release token
10+
GITHUB_TOKEN="op://Terraphim-Deployment/GitHub Release Token/GITHUB_TOKEN"
11+
12+
# Build configuration
13+
TAURI_SIGNING_ENABLED="true"
14+
TAURI_BUILD_TARGET="release"

.github/workflows/ci-optimized.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,18 @@ jobs:
101101
docker run --rm "${IMAGE_TAG}" rustc --version
102102
docker run --rm "${IMAGE_TAG}" cargo --version
103103
104+
- name: Save Docker image
105+
run: |
106+
IMAGE_TAG="terraphim-builder:${{ github.run_number }}-${{ github.sha }}"
107+
docker save "${IMAGE_TAG}" | gzip > terraphim-builder-image.tar.gz
108+
109+
- name: Upload Docker image artifact
110+
uses: actions/upload-artifact@v4
111+
with:
112+
name: terraphim-builder-image
113+
path: terraphim-builder-image.tar.gz
114+
retention-days: 1
115+
104116
lint-and-format:
105117
runs-on: ubuntu-latest
106118
needs: [setup, build-base-image]
@@ -110,6 +122,16 @@ jobs:
110122
- name: Checkout code
111123
uses: actions/checkout@v5
112124

125+
- name: Download Docker image artifact
126+
uses: actions/download-artifact@v4
127+
with:
128+
name: terraphim-builder-image
129+
path: .
130+
131+
- name: Load Docker image
132+
run: |
133+
docker load < terraphim-builder-image.tar.gz
134+
113135
- name: Run format check
114136
run: |
115137
docker run --rm \
@@ -154,6 +176,16 @@ jobs:
154176
name: frontend-dist
155177
path: frontend-dist
156178

179+
- name: Download Docker image artifact
180+
uses: actions/download-artifact@v4
181+
with:
182+
name: terraphim-builder-image
183+
path: .
184+
185+
- name: Load Docker image
186+
run: |
187+
docker load < terraphim-builder-image.tar.gz
188+
157189
- name: Build Rust project
158190
run: |
159191
# Copy frontend dist
@@ -211,6 +243,16 @@ jobs:
211243
- name: Checkout code
212244
uses: actions/checkout@v5
213245

246+
- name: Download Docker image artifact
247+
uses: actions/download-artifact@v4
248+
with:
249+
name: terraphim-builder-image
250+
path: .
251+
252+
- name: Load Docker image
253+
run: |
254+
docker load < terraphim-builder-image.tar.gz
255+
214256
- name: Run tests
215257
run: |
216258
docker run --rm \

.github/workflows/ci-simple.yml

Lines changed: 0 additions & 118 deletions
This file was deleted.
Lines changed: 60 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
name: Publish Tauri
1+
name: Publish Tauri with Auto-Update
22
on:
33
push:
44
tags:
55
- "v*"
6+
- "app-v*"
67
workflow_dispatch:
78

89
jobs:
@@ -15,14 +16,8 @@ jobs:
1516
include:
1617
- platform: macos-latest
1718
webkit-package: ""
18-
- platform: ubuntu-18.04
19-
webkit-package: "libwebkit2gtk-4.0-dev"
20-
- platform: ubuntu-20.04
21-
webkit-package: "libwebkit2gtk-4.0-dev"
2219
- platform: ubuntu-22.04
2320
webkit-package: "libwebkit2gtk-4.1-dev"
24-
- platform: ubuntu-24.04
25-
webkit-package: "libwebkit2gtk-4.1-dev"
2621
- platform: windows-latest
2722
webkit-package: ""
2823
env:
@@ -32,31 +27,77 @@ jobs:
3227
steps:
3328
- uses: actions/checkout@v5
3429

35-
- name: setup node
30+
- name: Install 1Password CLI
31+
uses: 1password/install-cli-action@v1
32+
33+
- name: Setup Node.js
3634
uses: actions/setup-node@v5
3735
with:
3836
node-version: 20
3937

40-
- name: install Rust stable
38+
- name: Install Rust stable
4139
uses: dtolnay/rust-toolchain@stable
4240

43-
- name: install dependencies (ubuntu only)
41+
- name: Install dependencies (Ubuntu)
4442
if: startsWith(matrix.platform, 'ubuntu-')
4543
run: |
4644
sudo apt-get update
4745
sudo apt-get install -y libgtk-3-dev ${{ matrix.webkit-package }} libayatana-appindicator3-dev librsvg2-dev pkg-config
4846
49-
- name: install frontend dependencies
50-
run: yarn install # change this to npm or pnpm depending on which one you use
47+
- name: Install frontend dependencies
48+
run: yarn install
5149
working-directory: ${{env.working-directory}}
5250

53-
- uses: tauri-apps/tauri-action@v0
51+
- name: Inject secrets and build with Tauri
5452
env:
55-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
54+
working-directory: ${{env.working-directory}}
55+
run: |
56+
# Inject secrets into Tauri configuration
57+
op inject -i src-tauri/tauri.conf.json.template -o src-tauri/tauri.conf.json
58+
chmod 600 src-tauri/tauri.conf.json
59+
60+
# Create environment file for signing
61+
cat > .env.ci << 'EOF'
62+
TAURI_PRIVATE_KEY="op://Terraphim-Deployment/Tauri Update Signing/TAURI_PRIVATE_KEY"
63+
TAURI_KEY_PASSWORD="op://Terraphim-Deployment/Tauri Update Signing/TAURI_KEY_PASSWORD"
64+
EOF
65+
66+
# Build with injected signing keys
67+
op run --env-file=.env.ci -- yarn run tauri build
68+
69+
- name: Generate updater manifest
70+
if: matrix.platform == 'ubuntu-22.04'
71+
env:
72+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
73+
run: |
74+
node scripts/generate-latest-json.js
75+
76+
- name: Upload to GitHub Releases
77+
uses: softprops/action-gh-release@v1
5678
with:
57-
tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
58-
releaseName: "App v__VERSION__"
59-
releaseBody: "See the assets to download this version and install."
60-
releaseDraft: true
79+
files: |
80+
desktop/target/release/bundle/**/*.dmg
81+
desktop/target/release/bundle/**/*.exe
82+
desktop/target/release/bundle/**/*.AppImage
83+
desktop/target/release/bundle/**/*.deb
84+
desktop/target/release/bundle/**/*.msi
85+
latest.json
86+
tag_name: ${{ github.ref_name }}
87+
name: "Terraphim Desktop ${{ github.ref_name }}"
88+
body: |
89+
## Terraphim Desktop ${{ github.ref_name }}
90+
91+
### Auto-Update Enabled
92+
This release includes automatic update functionality. The desktop application will check for updates automatically and prompt users when new versions are available.
93+
94+
### Downloads
95+
- **macOS**: Download the `.dmg` file
96+
- **Windows**: Download the `.exe` or `.msi` file
97+
- **Linux**: Download the `.AppImage` or `.deb` file
98+
99+
### Changelog
100+
See the commit history for detailed changes in this release.
101+
draft: false
61102
prerelease: false
62-
projectPath: ${{env.working-directory}}
103+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)