mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-04-12 01:39:43 +00:00
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:
parent
85613dd59e
commit
82aca59dda
22
.github/workflows/desktop-publish.yml
vendored
22
.github/workflows/desktop-publish.yml
vendored
@ -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
|
||||
|
@ -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",
|
||||
|
51
packages/ci/scripts/ci-env-check.ts
Normal file
51
packages/ci/scripts/ci-env-check.ts
Normal 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") {
|
||||
|
||||
}
|
@ -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);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user