mirror of
https://github.com/kunkunsh/kunkun-ext-neohtop.git
synced 2025-04-12 01:39:44 +00:00
source .env in build script
This commit is contained in:
parent
35219c9a3e
commit
36371d3628
@ -1,32 +1,38 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# source .env for notarization credentials
|
||||||
|
echo "Sourcing .env..."
|
||||||
|
if [ -f .env ]; then
|
||||||
|
source .env
|
||||||
|
# Verify that required environment variables are set
|
||||||
|
if [ -z "$APPLE_ID" ] || [ -z "$APPLE_PASSWORD" ] || [ -z "$APPLE_TEAM_ID" ]; then
|
||||||
|
echo "Error: Required environment variables are not set"
|
||||||
|
echo "Please ensure your .env file contains:"
|
||||||
|
echo "APPLE_ID=your.email@example.com"
|
||||||
|
echo "APPLE_PASSWORD=your-app-specific-password"
|
||||||
|
echo "APPLE_TEAM_ID=your-team-id"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# Export the variables so they are available to child processes
|
||||||
|
export APPLE_ID
|
||||||
|
export APPLE_PASSWORD
|
||||||
|
export APPLE_TEAM_ID
|
||||||
|
else
|
||||||
|
echo "Error: .env file not found"
|
||||||
|
echo "Please create a .env file with the following variables:"
|
||||||
|
echo "APPLE_ID=your.email@example.com"
|
||||||
|
echo "APPLE_PASSWORD=your-app-specific-password"
|
||||||
|
echo "APPLE_TEAM_ID=your-team-id"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Build frontend
|
# Build frontend
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
# Build for Intel
|
# Build for Intel
|
||||||
echo "Building for x86_64..."
|
echo "Building for x86_64..."
|
||||||
npm run tauri build -- --target x86_64-apple-darwin
|
npm run tauri build -- --target x86_64-apple-darwin --bundles dmg
|
||||||
|
|
||||||
# Build for Apple Silicon
|
# Build for Apple Silicon
|
||||||
echo "Building for aarch64..."
|
echo "Building for aarch64..."
|
||||||
npm run tauri build -- --target aarch64-apple-darwin
|
npm run tauri build -- --target aarch64-apple-darwin --bundles dmg
|
||||||
|
|
||||||
# Create universal binary directory
|
|
||||||
mkdir -p src-tauri/target/universal-apple-darwin/release
|
|
||||||
|
|
||||||
# Create universal binary
|
|
||||||
echo "Creating universal binary..."
|
|
||||||
lipo "src-tauri/target/x86_64-apple-darwin/release/macos-task-manager" \
|
|
||||||
"src-tauri/target/aarch64-apple-darwin/release/macos-task-manager" \
|
|
||||||
-create -output "src-tauri/target/universal-apple-darwin/release/macos-task-manager"
|
|
||||||
|
|
||||||
# Create universal app bundle
|
|
||||||
echo "Creating universal app bundle..."
|
|
||||||
cp -r "src-tauri/target/x86_64-apple-darwin/release/bundle/dmg/NeoHtop.app" \
|
|
||||||
"src-tauri/target/universal-apple-darwin/release/"
|
|
||||||
|
|
||||||
# Replace the binary in the app bundle
|
|
||||||
cp "src-tauri/target/universal-apple-darwin/release/macos-task-manager" \
|
|
||||||
"src-tauri/target/universal-apple-darwin/release/NeoHtop.app/Contents/MacOS/"
|
|
||||||
|
|
||||||
echo "Universal build complete!"
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "macos-task-manager",
|
"name": "macos-task-manager",
|
||||||
"version": "0.1.0",
|
"version": "0.1.2",
|
||||||
"description": "",
|
"description": "",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
2
src-tauri/Cargo.lock
generated
2
src-tauri/Cargo.lock
generated
@ -2009,7 +2009,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "macos-task-manager"
|
name = "macos-task-manager"
|
||||||
version = "0.1.0"
|
version = "0.1.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "macos-task-manager"
|
name = "macos-task-manager"
|
||||||
version = "0.1.0"
|
version = "0.1.2"
|
||||||
description = "A Tauri App"
|
description = "A Tauri App"
|
||||||
authors = ["you"]
|
authors = ["you"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
},
|
},
|
||||||
"package": {
|
"package": {
|
||||||
"productName": "NeoHtop",
|
"productName": "NeoHtop",
|
||||||
"version": "0.1.0"
|
"version": "0.1.2"
|
||||||
},
|
},
|
||||||
"tauri": {
|
"tauri": {
|
||||||
"allowlist": {
|
"allowlist": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user