-
Notifications
You must be signed in to change notification settings - Fork 153
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
retry arg #900
Comments
this feature would save me so much time |
Here's a suggested change using the diff markdown syntax for adding a retry argument to the tauri-action: diff --git a/src/index.ts b/src/index.ts
index 1234567..abcdef0 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -24,6 +24,7 @@ async function run(): Promise<void> {
const includeDebug = core.getBooleanInput('includeDebug');
const includeUpdaterJson = core.getBooleanInput('includeUpdaterJson');
const updaterJsonKeepUniversal = core.getBooleanInput('updaterJsonKeepUniversal');
+ const retryAttempts = parseInt(core.getInput('retryAttempts') || '1', 10);
const tauriScript = core.getInput('tauriScript');
const args = stringArgv(core.getInput('args'));
const bundleIdentifier = core.getInput('bundleIdentifier');
@@ -76,14 +77,22 @@ async function run(): Promise<void> {
const releaseArtifacts: Artifact[] = [];
const debugArtifacts: Artifact[] = [];
if (includeRelease) {
- releaseArtifacts.push(
- ...(await buildProject(projectPath, false, buildOptions, initOptions)),
- );
+ for (let attempt = 1; attempt <= retryAttempts; attempt++) {
+ try {
+ releaseArtifacts.push(
+ ...(await buildProject(projectPath, false, buildOptions, initOptions)),
+ );
+ break;
+ } catch (error) {
+ if (attempt === retryAttempts) throw error;
+ console.log(`Build attempt ${attempt} failed, retrying...`);
+ }
+ }
}
if (includeDebug) {
- debugArtifacts.push(
- ...(await buildProject(projectPath, true, buildOptions, initOptions)),
- );
+ // Similar retry logic for debug build
+ // ...
+ }
const artifacts = releaseArtifacts.concat(debugArtifacts);
if (artifacts.length === 0) { This change introduces a new To use this new feature, you would add a new input to your GitHub Action workflow: - uses: tauri-apps/tauri-action@v0
with:
# ... other inputs ...
retryAttempts: 3 This would allow the build to retry up to 3 times if it fails. |
keep having failed build that seem non deterministic
https://github.com/mediar-ai/screenpipe/actions/workflows/release-app.yml
usually:
having a way to retry would save me probably at least 1h a week because i release 3 version a day on average
The text was updated successfully, but these errors were encountered: