Ci: fix desktop release CI (#50)

This commit is contained in:
Huakun Shen 2025-01-07 05:16:11 -05:00 committed by GitHub
parent b1e21aa040
commit 943f52d929
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 80 additions and 21 deletions

View File

@ -16,10 +16,11 @@ jobs:
settings:
- platform: "macos-14" # for Arm based macs (M1 and above).
args: "--target aarch64-apple-darwin --verbose"
- platform: "macos-14" # for Intel based macs.
- platform: "macos-13" # for Intel based macs.
args: "--target x86_64-apple-darwin --verbose"
- platform: "macos-14" # for Both Arm and Intel based macs.
args: "--target universal-apple-darwin --verbose"
# 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"
- platform: "ubuntu-22.04" # for Tauri v1 you could replace this with ubuntu-20.04.
args: "--verbose"
- platform: "windows-latest"
@ -31,35 +32,36 @@ jobs:
with:
submodules: "true"
- name: install dependencies (ubuntu only)
- name: Install Dependencies (ubuntu only)
if: matrix.settings.platform == 'ubuntu-22.04' # This must match the platform value defined above.
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libxdo-dev
# You can remove the one that doesn't apply to your app to speed up the workflow a bit.
- name: Install protobuf (Mac)
if: matrix.settings.platform == 'macos-14'
if: startsWith(matrix.settings.platform, 'macos')
run: |
brew install protobuf
brew install openssl
- name: Install Protobuf (Ubuntu)
if: matrix.settings.platform == 'ubuntu-22.04'
run: |
sudo apt install -y protobuf-compiler
- name: Install protoc and openssl for windows
if: matrix.settings.platform == 'windows-latest'
run: |
choco install protoc
choco install openssl
echo OPENSSL_DIR='"C:\\Program Files\\OpenSSL-Win64"' >> $env:GITHUB_ENV
echo OPENSSL_INCLUDE_DIR='"C:\\Program Files\\OpenSSL-Win64\\include"' >> $env:GITHUB_ENV
echo OPENSSL_LIB_DIR='"C:\\Program Files\\OpenSSL-Win64\\lib\\VC\\x64\\MDd"' >> $env:GITHUB_ENV
- uses: pnpm/action-setup@v4
- name: setup node
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: "pnpm" # Set this to npm, yarn or pnpm.
cache-dependency-path: ./pnpm-lock.yaml
- name: Install protoc and openssl for windows
if: matrix.settings.platform == 'windows-latest'
run: |
choco install protoc
choco install openssl
echo OPENSSL_DIR='C:\Program Files\OpenSSL' >> $env:GITHUB_ENV
echo OPENSSL_INCLUDE_DIR='C:\Program Files\OpenSSL\include' >> $env:GITHUB_ENV
echo OPENSSL_LIB_DIR='C:\Program Files\OpenSSL\lib\VC\x64\MDd' >> $env:GITHUB_ENV
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
@ -71,7 +73,7 @@ jobs:
run: |
rustup target add aarch64-apple-darwin
rustup target add x86_64-apple-darwin
- name: Rust cache
- name: Rust Cache
uses: swatinem/rust-cache@v2
with:
workspaces: ". -> target"
@ -80,6 +82,10 @@ jobs:
bun-version: latest
- name: Install Dependencies
run: pnpm install
- name: Environment Check
run: |
# pnpm --filter=@kksh/ci run ci-env-check
bun packages/ci/scripts/ci-env-check.ts
- name: Build Packages
run: pnpm build
- name: Get App Version

View File

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

View File

@ -3,13 +3,14 @@
"module": "index.ts",
"type": "module",
"scripts": {
"prepare": "bun scripts/setup.ts"
"prepare": "bun scripts/setup.ts",
"ci-env-check": "bun scripts/ci-env-check.ts"
},
"devDependencies": {
"@types/bun": "latest",
"@kksh/typescript-config": "workspace:*"
},
"peerDependencies": {
"typescript": "^5.0.0"
"typescript": "^5.7.2"
}
}

View File

@ -0,0 +1,49 @@
import fs from "fs"
import path from "path"
const OPENSSL_DIR = process.env.OPENSSL_DIR
const OPENSSL_INCLUDE_DIR = process.env.OPENSSL_INCLUDE_DIR
const OPENSSL_LIB_DIR = process.env.OPENSSL_LIB_DIR
console.log("OPENSSL_DIR", OPENSSL_DIR)
console.log("OPENSSL_INCLUDE_DIR", OPENSSL_INCLUDE_DIR)
console.log("OPENSSL_LIB_DIR", OPENSSL_LIB_DIR)
if (process.platform === "win32") {
// check if each directory exists
if (!OPENSSL_DIR || !OPENSSL_INCLUDE_DIR || !OPENSSL_LIB_DIR) {
console.error("OPENSSL_DIR, OPENSSL_INCLUDE_DIR, or OPENSSL_LIB_DIR is not set")
process.exit(1)
}
const programFilesDir = "C:\\Program Files"
console.log(
`Program Files Directory (${programFilesDir}) Exists: ${fs.existsSync(programFilesDir)}`
)
console.log("Program Files Directory Contents:")
for (const dir of fs.readdirSync(programFilesDir)) {
console.log(dir)
}
console.log(`OPENSSL_DIR (${OPENSSL_DIR}) Exists: ${fs.existsSync(OPENSSL_DIR)}`)
console.log(
`OPENSSL_INCLUDE_DIR (${OPENSSL_INCLUDE_DIR}) Exists: ${fs.existsSync(OPENSSL_INCLUDE_DIR)}`
)
console.log(`OPENSSL_LIB_DIR (${OPENSSL_LIB_DIR}) Exists: ${fs.existsSync(OPENSSL_LIB_DIR)}`)
if (
!fs.existsSync(OPENSSL_DIR) ||
!fs.existsSync(OPENSSL_INCLUDE_DIR) ||
!fs.existsSync(OPENSSL_LIB_DIR)
) {
console.error("OPENSSL_DIR, OPENSSL_INCLUDE_DIR, or OPENSSL_LIB_DIR is not set")
process.exit(1)
}
} else if (process.platform === "darwin") {
if (OPENSSL_DIR) {
if (fs.existsSync(OPENSSL_DIR)) {
console.log("OPENSSL_DIR exists", OPENSSL_DIR)
} else {
console.log("OPENSSL_DIR does not exist", OPENSSL_DIR)
}
}
} else if (process.platform === "linux") {
}

View File

@ -1,10 +1,13 @@
use applications::utils::image::{RustImage, RustImageData};
use std::path::Path;
use std::{
ffi::OsStr,
fs::File,
io::{BufReader, Cursor},
path::PathBuf,
};
use uuid::Uuid;
#[cfg(target_os = "macos")]
use tauri_icns::{IconFamily, IconType};

4
pnpm-lock.yaml generated
View File

@ -547,8 +547,8 @@ importers:
packages/ci:
dependencies:
typescript:
specifier: ^5.0.0
version: 5.5.4
specifier: ^5.7.2
version: 5.7.2
devDependencies:
'@kksh/typescript-config':
specifier: workspace:*

@ -1 +1 @@
Subproject commit 5766c04cb255b88fb569e6db2ae910ad237fef34
Subproject commit 890edc0216f5d7d36de7dcdd1809b7551c342e06