Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
connor-devuk opened this issue Jan 15, 2025 · 0 comments
Open

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

connor-devuk opened this issue Jan 15, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@connor-devuk
Copy link

connor-devuk commented Jan 15, 2025

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/[email protected]
        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/[email protected]

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"

@connor-devuk connor-devuk added the bug Something isn't working label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant