name: Release on: push: tags: - "v*" env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} jobs: release: permissions: contents: write strategy: fail-fast: false matrix: include: - platform: "macos-latest" args: "--target aarch64-apple-darwin" arch: "aarch64" target: "aarch64-apple-darwin" pkg_target: "latest-macos-arm64" nodecar_script: "build:aarch64" - platform: "macos-latest" args: "--target x86_64-apple-darwin" arch: "x86_64" target: "x86_64-apple-darwin" pkg_target: "latest-macos-x64" nodecar_script: "build:x86_64" # Future platforms can be added here: # - platform: "ubuntu-20.04" # args: "--target x86_64-unknown-linux-gnu" # arch: "x86_64" # target: "x86_64-unknown-linux-gnu" # pkg_target: "latest-linux-x64" # nodecar_script: "build:linux-x64" # - platform: "ubuntu-20.04" # args: "--target aarch64-unknown-linux-gnu" # arch: "aarch64" # target: "aarch64-unknown-linux-gnu" # pkg_target: "latest-linux-arm64" # nodecar_script: "build:linux-arm64" # - platform: "windows-latest" # args: "--target x86_64-pc-windows-msvc" # arch: "x86_64" # target: "x86_64-pc-windows-msvc" # pkg_target: "latest-win-x64" # nodecar_script: "build:win-x64" # - platform: "windows-latest" # args: "--target aarch64-pc-windows-msvc" # arch: "aarch64" # target: "aarch64-pc-windows-msvc" # pkg_target: "latest-win-arm64" # nodecar_script: "build:win-arm64" runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version-file: .node-version - name: Setup pnpm uses: pnpm/action-setup@v4 - name: Setup Rust uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.target }} - name: Install dependencies (Ubuntu only) if: matrix.platform == 'ubuntu-20.04' run: | sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev - name: Rust cache uses: swatinem/rust-cache@v2 with: workdir: ./src-tauri - name: Install frontend dependencies run: pnpm install --frozen-lockfile - name: Install nodecar dependencies working-directory: ./nodecar run: | echo "DEBUG: Installing nodecar dependencies..." pnpm install --frozen-lockfile echo "DEBUG: Current directory: $(pwd)" echo "DEBUG: Contents of nodecar directory:" ls -la echo "DEBUG: Checking if package.json exists:" cat package.json | head -20 echo "DEBUG: Checking pnpm version and cache:" pnpm --version echo "DEBUG: Running pnpm install..." pnpm install --frozen-lockfile echo "DEBUG: After pnpm install - checking node_modules:" ls -la node_modules/ | head -20 echo "DEBUG: Checking if specific dependencies exist:" ls -la node_modules/commander || echo "commander not found" ls -la node_modules/get-port || echo "get-port not found" ls -la node_modules/proxy-chain || echo "proxy-chain not found" echo "DEBUG: Checking get-port package.json type:" cat node_modules/get-port/package.json | grep -E '"type":|"main":|"module":|"exports":' || echo "No ESM info found" echo "DEBUG: Checking what TypeScript can resolve:" npx tsc --noEmit --listFiles | head -20 || echo "TypeScript check failed" - name: Build nodecar sidecar shell: bash working-directory: ./nodecar run: | echo "DEBUG: Building nodecar sidecar..." echo "DEBUG: Current directory: $(pwd)" echo "DEBUG: Contents of nodecar directory:" ls -la echo "DEBUG: Checking if node_modules still exists:" ls -la node_modules/ | head -10 || echo "node_modules not found!" echo "DEBUG: Checking TypeScript config:" cat tsconfig.json echo "DEBUG: Checking src directory:" ls -la src/ echo "DEBUG: Testing individual imports:" echo "import { program } from 'commander';" > test-import.ts npx tsc --noEmit test-import.ts || echo "Commander import failed" echo "import getPort from 'get-port';" > test-import.ts npx tsc --noEmit test-import.ts || echo "get-port import failed" echo "import * as ProxyChain from 'proxy-chain';" > test-import.ts npx tsc --noEmit test-import.ts || echo "proxy-chain import failed" rm test-import.ts echo "DEBUG: Running nodecar build script..." pnpm run ${{ matrix.nodecar_script }} - name: Copy nodecar binary to Tauri binaries run: | mkdir -p src-tauri/binaries if [[ "${{ matrix.platform }}" == "windows-latest" ]]; then cp nodecar/dist/nodecar.exe src-tauri/binaries/nodecar-${{ matrix.target }}.exe else cp nodecar/dist/nodecar src-tauri/binaries/nodecar-${{ matrix.target }} fi - name: Build frontend run: pnpm build - name: Build Tauri app uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tagName: ${{ github.ref_name }} releaseName: "Donut Browser ${{ github.ref_name }}" releaseBody: "See the assets to download this version and install." releaseDraft: true prerelease: false args: ${{ matrix.args }}