From fc4608ec08ea74be658f321b25a06bffd4c62aeb Mon Sep 17 00:00:00 2001 From: FabianLars Date: Thu, 9 Oct 2025 16:31:26 +0200 Subject: [PATCH] feat: new `-setup` injection for namePattern --- .github/workflows/test-action.yml | 4 ++-- README.md | 5 ++++- dist/index.js | 1 + src/types.d.ts | 1 + src/utils.ts | 1 + 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index 70fbe51..41cf6ff 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -176,7 +176,7 @@ jobs: args: ${{ matrix.args }} updaterJsonKeepUniversal: true retryAttempts: 1 - assetNamePattern: '[name]x[version]x[platform]x[arch]x[mode]x[ext]' + assetNamePattern: '[name]x[version]x[platform]x[arch]x[mode]x[setup]x[ext]' uploadPlainBinary: true - name: Frontend-only Project @@ -270,7 +270,7 @@ jobs: args: ${{ matrix.args }} updaterJsonKeepUniversal: true retryAttempts: 1 - assetNamePattern: '[name]x[version]x[platform]x[arch]x[mode]x[ext]' + assetNamePattern: '[name]x[version]x[platform]x[arch]x[mode]x[setup]x[ext]' uploadPlainBinary: true - name: Frontend-only Project diff --git a/README.md b/README.md index a691852..c3d09df 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ These inputs allow you to modify the GitHub release. | `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 | -| `assetNamePattern` | false | The naming pattern to use for the uploaded assets. If not set, the names given by Tauri's CLI are kept. Currently does not affect files uploaded by `uploadPlainBinary`. | string | none | +| `assetNamePattern` | false | The naming pattern to use for the uploaded assets. If not set, the names given by Tauri's CLI are kept. | string | none | | `uploadPlainBinary` | false | Whether to upload the unbundled executable binary or not. Requires Tauri v2+. To prevent issues with Tauri's [`bundle_type`](https://docs.rs/tauri-utils/latest/tauri_utils/platform/fn.bundle_type.html) value this should only be used with the `--no-bundle` flag. | bool | false | ## Outputs @@ -156,6 +156,9 @@ These inputs allow you to modify the GitHub release. - If you provide a `tagName` to an existing release, `releaseDraft` must be set to `true` if the existing release is a draft. - 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`](https://github.com/actions/upload-artifact), simply omit `tagName`, `releaseName` and `releaseId`. - Only enable `uploadPlainBinary` if you are sure what you're doing since Tauri doesn't officially support a portable mode, especially on platforms other than Windows where standalone binaries for GUI applications basically do not exist. +- `assetNamePattern` offers a few variables that will be replaced automatically if encapsulated in `[]`. Currently available variables are: `[name]`, `[version]`, `[platform]`, `[arch]`, `[mode]`, `[setup]`, `[ext]`. + - `[mode]`: `debug` or `release`, depending on `includeDebug` and `includeRelease`. + - `[setup]` will be replaced with `-setup` which can be used to differenciate between the NSIS installer and the binary from `uploadPlainBinary`. For all other bundle types it will be an empty string. ## Partners diff --git a/dist/index.js b/dist/index.js index 9f4908d..937db4e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -53225,6 +53225,7 @@ function createArtifact({ path, name, debug, platform, arch, bundle, version, }) bundle, ext, version, + setup: bundle == 'nsis' ? '-setup' : '', }; } function getPackageJson(root) { diff --git a/src/types.d.ts b/src/types.d.ts index 7e29960..ae4f079 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -25,6 +25,7 @@ export interface Artifact { bundle: string; ext: string; version: string; + setup: '-setup' | ''; } export interface BuildOptions { diff --git a/src/utils.ts b/src/utils.ts index 9fc071a..6f9fdb0 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -146,6 +146,7 @@ export function createArtifact({ bundle, ext, version, + setup: bundle == 'nsis' ? '-setup' : '', }; }