-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
151 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
name: test | ||
|
||
name: Build | ||
on: | ||
push: | ||
branches: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Release | ||
on: | ||
push: | ||
branches: | ||
- gh-release | ||
# push: | ||
# tags: | ||
# - 'v*' | ||
# workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
permissions: | ||
contents: write | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [macos-latest, ubuntu-20.04, windows-latest] | ||
runs-on: ${{ matrix.platform }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install dependencies (ubuntu only) | ||
if: matrix.platform == 'ubuntu-20.04' | ||
# You can remove libayatana-appindicator3-dev if you don't use the system tray feature. | ||
run: | | ||
sudo apt-get update --fix-missing | ||
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev | ||
- name: Rust setup | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Rust cache | ||
uses: swatinem/rust-cache@v2 | ||
|
||
- name: Sync node version and setup cache | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 'lts/*' | ||
cache: npm | ||
cache-dependency-path: '**/package-lock.json' | ||
|
||
- name: Build binaries | ||
run: cargo build --release --package xcmd-fs --package xcmd-ssh --package xcmd-s3 && cargo test --release --package xcmd-fs --package xcmd-ssh xcmd-s3 | ||
|
||
- name: Install frontend dependencies | ||
working-directory: xcmd-tauri | ||
run: npm install | ||
|
||
- name: Build the app | ||
uses: tauri-apps/tauri-action@v0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | ||
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | ||
with: | ||
tagName: test # ${{ github.ref_name }} # This only works if your workflow triggers on new tags. | ||
projectPath: xcmd-tauri | ||
releaseName: 'Cross Commander v__VERSION__' | ||
releaseBody: 'See the assets to download and install this version.' | ||
releaseDraft: true | ||
prerelease: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
!.github | ||
target | ||
node_modules | ||
xcmd-tauri/src-tauri/binaries |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
[workspace] | ||
members = [ | ||
"xcmd-tauri/src-tauri", | ||
"xcmd-base", | ||
"xcmd-fs", | ||
"xcmd-ssh", | ||
"xcmd-s3", | ||
"xcmd-tauri/src-tauri", | ||
"systemicons", | ||
] | ||
resolver = "2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,30 @@ | ||
fn main() { | ||
tauri_build::build() | ||
use std::env::consts; | ||
use std::error::Error; | ||
use std::fs; | ||
use std::process::Command; | ||
|
||
pub fn get_rustc_host() -> Result<String, Box<dyn Error>> { | ||
let output = Command::new("rustc").arg("-vV").output()?; | ||
let stdout = String::from_utf8(output.stdout)?; | ||
let host = stdout | ||
.lines() | ||
.find_map(|l| l.strip_prefix("host: ")) | ||
.ok_or_else(|| "target triple not found in rustc output")?; | ||
Ok(host.to_string()) | ||
} | ||
|
||
fn main() -> Result<(), Box<dyn Error>> { | ||
let host = get_rustc_host()?; | ||
fs::create_dir_all("binaries")?; | ||
eprintln!( | ||
"copying: {} -> {}", | ||
format!("../../target/release/xcmd-fs{}", consts::EXE_SUFFIX), | ||
format!("binaries/xcmd-fs-{}{}", host, consts::EXE_SUFFIX) | ||
); | ||
fs::copy( | ||
format!("../../target/release/xcmd-fs{}", consts::EXE_SUFFIX), | ||
format!("binaries/xcmd-fs-{}{}", host, consts::EXE_SUFFIX), | ||
)?; | ||
|
||
Ok(tauri_build::build()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters