ci: update desktop publish workflow and replace OpenSSL check script

- Added macOS 14 support for universal builds in the CI workflow.
- Introduced a new environment check script for OpenSSL configuration, replacing the previous openssl-check script.
- Removed the old openssl-check script to streamline the CI process.
- Updated package.json to reflect the new script name for environment checks.
This commit is contained in:
Huakun Shen 2025-01-07 00:41:28 -05:00
parent 85613dd59e
commit 82aca59dda
4 changed files with 64 additions and 40 deletions

View File

@ -20,8 +20,8 @@ jobs:
# args: "--target aarch64-apple-darwin --verbose"
# - 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"
- 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"
@ -49,6 +49,13 @@ jobs:
if: matrix.settings.platform == 'ubuntu-22.04'
run: |
sudo apt install -y protobuf-compiler
- uses: pnpm/action-setup@v4
- 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: |
@ -57,14 +64,6 @@ jobs:
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
pnpm --filter=@kksh/ci openssl-check
- uses: pnpm/action-setup@v4
- 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 Rust stable
uses: dtolnay/rust-toolchain@stable
@ -85,6 +84,9 @@ jobs:
bun-version: latest
- name: Install Dependencies
run: pnpm install
- name: Environment Check
run: |
pnpm --filter=@kksh/ci ci-env-check
- name: Build Packages
run: pnpm build
- name: Get App Version

View File

@ -4,7 +4,7 @@
"type": "module",
"scripts": {
"prepare": "bun scripts/setup.ts",
"openssl-check": "bun scripts/openssl-check.ts"
"ci-env-check": "bun scripts/ci-env-check.ts"
},
"devDependencies": {
"@types/bun": "latest",

View File

@ -0,0 +1,51 @@
import fs from 'fs'
// run the following only on windows
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);
}
// check if each directory exists
if (!fs.existsSync(OPENSSL_DIR)) {
console.error("OPENSSL_DIR does not exist", OPENSSL_DIR);
process.exit(1);
} else {
console.log("OPENSSL_DIR exists", OPENSSL_DIR);
}
if (!fs.existsSync(OPENSSL_INCLUDE_DIR)) {
console.error("OPENSSL_INCLUDE_DIR does not exist", OPENSSL_INCLUDE_DIR);
process.exit(1);
} else {
console.log("OPENSSL_INCLUDE_DIR exists", OPENSSL_INCLUDE_DIR);
}
if (!fs.existsSync(OPENSSL_LIB_DIR)) {
console.error("OPENSSL_LIB_DIR does not exist", OPENSSL_LIB_DIR);
process.exit(1);
} else {
console.log("OPENSSL_LIB_DIR exists", OPENSSL_LIB_DIR);
}
} else if (process.platform === "darwin") {
if (OPENSSL_DIR) {
if (fs.existsSync(OPENSSL_DIR)) {
console.log("OPENSSL_DIR exists", OPENSSL_DIR);
} else {
console.error("OPENSSL_DIR does not exist", OPENSSL_DIR);
}
}
} else if (process.platform === "linux") {
}

View File

@ -1,29 +0,0 @@
import fs from 'fs'
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);
// 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);
}
// check if each directory exists
if (!fs.existsSync(OPENSSL_DIR)) {
console.error("OPENSSL_DIR does not exist", OPENSSL_DIR);
process.exit(1);
}
if (!fs.existsSync(OPENSSL_INCLUDE_DIR)) {
console.error("OPENSSL_INCLUDE_DIR does not exist", OPENSSL_INCLUDE_DIR);
process.exit(1);
}
if (!fs.existsSync(OPENSSL_LIB_DIR)) {
console.error("OPENSSL_LIB_DIR does not exist", OPENSSL_LIB_DIR);
process.exit(1);
}