Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,75 @@ jobs:
target_commitish: ${{ github.sha }}
generate_release_notes: true
files: src-tauri/target/release/Benchmaker-Portable.exe

build-macos:
needs: build-windows
runs-on: macos-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri

- name: Install dependencies
run: npm ci

- name: Import Apple certificate
if: ${{ secrets.APPLE_CERTIFICATE != '' }}
env:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
run: |
echo "$APPLE_CERTIFICATE" | base64 -d > /tmp/apple_cert.p12
security create-keychain -p "" build.keychain
security import /tmp/apple_cert.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign -T /usr/bin/productbuild -T /usr/bin/security
security set-keychain-settings -t 3600 -u build.keychain
security list-keychains -d user -s build.keychain
security unlock-keychain -p "" build.keychain
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "" build.keychain

- name: Build Tauri app (dmg)
env:
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
run: npm run tauri:build -- --bundles dmg

- name: Upload dmg
uses: actions/upload-artifact@v4
with:
name: Benchmaker-macOS-dmg
path: src-tauri/target/release/bundle/dmg/*.dmg

- name: Determine release tag
id: release_tag
if: github.ref == 'refs/heads/main'
run: |
version=$(node -p "require('./package.json').version")
if [ -z "$version" ]; then
echo "package.json version not found"
exit 1
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "tag=v$version" >> "$GITHUB_OUTPUT"

- name: Upload dmg to GitHub release
if: github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.release_tag.outputs.tag }}
files: src-tauri/target/release/bundle/dmg/*.dmg