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

Github actions build window app error #10809

Closed
vfiee opened this issue Aug 28, 2024 · 1 comment
Closed

Github actions build window app error #10809

vfiee opened this issue Aug 28, 2024 · 1 comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@vfiee
Copy link

vfiee commented Aug 28, 2024

Describe the bug

tauriV2 uses github actions to build linux, apple, windows app, only window build errors,The log is as follows.

 Compiling open v5.3.0
    Finished `release` profile [optimized] target(s) in 9m 05s
    Built application at: D:\a\sun\sun\src-tauri\target\release\sun.exe
    Info Verifying wix package
    Downloading https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip
    Info validating hash
    Info extracting WIX
    Info Target: x64
    Running candle for "main.wxs"
    Running light to produce D:\a\sun\sun\src-tauri\target\release\bundle\msi\向阳系统_0.1.8_x64_en-US.msi
    Error failed to bundle project: error running light.exe: `failed to run C:\Users\runneradmin\AppData\Local\tauri/WixTools314\light.exe`
 ELIFECYCLE  Command failed with exit code 1.
Error: Command failed with exit code 1: pnpm tauri build

Reproduction

github actions

name: "publish"

on:
  push:
    branches:
      - main
      - release

# This is the example from the readme.
# On each push to the `release` branch it will 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: "ubuntu-22.04" # for Tauri v1 you could replace this with ubuntu-20.04.
            args: ""
          - 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/*

      - uses: pnpm/action-setup@v4
        name: Setup pnpm
        with:
          version: 9
          run_install: false

      - 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 dependencies (ubuntu only)
        if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.
        run: |
          sudo apt-get update
          sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
        # webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2.
        # You can remove the one that doesn't apply to your app to speed up the workflow a bit.

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

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

tauri.config.json

{
  "productName": "向阳系统",
  "version": "../package.json",
  "identifier": "lol.qingxin.sun.app",
  "build": {
    "beforeDevCommand": "pnpm dev",
    "devUrl": "http://localhost:1420",
    "beforeBuildCommand": "pnpm build",
    "frontendDist": "../dist"
  },
  "app": {
    "windows": [
      {
        "label": "main",
        "title": "向阳系统🌻",
        "width": 375,
        "height": 664
      }
    ],
    "security": {
      "csp": null,
      "capabilities": []
    }
  },
  "bundle": {
    "active": true,
    "targets": "all",
    "icon": [
      "icons/32x32.png",
      "icons/128x128.png",
      "icons/128x128@2x.png",
      "icons/icon.icns",
      "icons/icon.ico"
    ],
    "iOS": {
      "minimumSystemVersion": "13.0",
      "developmentTeam": "----------"
    }
  }
}

Cargo.toml

[package]
name = "sun"
version = "0.1.0"
description = "A Tauri App To Manage Report"
authors = ["vyron"]
license = "MIT"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
name = "sun_lib"
crate-type = ["lib", "cdylib", "staticlib"]

[build-dependencies]
tauri-build = { version = "2.0.0-rc", features = [] }

[dependencies]
tauri = { version = "2.0.0-rc", features = [] }
tauri-plugin-shell = "2.0.0-rc"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tauri-plugin-http = "2.0.0-rc"
tauri-plugin-devtools = "2.0.0-rc"
tokio = "1.38.1"

[profile.dev]
incremental = true # Compile your binary in smaller steps.

[profile.release]
codegen-units = 1 # Allows LLVM to perform better optimization.
lto = false # Enables link-time-optimizations.
opt-level = "s" # Prioritizes small binary size. Use `3` if you prefer speed.
panic = "abort" # Higher performance by disabling panic handlers.
strip = true # Ensures debug symbols are removed.

init project for ios & android & desktop follow v2 docs

pnpm create tauri-app --rc
cd sun
pnpm install
pnpm tauri ios init
pnpm tauri android init

Expected behavior

The application on windows can be built successfully

Full tauri info output

> tauri "info"

[✔] Environment
    - OS: Mac OS 14.6.1 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.79.0 (129f3b996 2024-06-10)
    ✔ cargo: 1.79.0 (ffa9cf99a 2024-06-03)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 18.20.2
    - pnpm: 9.8.0
    - npm: 10.5.0
    - bun: 1.1.24

[-] Packages
    - tauri [RUST]: 2.0.0-rc.5
    - tauri-build [RUST]: 2.0.0-rc.5
    - wry [RUST]: 0.42.0
    - tao [RUST]: 0.29.0
    - @tauri-apps/api [NPM]: 2.0.0-rc.0
    - @tauri-apps/cli [NPM]: 2.0.0-rc.3

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: Vue.js
    - bundler: Vite

[-] iOS
    - Developer Teams: ----------

Stack trace

2024-08-26T14:58:50.5266863Z �[1m�[32m   Compiling�[0m colored v2.1.0
2024-08-26T14:58:51.3802011Z �[1m�[32m   Compiling�[0m local-ip-address v0.5.7
2024-08-26T14:58:52.0455458Z �[1m�[32m   Compiling�[0m sun v0.1.0 (D:\a\sun\sun\src-tauri)
2024-08-26T14:58:52.1941008Z �[1m�[32m   Compiling�[0m shared_child v1.0.1
2024-08-26T14:58:52.4407185Z �[1m�[32m   Compiling�[0m os_pipe v1.2.1
2024-08-26T14:58:52.5779301Z �[1m�[32m   Compiling�[0m data-url v0.3.1
2024-08-26T14:58:53.3144443Z �[1m�[32m   Compiling�[0m open v5.3.0
2024-08-26T14:59:55.8557538Z �[1m�[32m    Finished�[0m `release` profile [optimized] target(s) in 9m 05s
2024-08-26T14:59:56.0097738Z     Built application at: D:\a\sun\sun\src-tauri\target\release\sun.exe
2024-08-26T14:59:56.0120177Z     Info Verifying wix package
2024-08-26T14:59:56.0121796Z     Downloading https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip
2024-08-26T14:59:56.6672183Z     Info validating hash
2024-08-26T14:59:56.7901617Z     Info extracting WIX
2024-08-26T14:59:57.5679121Z     Info Target: x64
2024-08-26T14:59:57.5778694Z     Running candle for "main.wxs"
2024-08-26T15:00:00.4727209Z     Running light to produce D:\a\sun\sun\src-tauri\target\release\bundle\msi\向阳系统_0.1.8_x64_en-US.msi
2024-08-26T15:00:02.6852483Z     Error failed to bundle project: error running light.exe: `failed to run C:\Users\runneradmin\AppData\Local\tauri/WixTools314\light.exe`
2024-08-26T15:00:02.6977789Z  ELIFECYCLE  Command failed with exit code 1.
2024-08-26T15:00:02.9993621Z ##[error]Command failed with exit code 1: pnpm tauri build
2024-08-26T15:00:03.0207340Z Post job cleanup.
2024-08-26T15:00:03.1395240Z Pruning is unnecessary.
2024-08-26T15:00:03.1629333Z Post job cleanup.
2024-08-26T15:00:03.4002791Z [command]"C:\Program Files\Git\bin\git.exe" version
2024-08-26T15:00:03.4231950Z git version 2.46.0.windows.1
2024-08-26T15:00:03.4302483Z Temporarily overriding HOME='D:\a\_temp\63346b3d-e329-4728-9d47-e78c05767528' before making global git config changes
2024-08-26T15:00:03.4304548Z Adding repository directory to the temporary git global config as a safe directory
2024-08-26T15:00:03.4315753Z [command]"C:\Program Files\Git\bin\git.exe" config --global --add safe.directory D:\a\sun\sun
2024-08-26T15:00:03.4593799Z [command]"C:\Program Files\Git\bin\git.exe" config --local --name-only --get-regexp core\.sshCommand
2024-08-26T15:00:03.4855164Z [command]"C:\Program Files\Git\bin\git.exe" submodule foreach --recursive "sh -c \"git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :\""
2024-08-26T15:00:03.9324904Z [command]"C:\Program Files\Git\bin\git.exe" config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2024-08-26T15:00:03.9531588Z http.https://github.com/.extraheader
2024-08-26T15:00:03.9571957Z [command]"C:\Program Files\Git\bin\git.exe" config --local --unset-all http.https://github.com/.extraheader
2024-08-26T15:00:03.9824820Z [command]"C:\Program Files\Git\bin\git.exe" submodule foreach --recursive "sh -c \"git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :\""
2024-08-26T15:00:04.4675484Z Cleaning up orphan processes
2024-08-26T15:00:04.4975124Z Terminate orphan process: pid (1640) (vctip)

Additional context

No response

@vfiee vfiee added status: needs triage This issue needs to triage, applied to new issues type: bug labels Aug 28, 2024
@github-staff github-staff deleted a comment Aug 28, 2024
@vfiee
Copy link
Author

vfiee commented Sep 6, 2024

When tauri builds windows applications, the tools used do not support setting to Chinese. Looking forward to subsequent updates, I want to close it

@vfiee vfiee closed this as completed Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

3 participants
@vfiee and others