mirror of
https://github.com/tauri-apps/tauri-action.git
synced 2026-01-31 00:35:20 +01:00
fix: retry full json upload step on failure (#1199)
This commit is contained in:
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
39
src/index.ts
39
src/index.ts
@@ -9,7 +9,7 @@ import { getOrCreateRelease } from './create-release';
|
||||
import { uploadAssets as uploadReleaseAssets } from './upload-release-assets';
|
||||
import { uploadVersionJSON } from './upload-version-json';
|
||||
import { buildProject } from './build';
|
||||
import { execCommand, getInfo, getTargetInfo } from './utils';
|
||||
import { execCommand, getInfo, getTargetInfo, retry } from './utils';
|
||||
|
||||
import type { Artifact, BuildOptions } from './types';
|
||||
import { uploadWorkflowArtifacts } from './upload-workflow-artifacts';
|
||||
@@ -208,21 +208,28 @@ async function run(): Promise<void> {
|
||||
);
|
||||
|
||||
if (includeUpdaterJson) {
|
||||
await uploadVersionJSON(
|
||||
owner,
|
||||
repo,
|
||||
info.version,
|
||||
body,
|
||||
tagName,
|
||||
releaseId,
|
||||
artifacts,
|
||||
targetInfo,
|
||||
info.unzippedSigs,
|
||||
updaterJsonPreferNsis,
|
||||
retryAttempts,
|
||||
githubBaseUrl,
|
||||
isGitea,
|
||||
releaseAssetNamePattern,
|
||||
// Once we start throwing our own errors in this function we may need some custom retry logic.
|
||||
// We can't retry just the inner asset upload as that may upload an outdated latest.json file.
|
||||
await retry(
|
||||
() =>
|
||||
uploadVersionJSON(
|
||||
owner,
|
||||
repo,
|
||||
info.version,
|
||||
body,
|
||||
tagName,
|
||||
releaseId,
|
||||
artifacts,
|
||||
targetInfo,
|
||||
info.unzippedSigs,
|
||||
updaterJsonPreferNsis,
|
||||
retryAttempts,
|
||||
githubBaseUrl,
|
||||
isGitea,
|
||||
releaseAssetNamePattern,
|
||||
),
|
||||
// since all jobs try to upload this file it tends to conflict often so we want to retry it at least once.
|
||||
retryAttempts === 0 ? 1 : retryAttempts,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -34,7 +34,7 @@ export async function uploadVersionJSON(
|
||||
targetInfo: TargetInfo,
|
||||
unzippedSig: boolean,
|
||||
updaterJsonPreferNsis: boolean,
|
||||
retryAttempts: number,
|
||||
_retryAttempts: number,
|
||||
githubBaseUrl: string,
|
||||
isGitea: boolean,
|
||||
releaseAssetNamePattern?: string,
|
||||
@@ -335,7 +335,9 @@ export async function uploadVersionJSON(
|
||||
repo,
|
||||
releaseId,
|
||||
[artifact],
|
||||
retryAttempts,
|
||||
// The whole step will be retried where `uploadVersionJSON` is called.
|
||||
// Just in case it's a quick http hickup we retry it once here as well.
|
||||
1,
|
||||
githubBaseUrl,
|
||||
isGitea,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user