tauri-apps / tauri-action

Build your Web application as a Tauri binary for macOS, Linux and Windows
https://tauri.app
MIT License
782 stars 134 forks source link

Tauri 2 beta build error #803

Closed Delfi1 closed 1 month ago

Delfi1 commented 1 month ago

.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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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