diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f69ea62..f9c0dcb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,29 +4,11 @@ on: pull_request: branches: - main - paths: - - "**.go" - - "go.mod" - - "go.sum" - - "**.js" - - "**.jsx" - - "**.ts" - - "**.tsx" - - "package.json" - - "bun.lockb" push: branches: - main - paths: - - "**.go" - - "go.mod" - - "go.sum" - - "**.js" - - "**.jsx" - - "**.ts" - - "**.tsx" - - "package.json" - - "bun.lockb" + # Allow manual trigger + workflow_dispatch: jobs: go-tests: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a2d1381..dabc3b2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,11 +1,11 @@ name: Release on: - # Only run on version tags (releases) push: tags: - "v*" - # TEMPORARY: Run on PR for testing build fixes + branches: + - main pull_request: branches: - main @@ -60,6 +60,14 @@ jobs: sudo apt-get update sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev + - name: Install Task + uses: arduino/setup-task@v2 + + - name: Install Frontend Dependencies + run: | + cd frontend && bun install + shell: bash + - name: Install Wails CLI run: | go install github.com/wailsapp/wails/v3/cmd/wails3@latest @@ -78,19 +86,18 @@ jobs: - name: Build Application run: | - if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then - wails build -platform ${{ matrix.platform }} - elif [ "${{ matrix.os }}" = "macos-latest" ]; then + # Build for current platform (native runner) + if [ "${{ matrix.os }}" = "macos-latest" ]; then # macOS: Build with code signing if certificates are available if [ -n "$MACOS_CERTIFICATE" ] && [ -n "$MACOS_CERTIFICATE_PASSWORD" ]; then echo "Building with code signing..." - wails build -platform ${{ matrix.platform }} -sign -signIdentity "Developer ID Application" + wails build -sign -signIdentity "Developer ID Application" else echo "Building without code signing (no certificates found)..." - wails build -platform ${{ matrix.platform }} + wails build fi else - wails build -platform ${{ matrix.platform }} + wails build fi shell: bash env: @@ -109,22 +116,27 @@ jobs: env: HAS_CERTS: ${{ secrets.MACOS_CERTIFICATE != '' && secrets.MACOS_CERTIFICATE_PASSWORD != '' }} - # Notarize macOS app (optional - only if secrets are configured) + # Notarize macOS app (optional - only if secrets are configured and .app bundle exists) - name: Notarize macOS App if: matrix.os == 'macos-latest' && github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v') && env.HAS_NOTARIZE_SECRETS == 'true' run: | - # Create a zip for notarization - ditto -c -k --keepParent "build/bin/devtoolbox.app" "build/bin/devtoolbox.zip" - - # Submit for notarization - xcrun notarytool submit "build/bin/devtoolbox.zip" \ - --apple-id "${{ secrets.APPLE_ID }}" \ - --password "${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}" \ - --team-id "${{ secrets.APPLE_TEAM_ID }}" \ - --wait - - # Staple the notarization ticket - xcrun stapler staple "build/bin/devtoolbox.app" + BINARY_NAME=$(ls bin/ | grep -i "devtoolbox" | head -1) + if [ -d "bin/$BINARY_NAME.app" ]; then + # Create a zip for notarization + ditto -c -k --keepParent "bin/$BINARY_NAME.app" "bin/devtoolbox.zip" + + # Submit for notarization + xcrun notarytool submit "bin/devtoolbox.zip" \ + --apple-id "${{ secrets.APPLE_ID }}" \ + --password "${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}" \ + --team-id "${{ secrets.APPLE_TEAM_ID }}" \ + --wait + + # Staple the notarization ticket + xcrun stapler staple "bin/$BINARY_NAME.app" + else + echo "No .app bundle found, skipping notarization (binary-only build)" + fi env: APPLE_ID: ${{ secrets.APPLE_ID }} APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} @@ -135,33 +147,46 @@ jobs: - name: Package Artifacts run: | mkdir -p release - if [ "${{ matrix.os }}" = "macos-latest" ]; then - # macOS: create DMG using create-dmg + + # Discover the actual binary name (DevToolbox, devtoolbox, etc.) + BINARY_NAME=$(ls bin/ | grep -i "devtoolbox" | head -1) + echo "Found binary: $BINARY_NAME" + + if [ -z "$BINARY_NAME" ]; then + echo "ERROR: Could not find devtoolbox binary in bin/" + ls -la bin/ + exit 1 + fi + + # Check if it's an .app bundle (macOS) or just a binary + if [ -d "bin/$BINARY_NAME.app" ]; then + # macOS with .app bundle + echo "Found .app bundle, creating DMG..." brew install create-dmg - # Clean up any existing files - rm -f release/devtoolbox-${{ matrix.build }}.dmg - rm -f /tmp/rw.*.devtoolbox-${{ matrix.build }}.dmg create-dmg \ - --volname "devtoolbox" \ + --volname "DevToolbox" \ --window-pos 200 120 \ --window-size 800 400 \ --icon-size 100 \ --app-drop-link 600 185 \ - "release/devtoolbox-${{ matrix.build }}.dmg" \ - "build/bin/devtoolbox.app" + "release/DevToolbox.dmg" \ + "bin/$BINARY_NAME.app" elif [ "${{ matrix.os }}" = "windows-latest" ]; then - # Windows: Wails already outputs .exe, just copy it - cp build/bin/devtoolbox.exe release/devtoolbox-${{ matrix.build }}.exe + # Windows: copy .exe + cp "bin/$BINARY_NAME" "release/DevToolbox.exe" else - # Linux: create AppImage or tar.gz - tar -czf "release/devtoolbox-${{ matrix.build }}.tar.gz" -C build/bin devtoolbox + # Linux or macOS binary (no .app): create tar.gz + tar -czf "release/DevToolbox.tar.gz" -C bin "$BINARY_NAME" fi + + echo "=== Release contents ===" + ls -la release/ shell: bash - name: Upload Artifacts uses: actions/upload-artifact@v4 with: - name: devtoolbox-${{ matrix.build }}-${{ github.ref_name }} + name: devtoolbox-${{ matrix.build }} path: release/* # Create Release and upload assets (only on tags)