Coder Social home page Coder Social logo

tauri-release's Introduction

tauri-release

๐Ÿ”— tauri release toolchain

npm npm downloads node version

Note: @tauri-release/cli needs to be used with Tauri GitHub Action.

Why you need Tauri GitHub Action?

The @tauri-release/cli updater subcommand need to read the zip information from the github releases, and use it as a data source for the updater json to automate the application updates.

Features

Note: @tauri-release/cli needs to be used with Tauri GitHub Action.

Install

# Npm
npm i -D @tauri-release/cli

# Yarn
yarn add -D @tauri-release/cli

# Pnpm
pnpm i -D @tauri-release/cli

Usage

# long command
tauir-release

# short command
tr

# help
tr -h

subCommand

release

Automatic version upgrade, the default value is --patch:

  • major
  • minor
  • patch
# 0.x.x -> 1.x.x
tr release --major

# x.0.x -> x.1.x
tr release --minor

# x.x.0 -> x.x.1
tr release
--git

Enable the git command to automatically submit after the version is updated, create a tag and push it to the remote repository (git add -> git commit -> git tag -> git push)

# default is not enabled
tr release -major

# enable
tr release --major --git
--logfile

Customize the update-log file path, the default name is UPDATE_LOG.md.

tr release --git

# custom file
tr release --git --logfile="src/update_log.md"

new

log

Generate tauri update-log file, the default name is UPDATE_LOG.md.

tr new log

# custom file
tr new --logfile="src/update_log.md"
action

Generate github action file, the default name is .github/workflows/release.yml.

tr new action

# custom file
tr new action --actionfile=".github/workflows/tauri-release.yml"

updater

Generate tauri update file, the default name is updater/install.json. [Tauri doc] Update File JSON Format.

tr updater --owner=GITHUB_OWNER --repo=GITHUB_REPO --token=GITHUB_TOKEN

# custom file
# The notes field value in the json file needs to be obtained from the update_log file
tr updater --owner=GITHUB_OWNER --repo=GITHUB_REPO --token=GITHUB_TOKEN --logfile="src/update_log.md"

override

Override productName or version (tauri.conf.json > package):

--name
# package.productName
tr override --name=TauriApp
--version
# package.version
tr override --version="../package.json"

--json.a_b_c

Any field in any json file can be overwritten, the field cannot contain _.

  • key: a_b_c -> a.b.c
  • value: number | null | boolean | string
# package_productName -> package.productName
# tauri_allowlist_all -> tauri.allowlist.all
tr override --json.package_productName="WA" --json.tauri_allowlist_all=true
--jsonfile

Customize the tauri.conf.json path, the default is src-tauri/tauri.conf.json (tauri.conf.json).

tr override --name="hello-tauri" --version="../package.json" --jsonfile="src/path/tauri.conf.json"

# any field in any json file
# a_b_c -> a.b.c
# b_c -> b.c
tr override --json.a_b_c=true --json.b_c=20 --jsonfile="test.json"

Examples

lencx/WA/package.json

{
  "scripts": {
    "dev": "vite",
    "build": "tsc && vite build",
    "preview": "vite preview",
    "tauri": "tauri",
    "tr": "tr",
    "updater": "tr updater",
    "release": "tr release --git",
    "fix:linux": "tr override --name=WA"
  },
}

lencx/WA/.github/workflows/release.yml

# ...
      - name: fix linux build
        if: matrix.platform == 'ubuntu-latest'
        run: |
          yarn fix:linux

# ...
  updater:
    runs-on: ubuntu-latest
    needs: [create-release, build-tauri]

    steps:
      - uses: actions/checkout@v2
      - run: yarn
      - run: yarn updater --token=${{ secrets.GITHUB_TOKEN }}

      - name: Deploy install.json
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./updater
          force_orphan: true

tauri-release's People

Contributors

lencx avatar

Stargazers

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

Watchers

 avatar  avatar

tauri-release's Issues

[Bug] Tag x.x.x does not exist

Based on the documentation, --git will automatically create the tag and push it

--git
Enable the git command to automatically submit after the version is updated, create a tag and push it to the remote repository (git add -> git commit -> git tag -> git push)

But...

โฏ pnpm release

> [email protected] release /Users/user/App
> tr release --git

[๐Ÿ’ข updater] UPDATE_LOG.md Tag v0.0.1 does not exist.

[bug] Error: Command failed: git add ./package.json .UPDATE_LOG.md

โฏ yarn release
yarn run v1.22.19
$ tr release --git
fatal: pathspec '.UPDATE_LOG.md' did not match any files
node:internal/errors:856
  const err = new Error(message);
              ^

Error: Command failed: git add ./package.json .UPDATE_LOG.md
fatal: pathspec '.UPDATE_LOG.md' did not match any files

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.