Code Monkey home page Code Monkey logo

tauri-action's Introduction

Tauri GitHub Action

This GitHub Action builds your Tauri application as a native binary for macOS, Linux and Windows and optionally upload it to a GitHub Release.

If your project doesn't include a Tauri project, the action can initialize it for you, so if you don't need to use Tauri's API, you can just ship native apps through this Action without making changes to your web app.

Usage

For more workflow examples, check out the examples directory.

This GitHub Action has three main usages: test the build pipeline of your Tauri app, uploading Tauri artifacts to an existing release, and creating a new release with the Tauri artifacts.

This example shows the most common use case for tauri-action. The action will build the app, create a GitHub release itself, and upload the app bundles to the newly created release.

This is generally the simplest way to release your Tauri app.

name: 'publish'

on:
  push:
    branches:
      - release

# 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: '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/*

      - 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.0-dev 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: yarn install # change this to npm, pnpm or bun depending on which one you use.

      - uses: tauri-apps/tauri-action@v0
        env:
          GITHUB_TOKEN: ${{ secrets.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 }}

Inputs

Project Initialization

These inputs are only used if your GitHub repository does not contain an existing Tauri project and you want the action to initialize it for you.

Name Required Description Type Default
projectPath false The path to the root of the tauri project relative to the current working directory string .
distPath false Path to the distributable folder with your index.html and JS/CSS string
iconPath false path to the PNG icon to use as app icon, relative to the projectPath string
bundleIdentifier yes, if not set via --config The bundle identifier to inject when initializing the Tauri app string
appName yes, if not set via --config The app name identifier to inject when initializing the Tauri app string
appVersion yes, if not set via --config The app version to inject when initializing the Tauri app string

Build Options

These inputs allow you to change how your Tauri project will be build.

Name Required Description Type Default
projectPath false The path to the root of the tauri project relative to the current working directory string .
includeDebug false whether to include a debug build or not bool false
includeRelease false whether to include a release build or not bool true
includeUpdaterJson false whether to upload a JSON file for the updater or not (only relevant if the updater is configured) bool true
updaterJsonPreferNsis false whether the action will use the NSIS (setup.exe) or WiX (.msi) bundles for the updater JSON if both types exist bool false. May be changed to true for projects using tauri@v2 in the future.
updaterJsonKeepUniversal false whether the updater JSON file should include universal macOS builds as darwin-universal on top of using it in the aarch64 and x86_64 fields. bool false
tauriScript false the script to execute the Tauri CLI. It must not include any args or commands like build string npm run|pnpm|yarn tauri
args false Additional arguments to the current build command string

Release Configuration

These inputs allow you to modify the GitHub release.

Name Required Description Type Default
releaseId false The id of the release to upload artifacts as release assets string
tagName false The tag name of the release to create or the tag of the release belonging to releaseId string
releaseName false The name of the release to create string
releaseBody false The body of the release to create string
releaseDraft false Whether the release to create is a draft or not bool false
prerelease false Whether the release to create is a prerelease or not bool false
releaseCommitish false Any branch or commit SHA the Git tag is created from, unused if the Git tag already exists string SHA of current commit
owner false The account owner of the repository the release will be uploaded to. Requires GITHUB_TOKEN in env and a releaseCommitish target if it doesn't match the current repo. string owner of the current repo
repo false The name of the repository the release will be uploaded to. Requires GITHUB_TOKEN in env and a releaseCommitish target if it doesn't match the current repo. string name of the current repo

Outputs

Name Description
releaseId The ID of the created release
releaseHtmlUrl The URL users can navigate to in order to view the created release
releaseUploadUrl The URL for uploading assets to the created release
artifactPaths The paths of the generated artifacts
appVersion The version of the app

Tips and Caveats

  • You can use this Action on a repo that doesn't have Tauri configured. We automatically initialize Tauri before building, and configure it to use your Web artifacts.
    • You can configure the project initialization with the distPath and iconPath options.
    • If you need to further customize the default tauri.conf.json file you can add a custom config that will be merged with the default one at build time.
      • args: --config custom-config.json
  • You can run custom Tauri CLI scripts with the tauriScript option. So instead of running yarn tauri <COMMAND> <ARGS> or npm run tauri <COMMAND> <ARGS>, we'll execute ${tauriScript} <COMMAND> <ARGS>.
    • Useful when you need custom build functionality when creating Tauri apps e.g. a desktop:build script.
    • tauriScript can also be an absolute file path pointing to a tauri-cli binary. The path currently cannot contain spaces.
  • If you want to add additional arguments to the build command, you can use the args option. For example, if you're setting a specific target for your build, you can specify args: --target your-target-arch.
  • When your Tauri app is not in the root of the repo, use the projectPath input.
    • Usually it will work without it, but the action will install and use a global @tauri-apps/cli installation instead of your project's CLI which can cause issues if you also configured tauriScript or if you have multiple tauri.conf.json files in your repo.
    • Additionally, relative paths provided via the --config flag will be resolved relative to the projectPath to match Tauri's behavior.
  • If you create the release yourself and provide a releaseId but do not set tagName, the download url for updater bundles in latest.json will point to releases/latest/download/<bundle> which can cause issues if your repo contains releases that do not include updater bundles.
  • If you only want to build the app without having the action upload any assets, for example if you want to only use actions/upload-artifact, simply omit tagName, releaseName and releaseId.

Partners

CrabNebula

For the complete list of sponsors please visit our website and Open Collective.

tauri-action's People

Contributors

1595901624 avatar a-kirami avatar amrbashir avatar atrox avatar bangnokia avatar barrar3port avatar bayswaterpc avatar boywithkeyboard avatar dependabot[bot] avatar ezra-en avatar fabianlars avatar g07cha avatar github-actions[bot] avatar ilyagr avatar jbolda avatar jdukewich avatar kimlimjustin avatar lemarier avatar lorenzolewis avatar lucasfernog avatar ludea avatar nklayman avatar nothingismagick avatar olivierlemasle avatar probablykasper avatar qutek avatar raphiiko avatar renovate[bot] avatar rexcape avatar s00d avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tauri-action's Issues

Parse "../package.json" as app version

The package.version field of tauri.conf.json supports using "../package.json" as a value, so they share the same version. From what I can tell, this package doesn't check if that's the case, leading to an error in my app's workflow:

   Compiling note-boi v0.1.0 (/Users/runner/work/note-boi/note-boi/src-tauri)
    Finished release [optimized] target(s) in 6m 35s
    Bundling NoteBoi.app
    Bundling "/Users/runner/work/note-boi/note-boi/src-tauri/target/release/bundle/dmg/NoteBoi_0.1.3_x64.dmg"
info: running bundle_dmg.sh
    Bundling "/Users/runner/work/note-boi/note-boi/src-tauri/target/release/bundle/macos/NoteBoi.app.tar.gz"
        /Users/runner/work/note-boi/note-boi/src-tauri/target/release/bundle/macos/NoteBoi.app
        /Users/runner/work/note-boi/note-boi/src-tauri/target/release/bundle/dmg/NoteBoi_0.1.3_x64.dmg
        /Users/runner/work/note-boi/note-boi/src-tauri/target/release/bundle/macos/NoteBoi.app.tar.gz (updater)
    Finished 3 bundles at:
[Signed] 1 updater archive at:
        /Users/runner/work/note-boi/note-boi/src-tauri/target/release/bundle/macos/NoteBoi.app.tar.gz.sig
Artifacts: /Users/runner/work/note-boi/note-boi/src-tauri/target/release/bundle/macos/NoteBoi.app,/Users/runner/work/note-boi/note-boi/src-tauri/target/release/bundle/macos/NoteBoi.app.tar.gz,/Users/runner/work/note-boi/note-boi/src-tauri/target/release/bundle/macos/NoteBoi.app.tar.gz.sig.
Couldn't find release with tag v../package.json. Creating one.
Error: Validation Failed: {"resource":"Release","code":"custom","field":"tag_name","message":"tag_name is not a valid tag"}, {"resource":"Release","code":"custom","field":"tag_name","message":"tag_name is not well-formed"}, {"resource":"Release","code":"custom","message":"Published releases must have a valid tag"}

Have I made a mistake somewhere or is this a feature that needs to be added?

Relevant YAML file.

Reading changelog - automate release bodies

Hi there! Thanks for creating and maintaining this.

I recently came across this github action: create-gh-release-action, which parses the CHANGELOG.md file and uses that to create a body for the release.

Might be cool this action supports a similar thing.

Users can also manually set it up using changelog-reader:

      - name: Get Changelog Entry
        id: changelog_reader
        uses: mindsers/changelog-reader-action@v2
        with:
          validation_depth: 10
          version: ${{ steps.tag_name.outputs.current_version }}
          path: ./CHANGELOG.md
      - name: Create/update release
        uses: ncipollo/release-action@v1
        with:
          # This pulls from the "Get Changelog Entry" step above, referencing it's ID to get its outputs object.
          # See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
          tag: ${{ steps.changelog_reader.outputs.version }}
          name: Release ${{ steps.changelog_reader.outputs.version }}
          body: ${{ steps.changelog_reader.outputs.changes }}
          prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}
          draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }}
          allowUpdates: true
          token: ${{ secrets.GITHUB_TOKEN }}

But it would be even better if this was natively supported by this action.

Doesn't build on windows-latest

    Compiling diffuse v3.0.0-alpha.1 (D:\a\diffuse\diffuse\src-tauri)
    Finished release [optimized] target(s) in 6m 00s
info: Verifying wix package
info: Downloading https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip
info: validating hash
info: extracting WIX
info: Target: x64
info: running candle for main.wxs
info: running candle.exe
error: Shell Scripting Error:`error running candle.exe, try running with --verbose to see command output`

 app:spawn Command "cargo" failed with exit code: 1 +1ms

 app:tauri (runner) ⚠️  [FAIL] Cargo CLI has failed +0ms

 app:tauri Shutting down tauri process... +1ms
##[error]Command failed with ENOENT: tauri build
spawn tauri ENOENT

Workflow: https://gist.github.com/icidasset/52c289a08f4a3cd3262a43ca56ce4ae2

Any ideas?
Thanks! ☺️

OSX and Windows do not build with action used as in README

Ubuntu does fine, but for OSX, end of the log (replacing the name of my project with <name>) :

Disk image done
    Finished 2 bundles at:
        /Users/runner/work/<name>/<name>/src-tauri/target/release/bundle/osx/<name>_0.1.0_x64.app
        /Users/runner/work/<name>/<name>/src-tauri/target/release/bundle/dmg/<name>_0.1.0_x64.dmg

 app:tauri Shutting down tauri process... +1ms
##[error]No artifacts were found.

and for windows:

info: running light to produce D:\a\<name>\<name>\src-tauri\target\release\bundle/msi/<name>_0.1.0_x64.msi
Windows Installer XML Toolset Linker version 3.11.2.4516
Copyright (c) .NET Foundation and contributors. All rights reserved.

    Finished 1 bundle at:
        D:\a\<name>\<name>\src-tauri\target\release\bundle/msi/<name>_0.1.0_x64.msi

 app:tauri Shutting down tauri process... +1ms
##[error]No artifacts were found.

This is using the action like below:

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

(direct copy-paste from README -- I've since fixed the body and draft keys)

What needs to be done to have this work? Clearly the action is creating the artifacts fine, just not retaining them.

ubuntu setup

Following the README instructions failed to build a basic Tauri application on ubuntu-latest

It results in this error:

  --- stderr
  `"pkg-config" "--libs" "--cflags" "gtksourceview-3.0" "gtksourceview-3.0 >= 3.0"` did not exit successfully: exit status: 1
  --- stderr
  Package gtksourceview-3.0 was not found in the pkg-config search path.
  Perhaps you should add the directory containing `gtksourceview-3.0.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'gtksourceview-3.0' found
  Package gtksourceview-3.0 was not found in the pkg-config search path.
  Perhaps you should add the directory containing `gtksourceview-3.0.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'gtksourceview-3.0' found

The following command is the only thing that worked (found via Discord search):

 sudo apt-get install -y libgtk-3-dev libgtksourceview-3.0-dev webkit2gtk-4.0 libappindicator3-dev

I also tried this, which failed with the same error:

sudo apt-get install -y libwebkit2gtk-4.0-dev

Having vue-cli-plugin-tauri installed overrides npmScript, calls wrong command anyways

If npmScript is explicitly set, it should be respected, and not overridden regardless of what packages are installed. In addition to that problem, its behavior is just wrong. If vue-cli-plugin-tauri is installed, this action will always call the wrong command. If yarn is detected (which is isn't for me because of #161), it just calls yarn, which doesn't actually build anything. If it isn't detected, then it calls npx run tauri:build, which is also wrong because the NPM package run expects a path to a script, not a package.json script. This was probably intended to be npm, not npx.

Uploaded macOS app includes too many folders

When uploading to GitHub releases, too many folders are included in the tgz:
/Users/runner/work/name/name/src-tauri/target/release/bundle/osx/name_version_x64.app/. The .app file should be at the root of the zip file.

tauri-actions creates multiple release drafts

tauri-actions now creates multiple release drafts for each of the 3 platforms instead of uploading all of the artifacts into a single release draft.

Before/Expected Behavior :
image


Current/Unexpected Behavior :
image

Each of the 1.1.7 releases corresponds to the 3 platforms

Slight indent error in the main example

There is a sligth indentation error in the example action in the README.md line 51 :

on:
push:
  branches:
    - release

push should be one tab righter, I think.

No artifacts found on ubuntu-latest

    Finished release [optimized] target(s) in 3m 46s
    Bundling diffuse_3.0.0-alpha.1_amd64.deb
    Bundling diffuse.AppImage
    Finished 2 bundles at:
        /home/runner/work/diffuse/diffuse/src-tauri/target/release/bundle/deb/diffuse_3.0.0-alpha.1_amd64.deb
        /home/runner/work/diffuse/diffuse/src-tauri/target/release/bundle/appimage/diffuse.AppImage

 app:tauri Shutting down tauri process... +1ms
##[error]No artifacts were found.

Workflow: https://gist.github.com/icidasset/52c289a08f4a3cd3262a43ca56ce4ae2

It does pass on macos-latest though, although no artifacts were uploaded to the release 🤔
Fails on windows-latest, see #40

Thanks!

Add debug input to workflow

The ability to build debug builds would improve the build times on workflows that just checks if a commit still compiles.

Portable windows build

Hello, can we get an example of how to make a portable windows build? So you can download the exe without having to run the MSI.

Thank you.

tauri-action README contains `yarn build` instead of `yarn tauri:build`

tauri-action README contains build action with commands: yarn && yarn build

These commands build just JS part, but Rust part is missing so the job fails: https://github.com/georgik/idf-installer-tauri/runs/5675921396?check_suite_focus=true#step:9:17

Error: No artifacts were found.

The build works without problem after changing the command to: yarn && yarn tauri:build
https://github.com/georgik/idf-installer-tauri/blob/main/.github/workflows/build-installer.yaml#L55

"No artifacts were found" error

We just noticed that tauri-apps/tauri-action@v0 action started failing on Windows with this:

Expected artifacts paths:
D:\a\subspace-desktop\subspace-desktop\src-tauri\target\release\bundle\msi\Subspace Desktop_0.1.0_x64_en-US.msi
D:\a\subspace-desktop\subspace-desktop\src-tauri\target\release\bundle\msi\Subspace Desktop_0.1.0_x64_en-US.msi.zip
D:\a\subspace-desktop\subspace-desktop\src-tauri\target\release\bundle\msi\Subspace Desktop_0.1.0_x64_en-US.msi.zip.sig
Error: No artifacts were found.

I suspect that this might be caused by whitespace in the path, going to verify that next. Action worked fine just 2 days ago.

https://github.com/subspace/subspace-desktop/runs/5458405324?check_suite_focus=true

Integrate updater and migrate to 1.0 API

The GitHub actions should provide everything required for the updater and should expose the built artifacts as well.

  • Updater artifacts
  • Migrate to 1.0
  • Code signing

Github Actions should be fully compatible with the current Tauri version.

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (github>whitesource/merge-confidence:beta)

aarch64 support?

Hello, is it possible to also add an aarch64 build with the releases?

Tauri "Uploading the artifacts to a release" failing even though it worked before

Hello, I've used this code from this repo:

name: "release"
on:
    pull_request:
        branches:
            - master

env:
  CI: false

jobs:
    create-release:
        runs-on: ubuntu-latest
        outputs:
            RELEASE_UPLOAD_ID: ${{ steps.create_release.outputs.id }}

        steps:
            - uses: actions/checkout@v2
            - name: setup node
              uses: actions/setup-node@v1
              with:
                  node-version: 14
            - name: get version
              run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
            - name: create release
              id: create_release
              uses: actions/[email protected]
              env:
                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
              with:
                  tag_name: ${{ env.PACKAGE_VERSION }}
                  release_name: "Remix v${{ env.PACKAGE_VERSION }}"
                  body: CHANGELOG.md
                  draft: false
                  prerelease: false
    build-tauri:
        needs: create-release
        strategy:
            fail-fast: false
            matrix:
                platform: [macos-latest, ubuntu-latest, windows-latest]

        runs-on: ${{ matrix.platform }}
        steps:
            - uses: actions/checkout@v2
            - name: setup node
              uses: actions/setup-node@v1
              with:
                  node-version: 14
            - name: install Rust stable
              uses: actions-rs/toolchain@v1
              with:
                  toolchain: stable
            - name: install tauri bundler
              run: cargo install tauri-bundler --force
            - name: install webkit2gtk libgtk-3-dev libappindicator3-dev (ubuntu only)
              if: matrix.platform == 'ubuntu-latest'
              run: |
                  sudo apt-get update
                  sudo apt-get install -y webkit2gtk-4.0 libgtk-3-dev libappindicator3-dev
            - name: install app dependencies and build it
              run: npm install && npm run build
            - uses: tauri-apps/tauri-action@v0
              env:
                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
              with:
                  releaseId: ${{ needs.create-release.outputs.RELEASE_UPLOAD_ID }}

( I have only added CI: false as it was failing otherwise )
& it worked before. But nor sure what happened later, it keeps on showing these errors:

Screenshot (6)
Screenshot (7)

I'm not sure if the error is from github action itself or the code.

Thanks

[enhancement] Unable to individually Name Release Assets

Building two .msi packages. One for Windows 11 & one for Windows 10, due to this when we go to publish the action creates a race condition and only uploads one of the two .msi packages (as they are the same name). An easy work around for this would be to be able to add a variable to the asset name such as "matrix.platform" or something along these lines.

My suggestion is to simply add assetName: as an option on the publish portion of the workflow.

Can't find Windows artifact

After updating to tauri 1.0.0-rc1:

info: running light to produce D:\a\project\project\src-tauri\target\release\bundle/msi/Project_0.6.0_x64_en-US.msi
    Finished 1 bundle at:
        D:\a\project\project\src-tauri\target\release\bundle/msi/Project_0.6.0_x64_en-US.msi
Done in 674.97s.
Error: No artifacts were found.

https://github.com/tauri-apps/tauri-action/blob/dev/packages/core/index.ts#L312-L325
I noticed that it would search here for Project_0.6.0_x64.msi but the file is now named Project_0.6.0_x64_en-US.msi
It's only the case for the Windows build

Run echo ::set-env name=PACKAGE_VERSION::$(node -p "require('./package.json').version")

Run echo ::set-env name=PACKAGE_VERSION::$(node -p "require('./package.json').version")
Error: Unable to process command '::set-env name=PACKAGE_VERSION::0.1.0' successfully.
Error: The set-env command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the ACTIONS_ALLOW_UNSECURE_COMMANDS environment variable to true. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

Central version bump.

Is your feature request related to a problem? Please describe.
Any time a version bump is required. I need to update three locations

  1. tauri.conf.json : Build version on the binaries.
  2. package.json: Version number for github releases
  3. cargo.toml: I dont think this is honored anywhere, except when using cargo run.

Describe the solution you'd like
A central source of truth? Can tauri.conf.json not be a part of package.json?

Additional context
My folder setup is unique since, my project was originally a rust project using webview. So at build time I need to restructure my folder like this, so that I can create installers via the build cli.

Make it more module-like

At the techtalk tonight, there was a proposal to make this more dry by making this more thin, i.e. just do what the tauri action needs, and nothing more. (let the release action be external)

having an implementation example would help

Option to generate`latest-version.json` for Updater on release

Hi there, thanks for maintaining this!

The Updater can use static JSON files hosted on github to let clients check where to download new versions. This action can create artifacts and host them on github. It seems possible that this action could create the static JSON files that point to these artifacts, too.

Example output JSON:

{
  "name": "v0.31.1",
  "notes": "My release notes!",
  "pub_date": "2022-04-01T19:25:57Z",
  "platforms": {
    "darwin": {
      "url": "https://github.com/joepio/atomic-data-rust/releases/download/v0.31.1/Atomic.Server_0.31.1_aarch64.m1.macbook.dmg"
    },
    "linux": {
      "url": "https://github.com/joepio/atomic-data-rust/releases/download/v1.0.0/app.AppImage.tar.gz"
    },
    "win64": {
      "url": "https://github.com/joepio/atomic-data-rust/releases/download/v1.0.0/app.x64.msi.zip"
    }
  }
}

Example tauri.conf.json:

    "updater": {
      "active": true,
      "endpoints": [
        "https://raw.githubusercontent.com/joepio/atomic-data-rust/master/desktop/latest-version.json"
      ],
      "dialog": true
    },

Is this already the case, and am I missing something, or is this a nice feature?

Seems pretty doable:

  • Add a flag to the action to enable auto updates. Inform users that this entails creating a commit that updates / adds a file.
  • By default, create a latest-version.json in the root directory after creating the artifacts, and link to the download URLs of the artifacts.

Creates `release` even if failed pipeline

If/When one of the platform matrix targets fail, all others continue to upload their asset(s) to the release.

Expected the failed pipeline to not create a release until all matrix targets were successful.

error

running tauri build
[tauri]: running build
ERROR: tauri.conf.json > tauri has unknown property updater +0ms
ERROR: tauri.conf.json > tauri has unknown property windows +1ms
ERROR: tauri.conf.json > tauri > bundle has unknown property macOS +0ms
ERROR: tauri.conf.json > tauri > bundle has unknown property windows +0ms
this
Error: Command failed with exit code 1: tauri build

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Other Branches

These updates are pending. To force PRs open, click the checkbox below.

  • chore(deps): update actions/checkout action to v4

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v2
  • pnpm/action-setup v2
  • actions/setup-node v4
.github/workflows/covector-status.yml
  • actions/checkout v4
.github/workflows/covector-version-or-publish.yml
  • actions/checkout v4
  • actions/setup-node v4
  • pnpm/action-setup v2
  • tauri-apps/create-pull-request v3
.github/workflows/test-action.yml
  • actions/checkout v4
  • pnpm/action-setup v2
  • actions/setup-node v4
  • Swatinem/rust-cache v2
npm
package.json
  • @actions/core 1.10.1
  • @actions/github 6.0.0
  • @iarna/toml 2.2.5
  • execa 8.0.1
  • globby 14.0.1
  • json5 2.2.3
  • string-argv 0.3.2
  • tslib 2.6.2
  • @types/node 20.12.8
  • @typescript-eslint/eslint-plugin 7.8.0
  • @typescript-eslint/parser 7.8.0
  • @vercel/ncc 0.38.1
  • covector 0.10.2
  • eslint 8.57.0
  • eslint-config-prettier 9.1.0
  • prettier 3.2.5
  • typescript 5.4.5
  • pnpm ^8.0.0
  • node >=20

  • Check this box to trigger a request for Renovate to run again on this repository

No artifacts found

Hi there, thanks for creating and maintaining this.

I'm trying to get my action to create the bundles, but for some reason, after building, I get:

Error: No artifacts were found.

However, right before this it seems like artifacts were correctly built:

     Finished 2 bundles at:
        /Users/runner/work/atomic-data-rust/atomic-data-rust/target/release/bundle/macos/Atomic Server.app
        /Users/runner/work/atomic-data-rust/atomic-data-rust/target/release/bundle/dmg/Atomic Server_0.28.2_x64.dmg

github action

Any ideas on how to solve this?

[ci] Release flow

The tag is not created and should be done manually.

Something should be done in Covector to fix this probably.

Steps to release:

  • Run yarn build in packages/core 1st (order is important)
  • Run yarn build in packages/action
  • Push, merge PR, etc...
  • Once covector is done,
  • Make sure v0 (current tag used in our action) is overwritten with the new dev commit ref

ability to specify a target

      - name: install app dependencies and build it
        run: yarn && yarn build
      - uses: tauri-apps/tauri-action@dev
        with:
          tauriScript: yarn tauri build --target ${{ matrix.target }}

produces this

Run tauri-apps/tauri-action@dev
running yarn [ 'tauri', 'build', '--target', 'i686-pc-windows-msvc', 'build' ]
error: Found argument 'build' which wasn't expected, or isn't valid in this context

this feature is needed for building for 32 windows (surprisingly large user base)

[bug] 32 bit windows wix build is broken

Describe the bug

when building for for target stable-i686-pc-windows-msvc using tauri github action this happens:

 info: Verifying wix package
info: Downloading https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip
info: validating hash
info: extracting WIX
thread '<unnamed>' panicked at 'Unexpected target triple x86-pc-windows-msvc', D:\a\tauri\tauri\tooling\bundler\src\bundle\settings.rs:516:7
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Done in 1233.46s.
Expected artifacts paths:
D:\a\blazing-launcher\blazing-launcher\src-tauri\target\release\bundle\msi\BlazingPackLauncher_1.9.0_x64_en-US.msi
D:\a\blazing-launcher\blazing-launcher\src-tauri\target\release\bundle\msi\BlazingPackLauncher_1.9.0_x64_en-US.msi.zip
D:\a\blazing-launcher\blazing-launcher\src-tauri\target\release\bundle\msi\BlazingPackLauncher_1.9.0_x64_en-US.msi.zip.sig
Error: No artifacts were found.

2 bugs here

  1. wix expects x64 binaries even though it's a 32 bit build
  2. https://github.com/tauri-apps/tauri/blob/ed71679368845f603680465fdffcc90fe842bb8c/tooling/bundler/src/bundle/settings.rs#L503 this target is not handled properly for some reason

Reproduction

No response

Expected behavior

No response

Platform and versions

❯ tauri info

Operating System - Manjaro, version 21.2.5 X64

Node.js environment
  Node.js - 16.1.0
  @tauri-apps/cli - 1.0.0-rc.5
  @tauri-apps/api - 1.0.0-rc.1

Global packages
  npm - 7.11.2
  pnpm - Not installed
  yarn - 1.22.10

Rust environment
  rustup - 1.24.3
  rustc - 1.59.0
  cargo - 1.59.0
  toolchain - stable-x86_64-unknown-linux-gnu

App directory structure
/src-tauri
/.svelte-kit
/static
/node_modules
/venv
/icons-original
/build
/.github
/russian-assets
/functions
/.git
/heartbreak
/src
/.mypy_cache
/.vscode
/.log

App
  tauri - 1.0.0-rc.4
  tauri-build - 1.0.0-rc.4
  tao - 0.6.2
  wry - 0.13.3
  build-type - bundle
  CSP - default-src blob: source: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
  distDir - ../build
  devPath - http://localhost:3000/
  framework - Svelte

Stack trace

No response

Additional context

No response

.deb malformed archive

dont know why the workflow produced a malformed .deb archived.
Im using archlinux , so im using debtap to reverse compile .deb to

Output Using Debtap
╰ debtap canopus_0.1.1_amd64.deb 
==> Extracting package data... 
ar: /home/uriah/.tauri/canopus_0.1.1_amd64.deb: malformed archive 
ls: cannot access '*': No such file or directory 
ar: /home/uriah/.tauri/canopus_0.1.1_amd64.deb: malformed archive 
==> Fixing possible directories structure differencies... 
==> Generating .PKGINFO file... 
grep: control: No such file or directory 
grep: control: No such file or directory 
grep: control: No such file or directory 
grep: control: No such file or directory 
grep: control: No such file or directory 
grep: control: No such file or directory 
grep: control: No such file or directory 
grep: control: No such file or directory 
grep: control: No such file or directory 
grep: control: No such file or directory 
grep: control: No such file or directory 
grep: control: No such file or directory 
grep: control: No such file or directory 
grep: control: No such file or directory 
:: Enter Packager name: 
^C 
╭─    ~/.tauri                                                                                                                            SIGINT(2)  

but locally when i build and use debtap to install it on my arch laptop it works...

it produces the correct .pkg.tar.zst file

canopus_0.1.1_amd64  canopus-0.1.1-1-x86_64.pkg.tar.zst

then i can install normally

pacman - U canopus-0.1.1-1-x86_64.pkg.tar.zst

and i can run canopus then on the command line

pic-full-200801-0513-00

maybe there are missing packages when building the deb packages?

also there is no AppImage like...

You can check my repo here Canopus

npmScript command not properly called

the npmScript is supposed to let us use a custom script for the build (in my case, use the --debug flag). However, the action will call yarn <custom script name> build when it should just call yarn <custom script name>

tauri-build: unknown field `tsp`

(mentioned in #147 but #147 is about a different issue)

Ran
cargo install tauri-cli --version 1.0.0-rc.7

But still encountered the issue :/

Cargo/Rust cargo 1.61.0-nightly (65c826642 2022-03-09)

Screen Shot 2022-03-14 at 3 36 35 PM

Here's the text from the image.



   Compiling tauri-utils v1.0.0-rc.3
   Compiling tauri-bundler v1.0.0-rc.3
   Compiling tauri-cli v1.0.0-rc.7
    Finished release [optimized] target(s) in 8m 54s
   Replacing /Users/jeffhykin/repos/testing-tauri/settings/home/.cargo/bin/cargo-tauri
    Replaced package `tauri-cli v1.0.0-rc.7 (https://github.com/tauri-apps/tauri/?rev=4c84559e1f3019e7aa2666b10a1a0bd97bb09d24#4c84559e)` with `tauri-cli v1.0.0-rc.7` (executable `cargo-tauri`)

Graviton-App on  main via 𝗥 v1.61.0 took 8m 54s 
∫ yarn dev_desktop                            
yarn run v1.22.10
$ jake dev_web_components dev_desktop
Starting 'dev_web_components'...
Finished 'dev_web_components' after 6 ms
Starting 'dev_desktop'...
[tauri:dev] Running `yarn --cwd ../web run dev`
[tauri:dev] Waiting for your frontend dev server to start on http://localhost:8080/...
$ tsc && vite build --watch
$ vite

  vite v2.7.10 dev server running at:

  > Local: http://localhost:8080/
  > Network: use `--host` to expose

  ready in 1841ms.

   Compiling gveditor-core-deno v0.1.0 (/Users/jeffhykin/repos/testing-tauri/Graviton-App/core_deno)
   Compiling git2 v0.13.25
   Compiling graviton v0.1.0 (/Users/jeffhykin/repos/testing-tauri/Graviton-App/desktop/src-tauri)
error: failed to run custom build command for `graviton v0.1.0 (/Users/jeffhykin/repos/testing-tauri/Graviton-App/desktop/src-tauri)`

Caused by:
  process didn't exit successfully: `/Users/jeffhykin/repos/testing-tauri/target.ignore/debug/build/graviton-5f99b6ae7c6779cd/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=tauri.conf.json

  --- stderr
  thread 'main' panicked at 'error found during tauri-build: unknown field `tsp`, expected one of `digestAlgorithm`, `certificateThumbprint`, `timestampUrl`, `webviewFixedRuntimePath`, `wix` at line 1 column 924', /Users/jeffhykin/repos/testing-tauri/settings/home/.cargo/registry/src/github.com-1ecc6299db9ec823/tauri-build-1.0.0-rc.3/src/lib.rs:146:5
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/e95b10ba4ac4564ed25f7eef143e3182c33b3902/library/std/src/panicking.rs:584:5
     1: core::panicking::panic_fmt
               at /rustc/e95b10ba4ac4564ed25f7eef143e3182c33b3902/library/core/src/panicking.rs:143:14
     2: tauri_build::build
               at /Users/jeffhykin/repos/testing-tauri/settings/home/.cargo/registry/src/github.com-1ecc6299db9ec823/tauri-build-1.0.0-rc.3/src/lib.rs:146:5
     3: build_script_build::main
               at ./src/build.rs:2:5
     4: core::ops::function::FnOnce::call_once
               at /rustc/e95b10ba4ac4564ed25f7eef143e3182c33b3902/library/core/src/ops/function.rs:227:5
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
warning: build failed, waiting for other jobs to finish...
    Building [=======================> ] 681/685: git2                                                                                                                                                                                            
Found 0 errors. Watching for file changes.

Ignores `draft` option

While releasing, using this config block immediately creates a public release instead of a release draft

    - name: Tauri Build
      uses: tauri-apps/tauri-action@v0
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        # NOTE: "__VERSION__" automatically replaced
        tagName: v__VERSION__
        releaseName: v__VERSION__
        body: "See the assets to download this version and install."
        prerelease: false
        draft: true

Also, it seems like the body is ignored too.
This is what a release looks like upon completion:

Screen Shot 2021-06-21 at 4 52 26 PM

Code signing on macOS fails.

I got the following error message:

[tauri:build] Binary stripped, size reduced by 1.69 MB
    Bundling gh-action-tauri.app
info: setup keychain from environment variables...
Error running CLI: failed to bundle project: failed to import keychain certificate Ok(""): failed to import keychain certificate Ok("")
Error: Command failed with exit code 1: npx tauri build

.github/workflows/publish.yml:

name: 'publish'
on:
  push:

jobs:
  publish-tauri:
    strategy:
      fail-fast: false
      matrix:
        platform: [macos-latest, ubuntu-latest]

    runs-on: ${{ matrix.platform }}
    steps:
      - uses: actions/checkout@v2
      - name: setup node
        uses: actions/setup-node@v1
        with:
          node-version: 16
      - name: install Rust stable
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
      - name: install webkit2gtk (ubuntu only)
        if: matrix.platform == 'ubuntu-latest'
        run: |
          sudo apt-get update
          sudo apt-get install -y webkit2gtk-4.0
      - name: install app dependencies and build it
        run: npm i
      - uses: tauri-apps/tauri-action@v0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }}
          APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
          APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
          APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_IDENTITY_ID }}
          APPLE_ID: ${{ secrets.APPLE_ID }}
          APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
        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

my actions secrets:

APPLE_SIGNING_IDENTITY="Developer ID Application: **** ******* (***FKK**3B)"
APPLE_CERTIFICATE="AgEAMIIGxQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQYw ~ C2PDAn=="
APPLE_CERTIFICATE_PASSWORD="************"
APPLE_ID="[email protected]"
APPLE_PASSWORD="*my*-*app-spec-pswd"

Handle universal and aarch64 targets

I can currently build for aarch64 targets by using a self-hosted action runner on an apple silicone mac.
The problem is that all the paths aren't automatically recognized:

2022-03-17T18:01:22.2682550Z    Finished 2 bundles at:
2022-03-17T18:01:22.2683610Z         /Users/user/actions-runner/_work/project/project/target/release/bundle/macos/Project.app
2022-03-17T18:01:22.2700850Z         /Users/user/actions-runner/_work/project/project/target/release/bundle/dmg/Project_0.1.21_aarch64.dmg
2022-03-17T18:01:22.2701870Z [vite-plugin-tauri]  Tauri build finished.
2022-03-17T18:01:22.3124470Z Expected artifacts paths:
2022-03-17T18:01:22.3225410Z /Users/user/actions-runner/_work/project/project/target/release/bundle/dmg/Project_0.1.21_x64.dmg
2022-03-17T18:01:22.3248440Z /Users/user/actions-runner/_work/project/project/target/release/bundle/macos/Project.app
2022-03-17T18:01:22.3255780Z /Users/user/actions-runner/_work/project/project/target/release/bundle/macos/Project.app.tar.gz
2022-03-17T18:01:22.3258900Z /Users/user/actions-runner/_work/project/project/target/release/bundle/macos/Project.app.tar.gz.sig
2022-03-17T18:01:22.3260130Z Artifacts: /Users/user/actions-runner/_work/project/project/target/release/bundle/macos/Project.app.
2022-03-17T18:01:22.6631630Z Found release with tag 0.1.21.
2022-03-17T18:01:22.6632090Z 
2022-03-17T18:01:22.6665300Z 
2022-03-17T18:01:22.6669470Z 
2022-03-17T18:01:22.6671720Z running tar [
2022-03-17T18:01:22.6672460Z   'czf',
2022-03-17T18:01:22.6673430Z   '/Users/user/actions-runner/_work/project/project/target/release/bundle/macos/Project.app.tar.gz',
2022-03-17T18:01:22.6674240Z   '-C',
2022-03-17T18:01:22.6675050Z   '/Users/user/actions-runner/_work/project/project/target/release/bundle/macos',
2022-03-17T18:01:22.6675810Z   'Project.app'
2022-03-17T18:01:22.6676340Z ]

In this case only Project.app is recognized but Project_0.1.21_aarch64.dmg is ignored because aarch64 doesn't match process.arch
used in the code here:

`bundle/dmg/${fileAppName}_${app.version}_${process.arch}.dmg`

Similarly I can build universal apps:

     with:
        args: -- --target universal-apple-darwin

But the problem here is that tauri-action doesn't recognize any of the artifacts because they don't match the expected path names

2022-03-17T20:20:45.3165570Z  Finished 2 bundles at:
2022-03-17T20:20:45.3167070Z         /Users/user/actions-runner/_work/myproject/myproject/target/universal-apple-darwin/release/bundle/macos/Project.app
2022-03-17T20:20:45.3168430Z         /Users/user/actions-runner/_work/myproject/myproject/target/universal-apple-darwin/release/bundle/dmg/Project_0.1.21_universal.dmg
2022-03-17T20:20:45.3189960Z [vite-plugin-tauri]  Tauri build finished.
2022-03-17T20:20:45.3616230Z Expected artifacts paths:
2022-03-17T20:20:45.3617800Z /Users/user/actions-runner/_work/myproject/myproject/target/release/bundle/dmg/Project_0.1.21_x64.dmg
2022-03-17T20:20:45.3619020Z /Users/user/actions-runner/_work/myproject/myproject/target/release/bundle/macos/Project.app
2022-03-17T20:20:45.3620360Z /Users/user/actions-runner/_work/myproject/myproject/target/release/bundle/macos/Project.app.tar.gz
2022-03-17T20:20:45.3621590Z /Users/user/actions-runner/_work/myproject/myproject/target/release/bundle/macos/Project.app.tar.gz.sig
2022-03-17T20:20:45.3657480Z [error]No artifacts were found.

specifically /target/universal-apple-darwin/release/bundle/macos/ doesn't match /target/release/bundle/macos/

Possible solutions:

  • add an environment variable/parameter for arch and then fall back on process.arch if not defined and add universal-apple-darwin, x86_64-apple-darwin, aarch64-apple-darwin as a possible path to look for artifacts.
  • add environment variables/parameters for the full path of each of the artifacts

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.