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

Failed to resolve Tauri path when using this action #477

Closed
liudonghua123 opened this issue May 25, 2023 · 3 comments
Closed

Failed to resolve Tauri path when using this action #477

liudonghua123 opened this issue May 25, 2023 · 3 comments
Labels
good first issue Good for newcomers type: bug Something isn't working

Comments

@liudonghua123
Copy link
Contributor

Hi, I have some static deployable ready files and I want to use tauri-apps/tauri-action@v0 to build some executables. The project does not have package.json nor src-tauri.

I have some action steps like this in my workflow.

      - uses: tauri-apps/tauri-action@v0
        name: package and deploy app
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          distPath: ${{env.JEKYLL_BUILD_DIR}}
          tagName: ${{env.APP_NAME}} v__VERSION__
          releaseName: "flutter.dev site v__VERSION__"
          releaseBody: "See the assets to download this version and install."
          bundleIdentifier: dev.flutter.site
          args: -c {"build":{"beforeBuildCommand":""},"package":{"productName":"${{env.APP_NAME}}","version":"${{env.RELEASE_VERSION}}"}}
          releaseDraft: false
          prerelease: false

When running with github runner, I got the following errors.

Run tauri-apps/tauri-action@v0
  with:
    distPath: _site
    tagName: flutter_website v__VERSION__
    releaseName: flutter.dev site v__VERSION__
    releaseBody: See the assets to download this version and install.
    bundleIdentifier: dev.flutter.site
    args: -c {"build":{"beforeBuildCommand":""},"package":{"productName":"flutter_website","version":"3.10.0"}}
    releaseDraft: false
    prerelease: false
    projectPath: .
    includeDebug: false
    includeRelease: true
    includeUpdaterJson: true
    updaterJsonKeepUniversal: false
  env:
    NODE_ENV: production
    NODE_VERSION: 18
    APP_NAME: flutter_website
    RELEASE_VERSION: 3.10.0
    JEKYLL_BUILD_DIR: _site
    GITHUB_TOKEN: ***
running npm [ 'install', '-g', '@tauri-apps/cli' ]

added [2](https://github.com/liudonghua123/flutter_website/actions/runs/5076936604/jobs/9119740769#step:10:2) packages in [3](https://github.com/liudonghua123/flutter_website/actions/runs/5076936604/jobs/9119740769#step:10:3)s

1 package is looking for funding
  run `npm fund` for details
running tauri [ 'init', '--ci', '--app-name', 'docs.flutter.dev' ]
Failed to resolve Tauri path

It seems like this error comes from here.

export async function initProject(
root: string,
runner: Runner,
info: Info,
{ iconPath, bundleIdentifier }: BuildOptions
): Promise<Application> {
const packageJson = getPackageJson(root);
const tauriPath = getTauriDir(root);
await runner.execTauriCommand(
['init'],
['--ci', '--app-name', info.name],
root
);
if (tauriPath === null) {
console.error('Failed to resolve Tauri path');
process.exit(1);
}

tauri init is run after const tauriPath = getTauriDir(root);. Is it a bug?

@FabianLars
Copy link
Member

you're right, the lines were swapped when i moved code around :/

thanks for the report 👍

@FabianLars FabianLars added type: bug Something isn't working good first issue Good for newcomers labels May 25, 2023
@liudonghua123
Copy link
Contributor Author

I updated the code and test again. However, it failed again without error info.

Run liudonghua1[2](https://github.com/liudonghua123/flutter_website/actions/runs/5077744130/jobs/9125113916#step:10:2)[3](https://github.com/liudonghua123/flutter_website/actions/runs/5077744130/jobs/9125113916#step:10:3)/tauri-action@dev
  with:
    distPath: _site
    tagName: flutter_website v__VERSION__
    releaseName: flutter.dev site v__VERSION__
    releaseBody: See the assets to download this version and install.
    bundleIdentifier: dev.flutter.site
    args: -c {"build":{"beforeBuildCommand":""},"package":{"productName":"flutter_website","version":"3.10.0"}}
    releaseDraft: false
    prerelease: false
    projectPath: .
    includeDebug: false
    includeRelease: true
    includeUpdaterJson: true
    updaterJsonKeepUniversal: false
  env:
    NODE_ENV: production
    NODE_VERSION: 18
    APP_NAME: flutter_website
    RELEASE_VERSION: 3.10.0
    JEKYLL_BUILD_DIR: _site
    GITHUB_TOKEN: ***
running npm [ 'install', '-g', '@tauri-apps/cli' ]

added 2 packages in [4](https://github.com/liudonghua123/flutter_website/actions/runs/5077744130/jobs/9125113916#step:10:4)s

1 package is looking for funding
  run `npm fund` for details
running tauri [ 'init', '--ci', '--app-name', 'docs.flutter.dev' ]
image

@FabianLars
Copy link
Member

@liudonghua123 I see that you're trying to debug it in your fork too. I did the same because i was really curious and looks like i messed up when i changed the getConfig function.
Here:

const config = getConfig(configPath);
it needs tauriPath, not configPath because the getConfig action now appends the possible file names itself...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants