mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-04-11 17:29:44 +00:00
Improve CI (enable beta build for all PR) (#134)
* chore(desktop): configure publish workflow and update Tauri configuration * chore(ci): enable beta build on develop pull requests * chore(ci): add develop branch to CI workflow triggers * chore(ci): enable default platform builds for beta workflow
This commit is contained in:
parent
41f864e996
commit
513cf16d72
13
.github/workflows/beta-build.yml
vendored
13
.github/workflows/beta-build.yml
vendored
@ -1,8 +1,11 @@
|
|||||||
name: Build Beta Package
|
name: Build Beta
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "22 22 * * *"
|
- cron: "22 22 * * *"
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- develop
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
updater:
|
updater:
|
||||||
@ -19,17 +22,17 @@ on:
|
|||||||
description: "linux"
|
description: "linux"
|
||||||
required: true
|
required: true
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: true
|
||||||
platform_macos_aarch64:
|
platform_macos_aarch64:
|
||||||
description: "macos-aarch64"
|
description: "macos-aarch64"
|
||||||
required: true
|
required: true
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: true
|
||||||
platform_macos_x86_64:
|
platform_macos_x86_64:
|
||||||
description: "macos-x86_64"
|
description: "macos-x86_64"
|
||||||
required: true
|
required: true
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: true
|
||||||
isDebug:
|
isDebug:
|
||||||
description: "is debug?"
|
description: "is debug?"
|
||||||
required: true
|
required: true
|
||||||
@ -137,8 +140,6 @@ jobs:
|
|||||||
RETENTION_DAYS: ${{ needs.preprocess.outputs.retention_days }}
|
RETENTION_DAYS: ${{ needs.preprocess.outputs.retention_days }}
|
||||||
FILE_PREFIX: ${{ needs.preprocess.outputs.file_prefix }}
|
FILE_PREFIX: ${{ needs.preprocess.outputs.file_prefix }}
|
||||||
# BUILD_TIME: ${{ needs.preprocess.outputs.build_time }}
|
# BUILD_TIME: ${{ needs.preprocess.outputs.build_time }}
|
||||||
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
|
||||||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
|
||||||
NO_STRIP: true
|
NO_STRIP: true
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
|
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@ -5,6 +5,7 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
- develop
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-test:
|
build-test:
|
||||||
|
11
.github/workflows/desktop-publish.yml
vendored
11
.github/workflows/desktop-publish.yml
vendored
@ -15,16 +15,16 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
settings:
|
settings:
|
||||||
- platform: "macos-14" # for Arm based macs (M1 and above).
|
- platform: "macos-14" # for Arm based macs (M1 and above).
|
||||||
args: "--target aarch64-apple-darwin --verbose"
|
args: "--target aarch64-apple-darwin --verbose --config src-tauri/tauri.conf.publish.json"
|
||||||
- platform: "macos-13" # for Intel based macs.
|
- platform: "macos-13" # for Intel based macs.
|
||||||
args: "--target x86_64-apple-darwin --verbose"
|
args: "--target x86_64-apple-darwin --verbose --config src-tauri/tauri.conf.publish.json"
|
||||||
# Universal Build no longer supported after adding openssl, which is not cross-compilable.
|
# Universal Build no longer supported after adding openssl, which is not cross-compilable.
|
||||||
- platform: "macos-14" # for Both Arm and Intel based macs.
|
- platform: "macos-14" # for Both Arm and Intel based macs.
|
||||||
args: "--target universal-apple-darwin --verbose"
|
args: "--target universal-apple-darwin --verbose --config src-tauri/tauri.conf.publish.json"
|
||||||
- platform: "ubuntu-22.04" # for Tauri v1 you could replace this with ubuntu-20.04.
|
- platform: "ubuntu-22.04" # for Tauri v1 you could replace this with ubuntu-20.04.
|
||||||
args: "--verbose"
|
args: "--verbose --config src-tauri/tauri.conf.publish.json"
|
||||||
- platform: "windows-latest"
|
- platform: "windows-latest"
|
||||||
args: "--verbose"
|
args: "--verbose --config src-tauri/tauri.conf.publish.json"
|
||||||
|
|
||||||
runs-on: ${{ matrix.settings.platform }}
|
runs-on: ${{ matrix.settings.platform }}
|
||||||
steps:
|
steps:
|
||||||
@ -96,6 +96,7 @@ jobs:
|
|||||||
- uses: tauri-apps/tauri-action@v0
|
- uses: tauri-apps/tauri-action@v0
|
||||||
env:
|
env:
|
||||||
CI: false
|
CI: false
|
||||||
|
KUNKUN_PUBLISH: true
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
|
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
|
||||||
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@kksh/desktop",
|
"name": "@kksh/desktop",
|
||||||
"version": "0.1.22",
|
"version": "0.1.23",
|
||||||
"description": "",
|
"description": "",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -9,12 +9,10 @@ use tauri::ActivationPolicy;
|
|||||||
use tauri::Manager;
|
use tauri::Manager;
|
||||||
use tauri_plugin_deep_link::DeepLinkExt;
|
use tauri_plugin_deep_link::DeepLinkExt;
|
||||||
use tauri_plugin_jarvis::{
|
use tauri_plugin_jarvis::{
|
||||||
db::JarvisDB,
|
constants::KUNKUN_PUBLISH, db::JarvisDB, server::Protocol, utils::{
|
||||||
server::Protocol,
|
|
||||||
utils::{
|
|
||||||
path::{get_default_extensions_dir, get_kunkun_db_path},
|
path::{get_default_extensions_dir, get_kunkun_db_path},
|
||||||
settings::AppSettings,
|
settings::AppSettings,
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
use tauri_plugin_keyring::KeyringExt;
|
use tauri_plugin_keyring::KeyringExt;
|
||||||
pub use tauri_plugin_log::fern::colors::ColoredLevelConfig;
|
pub use tauri_plugin_log::fern::colors::ColoredLevelConfig;
|
||||||
@ -63,7 +61,10 @@ pub fn run() {
|
|||||||
// .build(),
|
// .build(),
|
||||||
// );
|
// );
|
||||||
// }
|
// }
|
||||||
|
if KUNKUN_PUBLISH == "true" {
|
||||||
|
println!("KUNKUN_PUBLISH: {}", KUNKUN_PUBLISH);
|
||||||
|
builder = builder.plugin(tauri_plugin_updater::Builder::new().build());
|
||||||
|
}
|
||||||
let shell_unlocked = true;
|
let shell_unlocked = true;
|
||||||
builder = builder
|
builder = builder
|
||||||
.plugin(tauri_plugin_single_instance::init(|app, args, cwd| {
|
.plugin(tauri_plugin_single_instance::init(|app, args, cwd| {
|
||||||
@ -97,7 +98,6 @@ pub fn run() {
|
|||||||
.plugin(tauri_plugin_os::init())
|
.plugin(tauri_plugin_os::init())
|
||||||
.plugin(tauri_plugin_process::init())
|
.plugin(tauri_plugin_process::init())
|
||||||
.plugin(tauri_plugin_upload::init())
|
.plugin(tauri_plugin_upload::init())
|
||||||
.plugin(tauri_plugin_updater::Builder::new().build())
|
|
||||||
.plugin(tauri_plugin_store::Builder::default().build())
|
.plugin(tauri_plugin_store::Builder::default().build())
|
||||||
.plugin(tauri_plugin_global_shortcut::Builder::new().build())
|
.plugin(tauri_plugin_global_shortcut::Builder::new().build())
|
||||||
.plugin(tauri_plugin_dialog::init())
|
.plugin(tauri_plugin_dialog::init())
|
||||||
@ -123,7 +123,7 @@ pub fn run() {
|
|||||||
})
|
})
|
||||||
.register_uri_scheme_protocol("ext", |app, request| {
|
.register_uri_scheme_protocol("ext", |app, request| {
|
||||||
let app_handle = app.app_handle();
|
let app_handle = app.app_handle();
|
||||||
// app_handle.
|
|
||||||
let win_label = app.webview_label();
|
let win_label = app.webview_label();
|
||||||
let jarvis_state = app_handle.state::<tauri_plugin_jarvis::JarvisState>();
|
let jarvis_state = app_handle.state::<tauri_plugin_jarvis::JarvisState>();
|
||||||
let window_ext_map = jarvis_state.window_label_ext_map.lock().unwrap();
|
let window_ext_map = jarvis_state.window_label_ext_map.lock().unwrap();
|
||||||
|
@ -35,7 +35,6 @@
|
|||||||
"macOS": {
|
"macOS": {
|
||||||
"minimumSystemVersion": "10.15"
|
"minimumSystemVersion": "10.15"
|
||||||
},
|
},
|
||||||
"createUpdaterArtifacts": true,
|
|
||||||
"fileAssociations": [
|
"fileAssociations": [
|
||||||
{
|
{
|
||||||
"ext": ["kunkun"],
|
"ext": ["kunkun"],
|
||||||
@ -58,10 +57,6 @@
|
|||||||
"fs": {
|
"fs": {
|
||||||
"requireLiteralLeadingDot": false
|
"requireLiteralLeadingDot": false
|
||||||
},
|
},
|
||||||
"updater": {
|
|
||||||
"endpoints": ["https://updater.kunkun.sh"],
|
|
||||||
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDc1NENCRjZFM0JBOEQ0ODMKUldTRDFLZzdicjlNZFhHS0ZKYk13WkdZUTFUM01LNjkvVW5Bb2x1SnB1R0crbFRuMnlRSlJ0STgK"
|
|
||||||
},
|
|
||||||
"deep-link": {
|
"deep-link": {
|
||||||
"desktop": {
|
"desktop": {
|
||||||
"schemes": ["kunkun"]
|
"schemes": ["kunkun"]
|
||||||
|
11
apps/desktop/src-tauri/tauri.conf.publish.json
Normal file
11
apps/desktop/src-tauri/tauri.conf.publish.json
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"bundle": {
|
||||||
|
"createUpdaterArtifacts": true
|
||||||
|
},
|
||||||
|
"plugins": {
|
||||||
|
"updater": {
|
||||||
|
"endpoints": ["https://updater.kunkun.sh"],
|
||||||
|
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDc1NENCRjZFM0JBOEQ0ODMKUldTRDFLZzdicjlNZFhHS0ZKYk13WkdZUTFUM01LNjkvVW5Bb2x1SnB1R0crbFRuMnlRSlJ0STgK"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -125,7 +125,7 @@ const COMMANDS: &[&str] = &[
|
|||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* Window */
|
/* Window */
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
"set_transparent_titlebar"
|
"set_transparent_titlebar",
|
||||||
];
|
];
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
@ -167,6 +167,10 @@ fn main() {
|
|||||||
"cargo:rustc-env=BASE64_SERVER_PUBLIC_KEY={}",
|
"cargo:rustc-env=BASE64_SERVER_PUBLIC_KEY={}",
|
||||||
BASE64_STANDARD.encode(raw_server_public_key)
|
BASE64_STANDARD.encode(raw_server_public_key)
|
||||||
);
|
);
|
||||||
|
println!(
|
||||||
|
"cargo:rustc-env=KUNKUN_PUBLISH={}",
|
||||||
|
std::env::var("KUNKUN_PUBLISH").unwrap_or("false".to_string())
|
||||||
|
);
|
||||||
|
|
||||||
tauri_plugin::Builder::new(COMMANDS)
|
tauri_plugin::Builder::new(COMMANDS)
|
||||||
.android_path("android")
|
.android_path("android")
|
||||||
|
@ -20,3 +20,4 @@ pub static SERVER_PUBLIC_KEY: std::sync::LazyLock<Vec<u8>> = std::sync::LazyLock
|
|||||||
.decode(BASE64_SERVER_PUBLIC_KEY)
|
.decode(BASE64_SERVER_PUBLIC_KEY)
|
||||||
.expect("Failed to decode base64 encoded server public key")
|
.expect("Failed to decode base64 encoded server public key")
|
||||||
});
|
});
|
||||||
|
pub static KUNKUN_PUBLISH: &str = env!("KUNKUN_PUBLISH");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user