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

Tauri 2 beta build error #803

Closed
Delfi1 opened this issue May 28, 2024 · 6 comments
Closed

Tauri 2 beta build error #803

Delfi1 opened this issue May 28, 2024 · 6 comments

Comments

@Delfi1
Copy link

Delfi1 commented May 28, 2024

.yml file:

name: 'build'

on:
  workflow_dispatch:
  push:
    branches:
      - master

# This workflow will trigger on each push to the `release` branch to create or update a GitHub release, build your app, and upload the artifacts to the release.

jobs:
  publish-tauri:
    permissions:
      contents: write
    strategy:
      fail-fast: false
      matrix:
        include:
          - platform: 'macos-latest' # for Arm based macs (M1 and above).
            args: '--target aarch64-apple-darwin'
          - platform: 'macos-latest' # for Intel based macs.
            args: '--target x86_64-apple-darwin'
          - platform: 'windows-latest'
            args: ''

    runs-on: ${{ matrix.platform }}
    steps:
      - uses: actions/checkout@v4

      - name: setup node
        uses: actions/setup-node@v4
        with:
          node-version: lts/*

      - name: install Rust stable
        uses: dtolnay/rust-toolchain@stable
        with:
          # Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
          targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin, x86_64-apple-darwin' || '' }}

      - name: install frontend dependencies
        run: yarn install # change this to npm, pnpm or bun depending on which one you use.

      - uses: tauri-apps/tauri-action@v0.2.0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
          TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
        with:
          tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
          releaseName: 'InkSky v__VERSION__'
          releaseBody: 'See the assets to download this version and install.'
          releaseDraft: true
          prerelease: false
          args: ${{ matrix.args }}

Error:

Run tauri-apps/tauri-action@v0.2.0
running npm [ 'install', '-g', '@tauri-apps/cli' ]

added 2 packages in 9s

1 package is looking for funding
  run `npm fund` for details
running tauri [ 'build' ]
       Error `tauri.conf.json` error on `build`: Additional properties are not allowed ('frontendDist' was unexpected)
       Error `tauri.conf.json` error: Additional properties are not allowed ('app', 'bundle', 'identifier', 'productName', 'version' were unexpected)
Error: Command failed with exit code 1: tauri build
@FabianLars
Copy link
Member

This means that the action can't find a tauri cli in your repo root. In this case it will install the latest stable version which is incompatible with v2 beta.

Can you try setting projectPath on the tauri-action step to the path to the folder that contains the package.json file that installs the tauri cli?

If you're using the cargo based cli (which I don't think you do because it's not being installed in your workflow) you'll have to set tauriScript to cargo tauri

@FabianLars
Copy link
Member

p.s. if that doesn't help, please share a repo that contains this problem (either your actual repo or a minimal reproduction) so we can take a look

@Delfi1
Copy link
Author

Delfi1 commented May 30, 2024

p.s. if that doesn't help, please share a repo that contains this problem (either your actual repo or a minimal reproduction) so we can take a look

Now it woks, but when I added the tauri updater plugin, it stopped working. Here's run -> https://github.com/Delfi1/InkSky/actions/runs/9305030269/job/25611003409

@FabianLars
Copy link
Member

That link is 404 for me (and the repo empty). I assume the run failed because of a misconfiguration due to our lack of docs for v2.

@Delfi1
Copy link
Author

Delfi1 commented May 31, 2024

That link is 404 for me (and the repo empty). I assume the run failed because of a misconfiguration due to our lack of docs for v2.

I decided to recreate the repository. I still get this error. https://github.com/Delfi1/InkSky/actions/runs/9314605180/job/25639111406

@Delfi1
Copy link
Author

Delfi1 commented May 31, 2024

This error:

warning: `inksky` (bin "inksky") generated 2 warnings
    Finished `release` profile [optimized] target(s) in 2m 48s
    Built application at: /Users/runner/work/InkSky/InkSky/src-tauri/target/aarch64-apple-darwin/release/inksky
    Bundling inksky.app (/Users/runner/work/InkSky/InkSky/src-tauri/target/aarch64-apple-darwin/release/bundle/macos/inksky.app)
    Bundling inksky_0.0.1_aarch64.dmg (/Users/runner/work/InkSky/InkSky/src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/inksky_0.0.1_aarch64.dmg)
    Running bundle_dmg.sh
    Bundling /Users/runner/work/InkSky/InkSky/src-tauri/target/aarch64-apple-darwin/release/bundle/macos/inksky.app.tar.gz (/Users/runner/work/InkSky/InkSky/src-tauri/target/aarch64-apple-darwin/release/bundle/macos/inksky.app.tar.gz)
    Finished 2 bundles at:
        /Users/runner/work/InkSky/InkSky/src-tauri/target/aarch64-apple-darwin/release/bundle/macos/inksky.app
        /Users/runner/work/InkSky/InkSky/src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/inksky_0.0.1_aarch64.dmg
        /Users/runner/work/InkSky/InkSky/src-tauri/target/aarch64-apple-darwin/release/bundle/macos/inksky.app.tar.gz (updater)

    Error Invalid symbol 44, offset 348.
Error: Command failed with exit code 1: npm run tauri build -- --target aarch64-apple-darwin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants