Skip to content

Commit f86ad86

Browse files
Merge branch 'main' into fix/better-unsupported-model-message
2 parents 5edb35a + 93a5cda commit f86ad86

File tree

130 files changed

+8317
-525
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+8317
-525
lines changed

.github/workflows/build-osx-bundle.yml

Lines changed: 85 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
name: Build macOS Bundle
22

33
on:
4+
release:
5+
types: [published]
46
workflow_dispatch:
7+
inputs:
8+
manual_version:
9+
description: 'Version to build (e.g., 1.0.0 or v1.0.0). Required for manual runs if a specific version is needed.'
10+
required: false # Script will default if not provided for manual, but release uploads need a version.
511

612
jobs:
713
build_osx:
814
runs-on: macos-latest
15+
permissions:
16+
contents: write
917
env:
1018
KEYCHAIN_NAME: "build-keychain.keychain"
1119
CODESIGN_IDENTITY_STRING: "Developer ID Application: Roboflow, LLC (7SBQ39NG7G)"
@@ -91,8 +99,24 @@ jobs:
9199
xcrun notarytool store-credentials "${{ env.NOTARY_PROFILE_NAME }}" --apple-id "$NOTARY_APPLE_ID_SECRET" --team-id "$NOTARY_TEAM_ID_SECRET" --password "$NOTARY_APP_SPECIFIC_PASSWORD_SECRET"
92100
echo "Notarytool configured."
93101
94-
- name: Install local inference package
95-
run: pip install -e .[sam,transformers,clip,http,yolo-world,gaze,grounding-dino]
102+
103+
- name: Build local inference wheels
104+
shell: bash # Ensures 'make' and 'rm -rf' work as expected
105+
run: make create_wheels
106+
# Add the ls/dir dist/* after this if you want to see the output
107+
# For bash:
108+
# echo "--- Contents of dist/ after building all wheels ---"
109+
# ls -la dist/
110+
111+
- name: Install inference and dependencies from local wheels
112+
shell: bash # Using bash for wildcard expansion in pip install
113+
run: |
114+
WHEEL_FILE=$(ls dist/inference-*.whl)
115+
echo "Found GPU wheel: $WHEEL_FILE"
116+
pip install --find-links=./dist/ "$WHEEL_FILE[sam,transformers,clip,http,yolo-world,gaze,grounding-dino]"
117+
echo "--- Installed inference details ---"
118+
pip show inference
119+
96120
97121
- name: Install PyInstaller and other build dependencies
98122
working-directory: ./app_bundles/osx # Adjusted path
@@ -103,22 +127,75 @@ jobs:
103127
echo "DEBUG: Checking for default OpenSSL (typically [email protected] or similar from 'brew install openssl')..."
104128
ls -l /opt/homebrew/opt/openssl/lib/libssl.dylib || echo "default libssl.dylib not found"
105129
ls -l /opt/homebrew/opt/openssl/lib/libcrypto.dylib || echo "default libcrypto.dylib not found"
130+
pip install --upgrade pip
131+
pip install --upgrade pyinstaller pyinstaller-hooks-contrib
106132
pip install -r requirements.txt # This now only installs pyinstaller
107133
echo "DEBUG: PyInstaller version:"
108134
pip show pyinstaller
135+
echo "DEBUG: pyinstaller-hooks-contrib version:"
136+
pip show pyinstaller-hooks-contrib
137+
138+
- name: Determine Version
139+
id: determine_version
140+
shell: bash
141+
run: |
142+
VERSION=""
143+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
144+
if [ -n "${{ inputs.manual_version }}" ]; then
145+
VERSION="${{ inputs.manual_version }}"
146+
VERSION=${VERSION#v} # Remove leading 'v'
147+
echo "Manual run. Using provided version: $VERSION"
148+
else
149+
# Default for manual run if no version provided, build.py will also default
150+
VERSION="0.0.0-manual-dev"
151+
echo "Manual run. No version provided, will use default in build script: $VERSION"
152+
fi
153+
elif [[ "${{ github.ref }}" == refs/tags/v* ]]; then
154+
VERSION=$(echo "${{ github.ref }}" | sed 's!refs/tags/v!!')
155+
echo "Release run. Version from tag: $VERSION"
156+
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
157+
VERSION=$(echo "${{ github.ref }}" | sed 's!refs/tags/!!')
158+
echo "Release run. Version from tag: $VERSION"
159+
fi
160+
161+
if [ -z "$VERSION" ] && [ "${{ github.event_name }}" == "release" ]; then
162+
echo "Error: Could not determine installer version for release."
163+
exit 1
164+
fi
165+
# For cases where manual_version is empty, ensure build.py uses its internal default
166+
# If version is set (from tag or manual input), pass it
167+
if [ -n "$VERSION" ]; then
168+
echo "BUILD_VERSION_ENV=$VERSION" >> $GITHUB_OUTPUT
169+
else
170+
# Let build.py handle the default, pass an empty string or don't set BUILD_VERSION_ENV
171+
# For consistency in later steps that might need a version (like release upload), this path should be handled.
172+
# If it's a release, it should have failed above. If manual and no input, it will be 0.0.0-manual-dev.
173+
echo "BUILD_VERSION_ENV=$VERSION" >> $GITHUB_OUTPUT # Will be 0.0.0-manual-dev here if manual and no input
174+
fi
109175
110176
- name: Build macOS app and DMG
111177
working-directory: ./app_bundles/osx # Adjusted path
112-
# The build.py script will use the CODESIGN_IDENTITY_STRING and NOTARY_PROFILE_NAME
113-
# The keychain and notarytool are now set up for these values.
178+
env:
179+
BUILD_VERSION: ${{ steps.determine_version.outputs.BUILD_VERSION_ENV }} # Pass determined version
114180
run: python build.py
115181

116-
- name: Upload macOS DMG
182+
- name: Upload macOS DMG Artifact
117183
uses: actions/upload-artifact@v4
118184
with:
119-
name: Roboflow-Inference-DMG
120-
path: app_bundles/osx/Roboflow-Inference.dmg # Adjusted path
121-
if-no-files-found: error # Fail the step if the DMG is not found
185+
name: Roboflow-Inference-DMG-${{ steps.determine_version.outputs.BUILD_VERSION_ENV || 'dev' }} # Add version to artifact name
186+
path: app_bundles/osx/Roboflow-Inference-${{ steps.determine_version.outputs.BUILD_VERSION_ENV || 'unknown' }}.dmg
187+
if-no-files-found: error
188+
189+
- name: Upload DMG to Release
190+
if: github.event_name == 'release' && steps.determine_version.outputs.BUILD_VERSION_ENV != '0.0.0-manual-dev' && steps.determine_version.outputs.BUILD_VERSION_ENV != ''
191+
uses: actions/upload-release-asset@v1
192+
env:
193+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
194+
with:
195+
upload_url: ${{ github.event.release.upload_url }}
196+
asset_path: ./app_bundles/osx/Roboflow-Inference-${{ steps.determine_version.outputs.BUILD_VERSION_ENV }}.dmg
197+
asset_name: Roboflow-Inference-${{ steps.determine_version.outputs.BUILD_VERSION_ENV }}.dmg
198+
asset_content_type: application/x-apple-diskimage
122199

123200
- name: List dist output directory
124201
working-directory: ./app_bundles/osx/dist # Adjusted path

0 commit comments

Comments
 (0)