mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 04:31:13 +00:00
* update openssl in cargo.toml, and remove dll and dylibs from repo * cargo fmt * cargo clippy * cargo fmt again * unused-mut * adjust build.rs for test container * windows runner setup * fix masos linking * same treatment for sbom files
125 lines
4.1 KiB
YAML
Vendored
125 lines
4.1 KiB
YAML
Vendored
name: build-macos-x64
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
release:
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
workflow_dispatch:
|
|
inputs:
|
|
release:
|
|
description: 'Set to true to create a release build'
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
|
|
jobs:
|
|
build-and-sign:
|
|
runs-on: "macos-15-intel"
|
|
permissions:
|
|
contents: write
|
|
defaults:
|
|
run:
|
|
working-directory: desktop
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Install OpenSSL 3
|
|
run: brew install openssl@3
|
|
|
|
- name: Import Code Signing Certificate
|
|
uses: apple-actions/import-codesign-certs@fe74d46e82474f87e1ba79832ad28a4013d0e33a # v6
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
|
|
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
|
|
with:
|
|
p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }}
|
|
p12-password: ${{ secrets.MACOS_CERTIFICATE_PWD }}
|
|
|
|
- name: Setup Cargo Cache
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
key: macos-x64-cargo-registry-${{ hashFiles('desktop/**/Cargo.lock') }}
|
|
restore-keys: |
|
|
macos-x64-cargo-registry-
|
|
|
|
- name: Setup Node Cache
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: ~/.npm
|
|
key: macos-x64-node-${{ hashFiles('desktop/**/package-lock.json') }}
|
|
restore-keys: |
|
|
macos-x64-node-
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: lts/*
|
|
|
|
- name: Install cyclonedx-npm
|
|
run: npm install -g @cyclonedx/cyclonedx-npm
|
|
|
|
- name: install Rust stable
|
|
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master
|
|
with:
|
|
toolchain: "stable"
|
|
targets: "x86_64-apple-darwin"
|
|
|
|
- name: Install Modules
|
|
run: |
|
|
npm install
|
|
cyclonedx-npm --output-format XML --gather-license-texts --output-file src-tauri/open-data-platform-SBOM-npm.cdx.xml
|
|
|
|
- name: Install cargo-cyclonedx
|
|
run: |
|
|
cargo install cargo-cyclonedx
|
|
cargo cyclonedx
|
|
if [ -f "src-tauri/openbb-platform.cdx.xml" ]; then
|
|
mv src-tauri/openbb-platform.cdx.xml "src-tauri/open-data-platform-SBOM-cargo.cdx.xml"
|
|
fi
|
|
|
|
- name: Build Tauri App
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
APPLE_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
|
|
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
|
|
APPLE_ID: ${{ secrets.NOTARIZE_APPLE_ID }}
|
|
APPLE_PASSWORD: ${{ secrets.NOTARIZE_APPLE_PWD }}
|
|
APPLE_TEAM_ID: ${{ secrets.NOTARIZE_APPLE_TEAM_ID }}
|
|
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
|
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
|
run: npm run tauri build
|
|
|
|
- name: Rename artifacts
|
|
run: |
|
|
VERSION=$(jq -r .version src-tauri/tauri.conf.json)
|
|
cd target/release/bundle/dmg
|
|
for file in *.dmg; do mv "$file" "Open-Data-Platform_${VERSION}_x86_64.dmg"; done
|
|
cd ../macos
|
|
for file in *.app.tar.gz; do mv "$file" "Open-Data-Platform_${VERSION}_x86_64.app.tar.gz"; done
|
|
for file in *.app.tar.gz.sig; do mv "$file" "Open-Data-Platform_${VERSION}_x86_64.app.tar.gz.sig"; done
|
|
|
|
- name: Upload Artifacts
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: macos-x64-artifacts
|
|
path: |
|
|
desktop/target/release/bundle/dmg/*.dmg
|
|
desktop/target/release/bundle/macos/*.app.tar.gz
|
|
desktop/target/release/bundle/macos/*.app.tar.gz.sig
|
|
|
|
- name: Clean old bundle artifacts
|
|
if: always()
|
|
run: |
|
|
bundlePath="${{ github.workspace }}/desktop/target/release/bundle"
|
|
if [ -d "$bundlePath" ]; then
|
|
rm -rf "$bundlePath"
|
|
fi
|