Skip to content

Commit

Permalink
Linux appimage (#119)
Browse files Browse the repository at this point in the history
* enable app image builds on Linux
* inherit env PATH values from shell using https://github.com/tauri-apps/fix-path-env-rs
  • Loading branch information
emuell authored Aug 29, 2024
1 parent af715d2 commit 875f48d
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 7 deletions.
27 changes: 21 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,31 +138,46 @@ jobs:

- name: Upload Artifact (Windows)
if: ${{ matrix.config.name == 'Windows' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "Restic-Browser-${{ needs.variables.outputs.ref_name }}-windows"
path: ./src-tauri/target/release/*.exe
if-no-files-found: error

- name: Prepare Upload Artifact (Linux)
if: ${{ matrix.config.name == 'Ubuntu' }}
run: cd ./src-tauri/target/release && tar -cvf ${{ matrix.config.executable_name }}.tar ${{ matrix.config.executable_name }}
run: |
set -e
cd ./src-tauri/target/release
tar -cvf ${{ matrix.config.executable_name }}.tar ${{ matrix.config.executable_name }}
cd ./bundle/appimage
mv *.AppImage ${{ matrix.config.executable_name }}.AppImage
- name: Upload Artifact (Linux)
- name: Upload Artifact (Linux, Executable)
if: ${{ matrix.config.name == 'Ubuntu' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "Restic-Browser-${{ needs.variables.outputs.ref_name }}-linux"
path: ./src-tauri/target/release/*.tar
if-no-files-found: error

- name: Upload Artifact (Linux, AppImage)
if: ${{ matrix.config.name == 'Ubuntu' }}
uses: actions/upload-artifact@v4
with:
name: "Restic-Browser-${{ needs.variables.outputs.ref_name }}-linux-appimage"
path: ./src-tauri/target/release/bundle/appimage/*.AppImage
if-no-files-found: error

- name: Prepare Upload Artifact (macOS)
if: ${{ matrix.config.name == 'macOS' }}
run: cd ./src-tauri/target/universal-apple-darwin/release/bundle/macos && tar -cvf ${{ matrix.config.executable_name }}.tar ${{ matrix.config.executable_name }}
run: |
cd ./src-tauri/target/universal-apple-darwin/release/bundle/macos
tar -cvf ${{ matrix.config.executable_name }}.tar ${{ matrix.config.executable_name }}
- name: Upload Artifact (macOS)
if: ${{ matrix.config.name == 'macOS' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "Restic-Browser-${{ needs.variables.outputs.ref_name }}-macOS"
path: ./src-tauri/target/universal-apple-darwin/release/bundle/macos/*.tar
Expand Down
45 changes: 45 additions & 0 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ shlex = { version = "^1.2" }
# tauri
tauri = { version = "^1.6", features = ["fs-all", "dialog-all", "cli"] }
tauri-plugin-window-state = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
fix-path-env = { git = "https://github.com/tauri-apps/fix-path-env-rs", branch = "dev" }

# windows
[target.'cfg(target_os = "windows")'.dependencies.windows-sys]
Expand Down
5 changes: 5 additions & 0 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ fn initialize_app(app: &mut tauri::App) -> Result<(), Box<dyn std::error::Error>
env::var("HOME").unwrap_or("~".into())
);

// set PATH environment from shells in GUI apps on Linux and macOS
if let Err(err) = fix_path_env::fix() {
log::warn!("Failed to update PATH env: {}", err);
}

// get restic from args or find restic in path
let mut restic_path = None;
let mut rclone_path = None;
Expand Down
3 changes: 2 additions & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"bundle": {
"active": true,
"targets": [
"app"
"app",
"appimage"
],
"category": "DeveloperTool",
"copyright": "",
Expand Down

0 comments on commit 875f48d

Please sign in to comment.