Skip to content

[CI] Github actions fails to run due to TTY mode #468

Closed
NativePHP/electron
#162
@connor-devuk

Description

@connor-devuk

What were you trying to do?

I'm trying to make a github actions workflow script to publish my application for me:

This is my code

name: Publish

on:
  workflow_dispatch:

jobs:
  publish:
    runs-on: macos-latest

    environment: production

    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0 # Preserve the last modified time of the files based on the Git history
          ref: master

      - name: Setup PHP
        uses: shivammathur/setup-php@2.23.0
        with:
          php-version: 8.3
          extensions: dom, curl, libxml, mbstring, zip

      - name: Use specified Node version and NPM cache
        uses: actions/setup-node@v3
        with:
          node-version-file: './.nvmrc'
          cache: 'npm'
          cache-dependency-path: './package-lock.json'

      - name: Composer package cache
        id: composer-cache
        uses: actions/cache@v3
        with:
          path: vendor
          key: ${{ runner.os }}-composer-${{ hashFiles('./composer.lock') }}
          restore-keys: |
            ${{ runner.os }}-composer-

      - name: Setup Flux Pro
        run: composer config http-basic.composer.fluxui.dev "${{ vars.FLUX_USERNAME }}" "${{ secrets.FLUX_LICENSE_KEY }}"

      - name: Install Composer dependencies
        run: composer install --no-dev --optimize-autoloader

      - name: Prepare Laravel Application
        run: |
          cp .env.example .env
            php artisan key:generate

      - name: Install Node dependencies
        run: npm install

      - name: Build assets
        run: npm run build

      - name: Run install
        run: php artisan native:install --force --no-interaction

      - name: Run build
        run: php artisan native:publish --no-interaction
        env:
          GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

      - name: Restore Git file modified timestamps
        uses: chetan/git-restore-mtime-action@v1.2

What happened?

When it gets to the publish command I'm thrown this error:

Publishing for mac
[NATIVE_EXCEPTION]: TTY mode requires /dev/tty to be read/writable. (0) in /Users/runner/work/zest-native-timetracking/zest-native-timetracking/vendor/symfony/process/Process.php:1049
[NATIVE_EXCEPTION]: cURL error 7: Failed to connect to localhost port 4000 after 0 ms: Could not connect to server (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://localhost:4000/api/debug/log (0) in /Users/runner/work/zest-native-timetracking/zest-native-timetracking/vendor/laravel/framework/src/Illuminate/Http/Client/PendingRequest.php:941

In PendingRequest.php line 941:

cURL error 7: Failed to connect to localhost port 4000 after 0 ms: Could no
t connect to server (see https://curl.haxx.se/libcurl/c/libcurl-errors.html
) for http://localhost:4000/api/debug/log

In CurlFactory.php line 275:

cURL error 7: Failed to connect to localhost port 4000 after 0 ms: Could no
t connect to server (see https://curl.haxx.se/libcurl/c/libcurl-errors.html
) for http://localhost:4000/api/debug/log

How to reproduce the bug

Run native:install from Github Actions with or without --no-interaction

Package Versions

{
"installed": [
{
"name": "nativephp/electron",
"direct-dependency": true,
"homepage": "https://github.com/nativephp/electron",
"source": "https://github.com/NativePHP/electron/tree/0.9.0",
"version": "0.9.0",
"description": "Electron wrapper for the NativePHP framework.",
"abandoned": false
},
{
"name": "nativephp/laravel",
"direct-dependency": false,
"homepage": "https://github.com/nativephp/laravel",
"source": "https://github.com/NativePHP/laravel/tree/0.7.0",
"version": "0.7.0",
"description": "Laravel wrapper for the NativePHP framework.",
"abandoned": false
},
{
"name": "nativephp/php-bin",
"direct-dependency": false,
"homepage": "https://nativephp.com",
"source": "https://github.com/NativePHP/php-bin/tree/0.5.6",
"version": "0.5.6",
"description": "PHP binaries used by the NativePHP framework",
"abandoned": false
}
]
}

PHP Version

8.3

Laravel Version

11.37

Node Version

22

Which operating systems have you seen this occur on?

No response

OS version

macos-latest

Notes

I tried swapping it over to use Run php artisan native:build --publish --no-interaction instead however im thrown this error instead:

Could not resolve "../../resources/cacert.pem?asset&asarUnpack" from "src/main/index.js"
file: /Users/runner/work/zest-native-timetracking/zest-native-timetracking/vendor/nativephp/electron/resources/js/src/main/index.js
error during build:
RollupError: Could not resolve "../../resources/cacert.pem?asset&asarUnpack" from "src/main/index.js"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions