Skip to content

Fastest and only macOS Dictation app with on-device STT and custom trained AI enhancement model. Windows, iOS testflight! Android, Linux waitlist open! A local Wispr Flow alternative. Follow https://x.com/fluidvoiceapp for more

add PR workflow

grohith327740ec8087a56
diff --git a/.github/workflows/pr-archive.yml b/.github/workflows/pr-archive.yml
new file mode 100644
index 00000000..22fbd4be
--- /dev/null
+++ b/.github/workflows/pr-archive.yml
@@ -0,0 +1,205 @@
+name: PR Archive
+
+on:
+ pull_request_target:
+ branches: [main]
+ types: [opened, synchronize, reopened, ready_for_review]
+
+permissions:
+ contents: read
+
+concurrency:
+ group: pr-archive-${{ github.event.pull_request.number }}
+ cancel-in-progress: true
+
+jobs:
+ archive:
+ name: "Archive FluidVoice PR #${{ github.event.pull_request.number }}"
+ if: github.event.pull_request.draft == false
+ runs-on: macos-latest
+ timeout-minutes: 45
+ environment:
+ name: ${{ contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.pull_request.author_association) && 'pr-archive-auto' || 'pr-archive-approval' }}
+ env:
+ PR_NUMBER: ${{ github.event.pull_request.number }}
+ AUTHOR_ASSOCIATION: ${{ github.event.pull_request.author_association }}
+ PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
+ PR_MERGE_SHA: ${{ github.event.pull_request.merge_commit_sha }}
+ APP_NAME: "FluidVoice #${{ github.event.pull_request.number }}"
+ BUNDLE_IDENTIFIER: com.FluidApp.app.pr${{ github.event.pull_request.number }}
+
+ steps:
+ - name: Verify outside-contributor approval gate
+ if: ${{ !contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.pull_request.author_association) }}
+ env:
+ APPROVAL_GATE_CONFIGURED: ${{ vars.PR_ARCHIVE_APPROVAL_CONFIGURED }}
+ run: |
+ if [[ "$APPROVAL_GATE_CONFIGURED" != "true" ]]; then
+ echo "The pr-archive-approval environment is not fully configured." >&2
+ echo "Add the repository owner and write-access collaborators as" >&2
+ echo "required reviewers, then set the environment's" >&2
+ echo "PR_ARCHIVE_APPROVAL_CONFIGURED environment variable to true." >&2
+ exit 1
+ fi
+
+ - name: Checkout PR merge commit
+ uses: actions/checkout@v4
+ with:
+ ref: ${{ github.event.pull_request.merge_commit_sha }}
+ fetch-depth: 1
+ persist-credentials: false
+
+ - name: Set up Xcode
+ uses: maxim-lobanov/setup-xcode@v1
+ with:
+ xcode-version: latest-stable
+
+ - name: Show Xcode version
+ run: xcodebuild -version
+
+ - name: Archive unsigned PR build
+ env:
+ ARCHIVE_PATH: ${{ runner.temp }}/FluidVoice-PR-${{ github.event.pull_request.number }}.xcarchive
+ run: |
+ set -euo pipefail
+
+ xcodebuild archive \
+ -project Fluid.xcodeproj \
+ -scheme Fluid \
+ -configuration Release \
+ -destination 'generic/platform=macOS' \
+ -archivePath "$ARCHIVE_PATH" \
+ CODE_SIGN_IDENTITY="" \
+ CODE_SIGNING_REQUIRED=NO \
+ CODE_SIGNING_ALLOWED=NO
+
+ - name: Validate and package archive
+ id: package
+ env:
+ ARCHIVE_PATH: ${{ runner.temp }}/FluidVoice-PR-${{ github.event.pull_request.number }}.xcarchive
+ STAGING_PATH: ${{ runner.temp }}/FluidVoice-PR-${{ github.event.pull_request.number }}
+ run: |
+ set -euo pipefail
+
+ ORIGINAL_APP_PATH="$ARCHIVE_PATH/Products/Applications/FluidVoice.app"
+ APP_PATH="$ARCHIVE_PATH/Products/Applications/$APP_NAME.app"
+ EXECUTABLE_PATH="$APP_PATH/Contents/MacOS/FluidVoice"
+ INFO_PLIST="$APP_PATH/Contents/Info.plist"
+ ARCHIVE_INFO_PLIST="$ARCHIVE_PATH/Info.plist"
+ MANIFEST_PATH="$STAGING_PATH/build-manifest.json"
+ MANIFEST_PLIST="$STAGING_PATH/build-manifest.plist"
+ README_PATH="$STAGING_PATH/README.txt"
+ ARCHIVE_ZIP="$STAGING_PATH/FluidVoice-PR-$PR_NUMBER.xcarchive.zip"
+ APP_ZIP="$STAGING_PATH/FluidVoice-PR-$PR_NUMBER.app.zip"
+ VERIFY_PATH="$RUNNER_TEMP/FluidVoice-PR-$PR_NUMBER-verify"
+ SHORT_SHA="${PR_HEAD_SHA:0:12}"
+ ARTIFACT_NAME="FluidVoice-PR-$PR_NUMBER-$SHORT_SHA"
+
+ test -d "$ARCHIVE_PATH"
+ test -d "$ORIGINAL_APP_PATH"
+ test -f "$ARCHIVE_INFO_PLIST"
+
+ mv "$ORIGINAL_APP_PATH" "$APP_PATH"
+ /usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier $BUNDLE_IDENTIFIER" "$INFO_PLIST"
+ /usr/libexec/PlistBuddy -c "Set :CFBundleName $APP_NAME" "$INFO_PLIST"
+ /usr/libexec/PlistBuddy -c "Set :CFBundleDisplayName $APP_NAME" "$INFO_PLIST"
+ /usr/libexec/PlistBuddy -c "Set :Name $APP_NAME" "$ARCHIVE_INFO_PLIST"
+ /usr/libexec/PlistBuddy -c "Set :ApplicationProperties:ApplicationPath Applications/$APP_NAME.app" "$ARCHIVE_INFO_PLIST"
+ /usr/libexec/PlistBuddy -c "Set :ApplicationProperties:CFBundleIdentifier $BUNDLE_IDENTIFIER" "$ARCHIVE_INFO_PLIST"
+
+ test -d "$APP_PATH"
+ test -f "$INFO_PLIST"
+ test -x "$EXECUTABLE_PATH"
+
+ ACTUAL_BUNDLE_IDENTIFIER=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' "$INFO_PLIST")
+ if [[ "$ACTUAL_BUNDLE_IDENTIFIER" != "$BUNDLE_IDENTIFIER" ]]; then
+ echo "Expected bundle identifier '$BUNDLE_IDENTIFIER', found '$ACTUAL_BUNDLE_IDENTIFIER'." >&2
+ exit 1
+ fi
+
+ SIGNATURE_DETAILS=$(codesign -dv --verbose=4 "$APP_PATH" 2>&1 || true)
+ if grep -q '^Authority=' <<< "$SIGNATURE_DETAILS"; then
+ echo "Expected no signing authority on the PR app." >&2
+ exit 1
+ fi
+ if grep -q '^TeamIdentifier=' <<< "$SIGNATURE_DETAILS" && \
+ ! grep -q '^TeamIdentifier=not set$' <<< "$SIGNATURE_DETAILS"; then
+ echo "Expected no signing team on the PR app." >&2
+ exit 1
+ fi
+
+ rm -rf "$STAGING_PATH" "$VERIFY_PATH"
+ mkdir -p "$STAGING_PATH" "$VERIFY_PATH"
+
+ XCODE_VERSION=$(xcodebuild -version | tr '\n' ' ' | xargs)
+ BUILD_TIMESTAMP=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
+
+ plutil -create xml1 "$MANIFEST_PLIST"
+ plutil -insert pr_number -integer "$PR_NUMBER" "$MANIFEST_PLIST"
+ plutil -insert author_association -string "$AUTHOR_ASSOCIATION" "$MANIFEST_PLIST"
+ plutil -insert pr_head_sha -string "$PR_HEAD_SHA" "$MANIFEST_PLIST"
+ plutil -insert pr_merge_sha -string "$PR_MERGE_SHA" "$MANIFEST_PLIST"
+ plutil -insert xcode_version -string "$XCODE_VERSION" "$MANIFEST_PLIST"
+ plutil -insert app_name -string "$APP_NAME" "$MANIFEST_PLIST"
+ plutil -insert bundle_identifier -string "$BUNDLE_IDENTIFIER" "$MANIFEST_PLIST"
+ plutil -insert build_timestamp -string "$BUILD_TIMESTAMP" "$MANIFEST_PLIST"
+ plutil -convert json -o "$MANIFEST_PATH" "$MANIFEST_PLIST"
+ rm "$MANIFEST_PLIST"
+
+ cat > "$README_PATH" <<EOF
+ FluidVoice PR #$PR_NUMBER
+ ========================
+
+ This is an unsigned test build from pull request #$PR_NUMBER.
+
+ App name: $APP_NAME.app
+ Bundle identifier: $BUNDLE_IDENTIFIER
+ PR head SHA: $PR_HEAD_SHA
+ PR merge SHA: $PR_MERGE_SHA
+
+ Because the app is unsigned, macOS may prevent it from opening normally.
+ Try opening the app from Finder, then use Open Anyway under
+ System Settings > Privacy & Security if macOS offers that option.
+
+ For trusted builds only, you can remove the downloaded quarantine marker:
+
+ xattr -dr com.apple.quarantine "/path/to/$APP_NAME.app"
+
+ Unsigned builds may not support signature-dependent features such as
+ Login Items. This PR build has a separate bundle identifier, so macOS
+ permissions and preferences are separate from the release app.
+ EOF
+
+ ditto -c -k --sequesterRsrc --keepParent "$ARCHIVE_PATH" "$ARCHIVE_ZIP"
+ ditto -c -k --sequesterRsrc --keepParent "$APP_PATH" "$APP_ZIP"
+
+ test -s "$MANIFEST_PATH"
+ test -s "$README_PATH"
+ test -s "$ARCHIVE_ZIP"
+ test -s "$APP_ZIP"
+ unzip -tq "$ARCHIVE_ZIP"
+ unzip -tq "$APP_ZIP"
+
+ ditto -x -k "$APP_ZIP" "$VERIFY_PATH"
+ test -x "$VERIFY_PATH/$APP_NAME.app/Contents/MacOS/FluidVoice"
+
+ echo "artifact-name=$ARTIFACT_NAME" >> "$GITHUB_OUTPUT"
+ echo "artifact-path=$STAGING_PATH" >> "$GITHUB_OUTPUT"
+
+ {
+ echo "### PR archive ready"
+ echo
+ echo "- Artifact: \`$ARTIFACT_NAME\`"
+ echo "- App: \`$APP_NAME.app\`"
+ echo "- Bundle identifier: \`$BUNDLE_IDENTIFIER\`"
+ echo "- Signing: unsigned"
+ } >> "$GITHUB_STEP_SUMMARY"
+
+ - name: Upload PR archive artifact
+ uses: actions/upload-artifact@v4
+ with:
+ name: ${{ steps.package.outputs.artifact-name }}
+ path: ${{ steps.package.outputs.artifact-path }}
+ if-no-files-found: error
+ retention-days: 14
+ compression-level: 0