Skip to content

Commit

Permalink
add build and release workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
leetcode-mafia committed Apr 26, 2023
1 parent b4027f2 commit 5a770e0
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 10 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build
on:
workflow_call:
pull_request:
branches:
- main
jobs:
arm64_ventura:
runs-on: macos-13
steps:
- run: |
brew fetch --force --bottle-tag=arm64_ventura sdl2
brew install $(brew --cache --bottle-tag=arm64_ventura sdl2)
sudo mkdir -p /opt/homebrew/lib
sudo ln -s /usr/local/lib/libSDL2.a /opt/homebrew/lib/libSDL2.a
- uses: actions/checkout@v3
with:
path: cheetah
- uses: actions/checkout@v3
with:
repository: ggerganov/whisper.cpp
ref: v1.3.0
path: whisper.cpp
- run: |
cd cheetah
xcodebuild -scheme Cheetah -configuration Release -destination generic/platform=macOS -derivedDataPath build
cd build/Build/Products/Release
zip -r Cheetah.zip Cheetah.app
- uses: actions/upload-artifact@v3
with:
name: Cheetah
path: cheetah/build/Build/Products/Release/Cheetah.zip
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release
on:
push:
tags:
- 'v*.*'
- 'v*.*.*'
jobs:
build:
uses: ./.github/workflows/build.yml
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: Cheetah
- uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Cheetah.zip
asset_name: Cheetah.zip
asset_content_type: application/zip
50 changes: 40 additions & 10 deletions Cheetah.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
37AE7ACA29A70CE900C45FF6 /* whisper.h in Headers */ = {isa = PBXBuildFile; fileRef = 37AE7AB129A5AAD400C45FF6 /* whisper.h */; };
37B2997D29F9756F00971690 /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = 37B2997C29F9756F00971690 /* Sparkle */; };
37B2997F29F9757700971690 /* Sparkle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37B2997E29F9757700971690 /* Sparkle.swift */; };
37B2998729F97C5D00971690 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 37B2998429F97C1000971690 /* libSDL2.a */; };
37B3A50629CE15AC0029821F /* OpenAIEndpoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37B3A4FD29CE15AC0029821F /* OpenAIEndpoint.swift */; };
37B3A50729CE15AC0029821F /* OpenAISwift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37B3A4FE29CE15AC0029821F /* OpenAISwift.swift */; };
37B3A51C29CE16330029821F /* ImageGeneration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37B3A51629CE16330029821F /* ImageGeneration.swift */; };
Expand Down Expand Up @@ -170,7 +169,6 @@
37AE7AC529A6E9C400C45FF6 /* stream.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = stream.cpp; sourceTree = "<group>"; };
37AE7AC729A6EC2F00C45FF6 /* stream.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = stream.h; sourceTree = "<group>"; };
37B2997E29F9757700971690 /* Sparkle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Sparkle.swift; sourceTree = "<group>"; };
37B2998429F97C1000971690 /* libSDL2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libSDL2.a; path = /opt/homebrew/lib/libSDL2.a; sourceTree = "<absolute>"; };
37B3A4FD29CE15AC0029821F /* OpenAIEndpoint.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenAIEndpoint.swift; sourceTree = "<group>"; };
37B3A4FE29CE15AC0029821F /* OpenAISwift.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenAISwift.swift; sourceTree = "<group>"; };
37B3A51629CE16330029821F /* ImageGeneration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageGeneration.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -213,7 +211,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
37B2998729F97C5D00971690 /* libSDL2.a in Frameworks */,
376437AE29A75B2C00297AC6 /* Accelerate.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -231,7 +228,6 @@
376437AC29A75B2C00297AC6 /* Frameworks */ = {
isa = PBXGroup;
children = (
37B2998429F97C1000971690 /* libSDL2.a */,
376437AD29A75B2C00297AC6 /* Accelerate.framework */,
);
name = Frameworks;
Expand Down Expand Up @@ -678,6 +674,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = arm64;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
Expand Down Expand Up @@ -727,7 +724,6 @@
MACOSX_DEPLOYMENT_TARGET = 13.1;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand All @@ -738,6 +734,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = arm64;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
Expand Down Expand Up @@ -782,7 +779,6 @@
MACOSX_DEPLOYMENT_TARGET = 13.1;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
Expand Down Expand Up @@ -862,20 +858,37 @@
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GENERATE_INFOPLIST_FILE = YES;
HEADER_SEARCH_PATHS = /opt/homebrew/include/SDL2;
HEADER_SEARCH_PATHS = (
/opt/homebrew/include/SDL2,
/usr/local/include/SDL2,
);
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = /opt/homebrew/lib;
MARKETING_VERSION = 1.0;
OTHER_CFLAGS = (
"-D_THREAD_SAFE",
"-DGGML_USE_ACCELERATE",
);
OTHER_LDFLAGS = (
/opt/homebrew/lib/libSDL2.a,
"-l",
iconv,
"-weak_framework",
CoreHaptics,
"-weak_framework",
GameController,
"-weak_framework",
ForceFeedback,
"-weak_framework",
Carbon,
"-weak_framework",
AppKit,
);
PRODUCT_BUNDLE_IDENTIFIER = org.phrack.LibWhisper;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand All @@ -900,20 +913,37 @@
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GENERATE_INFOPLIST_FILE = YES;
HEADER_SEARCH_PATHS = /opt/homebrew/include/SDL2;
HEADER_SEARCH_PATHS = (
/opt/homebrew/include/SDL2,
/usr/local/include/SDL2,
);
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = /opt/homebrew/lib;
MARKETING_VERSION = 1.0;
OTHER_CFLAGS = (
"-D_THREAD_SAFE",
"-DGGML_USE_ACCELERATE",
);
OTHER_LDFLAGS = (
/opt/homebrew/lib/libSDL2.a,
"-l",
iconv,
"-weak_framework",
CoreHaptics,
"-weak_framework",
GameController,
"-weak_framework",
ForceFeedback,
"-weak_framework",
Carbon,
"-weak_framework",
AppKit,
);
PRODUCT_BUNDLE_IDENTIFIER = org.phrack.LibWhisper;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down

0 comments on commit 5a770e0

Please sign in to comment.