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:
Huakun Shen 2025-02-17 19:10:09 -05:00 committed by GitHub
parent 41f864e996
commit 513cf16d72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 39 additions and 25 deletions

View File

@ -1,8 +1,11 @@
name: Build Beta Package
name: Build Beta
on:
schedule:
- cron: "22 22 * * *"
pull_request:
branches:
- develop
workflow_dispatch:
inputs:
updater:
@ -19,17 +22,17 @@ on:
description: "linux"
required: true
type: boolean
default: false
default: true
platform_macos_aarch64:
description: "macos-aarch64"
required: true
type: boolean
default: false
default: true
platform_macos_x86_64:
description: "macos-x86_64"
required: true
type: boolean
default: false
default: true
isDebug:
description: "is debug?"
required: true
@ -137,8 +140,6 @@ jobs:
RETENTION_DAYS: ${{ needs.preprocess.outputs.retention_days }}
FILE_PREFIX: ${{ needs.preprocess.outputs.file_prefix }}
# 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
steps:
- name: Checkout repository

View File

@ -5,6 +5,7 @@ on:
pull_request:
branches:
- main
- develop
jobs:
build-test:

View File

@ -15,16 +15,16 @@ jobs:
matrix:
settings:
- 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.
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.
- 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.
args: "--verbose"
args: "--verbose --config src-tauri/tauri.conf.publish.json"
- platform: "windows-latest"
args: "--verbose"
args: "--verbose --config src-tauri/tauri.conf.publish.json"
runs-on: ${{ matrix.settings.platform }}
steps:
@ -96,6 +96,7 @@ jobs:
- uses: tauri-apps/tauri-action@v0
env:
CI: false
KUNKUN_PUBLISH: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}

View File

@ -1,6 +1,6 @@
{
"name": "@kksh/desktop",
"version": "0.1.22",
"version": "0.1.23",
"description": "",
"type": "module",
"scripts": {

View File

@ -9,12 +9,10 @@ use tauri::ActivationPolicy;
use tauri::Manager;
use tauri_plugin_deep_link::DeepLinkExt;
use tauri_plugin_jarvis::{
db::JarvisDB,
server::Protocol,
utils::{
constants::KUNKUN_PUBLISH, db::JarvisDB, server::Protocol, utils::{
path::{get_default_extensions_dir, get_kunkun_db_path},
settings::AppSettings,
},
}
};
use tauri_plugin_keyring::KeyringExt;
pub use tauri_plugin_log::fern::colors::ColoredLevelConfig;
@ -63,7 +61,10 @@ pub fn run() {
// .build(),
// );
// }
if KUNKUN_PUBLISH == "true" {
println!("KUNKUN_PUBLISH: {}", KUNKUN_PUBLISH);
builder = builder.plugin(tauri_plugin_updater::Builder::new().build());
}
let shell_unlocked = true;
builder = builder
.plugin(tauri_plugin_single_instance::init(|app, args, cwd| {
@ -97,7 +98,6 @@ pub fn run() {
.plugin(tauri_plugin_os::init())
.plugin(tauri_plugin_process::init())
.plugin(tauri_plugin_upload::init())
.plugin(tauri_plugin_updater::Builder::new().build())
.plugin(tauri_plugin_store::Builder::default().build())
.plugin(tauri_plugin_global_shortcut::Builder::new().build())
.plugin(tauri_plugin_dialog::init())
@ -123,7 +123,7 @@ pub fn run() {
})
.register_uri_scheme_protocol("ext", |app, request| {
let app_handle = app.app_handle();
// app_handle.
let win_label = app.webview_label();
let jarvis_state = app_handle.state::<tauri_plugin_jarvis::JarvisState>();
let window_ext_map = jarvis_state.window_label_ext_map.lock().unwrap();

View File

@ -35,7 +35,6 @@
"macOS": {
"minimumSystemVersion": "10.15"
},
"createUpdaterArtifacts": true,
"fileAssociations": [
{
"ext": ["kunkun"],
@ -58,10 +57,6 @@
"fs": {
"requireLiteralLeadingDot": false
},
"updater": {
"endpoints": ["https://updater.kunkun.sh"],
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDc1NENCRjZFM0JBOEQ0ODMKUldTRDFLZzdicjlNZFhHS0ZKYk13WkdZUTFUM01LNjkvVW5Bb2x1SnB1R0crbFRuMnlRSlJ0STgK"
},
"deep-link": {
"desktop": {
"schemes": ["kunkun"]

View File

@ -0,0 +1,11 @@
{
"bundle": {
"createUpdaterArtifacts": true
},
"plugins": {
"updater": {
"endpoints": ["https://updater.kunkun.sh"],
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDc1NENCRjZFM0JBOEQ0ODMKUldTRDFLZzdicjlNZFhHS0ZKYk13WkdZUTFUM01LNjkvVW5Bb2x1SnB1R0crbFRuMnlRSlJ0STgK"
}
}
}

View File

@ -125,7 +125,7 @@ const COMMANDS: &[&str] = &[
/* -------------------------------------------------------------------------- */
/* Window */
/* -------------------------------------------------------------------------- */
"set_transparent_titlebar"
"set_transparent_titlebar",
];
fn main() {
@ -167,6 +167,10 @@ fn main() {
"cargo:rustc-env=BASE64_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)
.android_path("android")

View File

@ -20,3 +20,4 @@ pub static SERVER_PUBLIC_KEY: std::sync::LazyLock<Vec<u8>> = std::sync::LazyLock
.decode(BASE64_SERVER_PUBLIC_KEY)
.expect("Failed to decode base64 encoded server public key")
});
pub static KUNKUN_PUBLISH: &str = env!("KUNKUN_PUBLISH");