Skip to content

Conversation

@Snider
Copy link
Owner

@Snider Snider commented Dec 25, 2025

This plan outlines the refactoring of the build action to use GoTask
(go-task/task) as the build orchestrator instead of inline shell scripts.

Primary goals:

  • Wails 2 builds (preserve current functionality)
  • Wails 3 builds (new support)

Key architectural changes:

  • Taskfile.yml with modular task includes (wails2, wails3, common)
  • Cross-platform consistency with single task definitions
  • Local development parity - same tasks run locally and in CI
  • Auto-detection of Wails version via wails.json parsing

Also includes v3 branch code snapshot for reference.

This plan outlines the refactoring of the build action to use GoTask
(go-task/task) as the build orchestrator instead of inline shell scripts.

Primary goals:
- Wails 2 builds (preserve current functionality)
- Wails 3 builds (new support)

Key architectural changes:
- Taskfile.yml with modular task includes (wails2, wails3, common)
- Cross-platform consistency with single task definitions
- Local development parity - same tasks run locally and in CI
- Auto-detection of Wails version via wails.json parsing

Also includes v3 branch code snapshot for reference.
@gemini-code-assist
Copy link

Summary of Changes

Hello @Snider, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant architectural overhaul to the build system, transitioning from ad-hoc shell scripts to a more structured and maintainable approach using GoTask. This refactoring enhances the build process for Wails applications, providing explicit support for both Wails v2 and the upcoming Wails v3, while also laying the groundwork for future multi-stack build capabilities. The changes promote cross-platform consistency, improve local development parity, and are accompanied by comprehensive documentation for easier adoption and understanding.

Highlights

  • Build System Refactoring: The build process has been refactored to use GoTask as the primary orchestrator, replacing inline shell scripts for improved consistency and maintainability across platforms.
  • Modular GitHub Actions: The GitHub Action has been broken down into a series of modular composite actions (discovery, setup, build, sign, package) for better organization, reusability, and clearer separation of concerns.
  • Wails Version Support: The action now explicitly supports both Wails v2 builds (preserving existing functionality) and introduces new support for Wails v3 builds, with intelligent auto-detection.
  • Enhanced Auto-Detection: The system includes improved logic to auto-detect the Wails version (v2 or v3) and other project markers, allowing for smarter build orchestration and simplified configuration.
  • Comprehensive Documentation: Extensive new documentation has been added, detailing the architecture, configuration, getting started guides, and specific stack information for easier adoption and understanding.
  • Improved Local Development Parity: The shift to GoTask aims to enable developers to run the same build tasks locally as in CI, fostering consistency and reducing 'it works on my machine' issues.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (3)
    • .github/workflows/ci.yml
    • .github/workflows/wails-build.yml
    • .github/workflows/wails2.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a significant and well-executed refactoring of the build action. Moving to a modular, sub-action-based architecture and using GoTask for build orchestration are excellent improvements for maintainability, cross-platform consistency, and local development parity. The addition of extensive documentation and test fixtures is also highly commendable.

I've identified a few issues, primarily related to the new orchestration logic and shell script correctness. The most critical issue is a hardcoded path in the Windows signing action that will cause it to fail on standard runners. There are also some redundancies in the action calls and a bug in how build tags are passed to the compiler. Addressing these points will make the new architecture more robust and efficient.

Comment on lines +97 to +109
- name: Sign Windows binaries
shell: powershell
if: runner.os == 'Windows' && inputs.sign != 'false' && inputs.sign-windows-cert != ''
working-directory: ${{ inputs.app-working-directory }}
run: |
echo "Creating certificate file"
New-Item -ItemType directory -Path certificate
Set-Content -Path certificate\certificate.txt -Value '${{ inputs.sign-windows-cert }}'
certutil -decode certificate\certificate.txt certificate\certificate.pfx
echo "Signing our binaries"
& 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /fd sha256 /tr http://ts.ssl.com /f certificate\certificate.pfx /p '${{ inputs.sign-windows-cert-password }}' .\build\bin\${{ inputs.build-name }}.exe
echo "Signing Installer"
& 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /fd sha256 /tr http://ts.ssl.com /f certificate\certificate.pfx /p '${{ inputs.sign-windows-cert-password }}' .\build\bin\${{ inputs.build-name }}-amd64-installer.exe

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The path to signtool.exe is hardcoded to a specific Windows SDK version (10.0.17763.0). This is very brittle and will cause the signing step to fail on any machine or GitHub-hosted runner with a different SDK version installed.

The path should be located dynamically at runtime. You can achieve this by searching common Windows Kits directories. Here is an example of how you could implement this in PowerShell:

$signToolPaths = @(
    (Get-ChildItem -Path "${Env:ProgramFiles(x86)}\Windows Kits\10\bin" -Filter "signtool.exe" -Recurse -ErrorAction SilentlyContinue | Select-Object -Last 1),
    (Get-ChildItem -Path "${Env:ProgramFiles(x86)}\Windows Kits\11\bin" -Filter "signtool.exe" -Recurse -ErrorAction SilentlyContinue | Select-Object -Last 1)
)
$signToolPath = ($signToolPaths | Where-Object { $_ } | Select-Object -Last 1).FullName

if (-not $signToolPath) {
    Write-Error "signtool.exe not found in common Windows SDK locations."
    exit 1
}
Write-Host "Found signtool.exe at: $signToolPath"

# ... rest of script ...

& $signToolPath sign ...

Comment on lines +72 to +82
- name: Package & release
uses: ./actions/package
with:
files: |
*/bin/*
package: ${{ inputs.package }}
build-name: ${{ inputs.build-name }}
os: ${{ steps.discovery.outputs.OS }}
arch: ${{ steps.discovery.outputs.ARCH }}
tag: ${{ steps.discovery.outputs.TAG }}
is-tag: ${{ steps.discovery.outputs.IS_TAG }}
short-sha: ${{ steps.discovery.outputs.SHORT_SHA }}
ref: ${{ steps.discovery.outputs.REF }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This Package & release step appears to be redundant. The dir_orch step at line 53 calls the wails2 wrapper, which already contains its own Package & release step.

Executing the packaging logic twice will result in artifacts being uploaded twice and could cause the GitHub Release creation to fail on the second attempt. The responsibility for packaging should ideally lie within the stack-specific wrapper to keep the pipeline self-contained.

Comment on lines +182 to +186
- name: Discovery
id: discovery
uses: ./actions/discovery
with:
working-directory: ${{ inputs.app-working-directory }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This Discovery step is redundant when the wails2 wrapper is called from the root action.yml, as the root action already performs a discovery step. This leads to unnecessary work and potential inconsistencies if the discovery logic were to diverge.

Since this action is designed to be callable on its own, a good solution would be to make this step conditional. It should only run if discovery data (like OS, arch, etc.) is not passed in via inputs. This would make the action both self-contained and efficient when used as part of the larger orchestration.

esac
fi
if [[ -n "$norm_tags" ]]; then
build_options+=" -tags${norm_tags}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The build tags are being added to the options string without quotes. Since norm_tags contains a space-separated list, the shell will interpret each tag as a separate argument to wails build rather than a single, space-delimited string for the -tags flag. This will cause the build to fail or behave unexpectedly.

The tags should be wrapped in single quotes to ensure they are passed as a single argument.

          build_options+=" -tags '${norm_tags# }'"

Comment on lines +10 to +18
> I help on lots of open source projects, im tired of doing the same thing over and over again.\
> so, I'm going to put them all together in one place.\
> Hopefully it will help you too.
General build action (multi-stack).

By default, the root action will best guess the builds you might want to run and delegate to the appropriate sub-action. You can also explicitly select a stack and enable/disable setup steps.

you should write out an action that cherry-picks the parts you need; the auto-detected method works for me, based on the file structures in the tdd/* folders

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The introductory text is a bit informal and contains a sentence that might be confusing for new users. Improving the wording would enhance clarity and professionalism, making the action more approachable.

For example:

Lines 10-12:

- > I help on lots of open source projects, im tired of doing the same thing over and over again.\n- > so, I'm going to put them all together in one place.\n- > Hopefully it will help you too.
+ > I contribute to many open-source projects and found myself repeating the same build configurations. This action consolidates that work into a reusable, multi-stack builder that I hope you find useful too.

Line 18:

- you should write out an action that cherry-picks the parts you need; the auto-detected method works for me, based on the file structures in the tdd/* folders
+ For advanced customization, you can call the modular sub-actions directly in your workflow to cherry-pick the exact steps you need. The auto-detection method is designed to work for common project layouts, like those found in the `tdd/*` examples.

Comment on lines +7 to +44
description: ""
sign:
required: false
default: "false"
description: ""
package:
required: false
default: "true"
description: ""
build-name:
required: true
description: ""
build-platform:
required: false
default: "darwin/universal"
description: ""
app-working-directory:
required: false
default: "."
description: ""
# Orchestrator controls
AUTO_STACK:
required: false
default: "true"
description: ""
AUTO_SETUP:
required: false
default: "true"
description: ""
STACK:
required: false
default: ""
description: ""
# Optional hint from a prior discovery step
PRIMARY_STACK_SUGGESTION:
required: false
default: ""
description: ""

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The descriptions for all inputs in this action are empty. Adding clear descriptions is crucial for maintainability and makes the action much easier for other developers to use and understand without having to read the underlying code.

Comment on lines +72 to +106
required: false
default: ''
description: ""
sign-macos-apple-password:
required: false
default: ''
description: ""
sign-macos-app-cert:
required: false
default: ''
description: ""
sign-macos-app-cert-password:
required: false
default: ''
description: ""
sign-macos-installer-id:
required: false
default: ''
description: ""
sign-macos-installer-cert:
required: false
default: ''
description: ""
sign-macos-installer-cert-password:
required: false
default: ''
description: ""
sign-windows-cert:
required: false
default: ''
description: ""
sign-windows-cert-password:
required: false
default: ''
description: ""

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Many of the signing-related inputs have empty descriptions. Given the complexity of code signing, providing clear descriptions for what each input does and what value it expects is essential for a good user experience.

if [ -f "frontend/package.json" ]; then has_frontend_pkg=1; found_files+=("frontend/package.json"); fi
# Light subtree search up to depth 2 for package.json and mkdocs.yml
if command -v find >/dev/null 2>&1; then
if find . -maxdepth 2 -mindepth 2 -name package.json | grep -q .; then has_sub_npm=1; fi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The find command used to detect a nested package.json does not exclude the node_modules directory. This could lead to false positives if a dependency contains its own package.json, potentially causing incorrect stack detection. The PowerShell equivalent in this file correctly handles this by exclusion.

          if find . -maxdepth 2 -mindepth 2 -name package.json -not -path "./node_modules/*" | grep -q .; then has_sub_npm=1; fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants