-
Notifications
You must be signed in to change notification settings - Fork 20
ci(desktop): add multi-platform build and release workflow #3
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| # Build and publish the HugAgentOS Tauri desktop client for all platforms. | ||
| # | ||
| # Tauri cannot cross-compile, so each OS is built on its own native runner | ||
| # (macOS / Ubuntu / Windows) and the artifacts are collected into a single | ||
| # GitHub Release. Updater artifacts (*.sig + latest.json) are produced too, | ||
| # using the shared signing key stored in repository secrets. | ||
| # | ||
| # ── Required repository secrets ───────────────────────────────────────────── | ||
| # TAURI_SIGNING_PRIVATE_KEY updater private key (content of the | ||
| # `.key` file; base64 is expected as-is). | ||
| # Build FAILS without it because | ||
| # tauri.conf.json sets createUpdaterArtifacts. | ||
| # TAURI_SIGNING_PRIVATE_KEY_PASSWORD key password ("" if none). | ||
| # GITHUB_TOKEN auto-provided; used to create the Release. | ||
| # | ||
| # ── How to cut a release ──────────────────────────────────────────────────── | ||
| # 1. Bump the version in desktop/package.json, desktop/src-tauri/Cargo.toml | ||
| # and desktop/src-tauri/tauri.conf.json (keep them in sync). | ||
| # 2. Push a tag `desktop-vX.Y.Z` (or run this workflow manually with that tag). | ||
| # 3. A DRAFT release is created with every platform's installer + latest.json; | ||
| # review it, then publish. | ||
| # | ||
| # Note: macOS bundles are NOT Apple-code-signed/notarized (no Apple cert). They | ||
| # work, but users must right-click → Open (or clear the quarantine attribute) on | ||
| # first launch. Add APPLE_* secrets + signing env later to make this seamless. | ||
|
|
||
| name: Desktop Release | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "desktop-v*" | ||
| workflow_dispatch: | ||
| inputs: | ||
| tag: | ||
| description: "Release tag to publish (e.g. desktop-v0.2.0)" | ||
| required: true | ||
|
|
||
| # Allow the job to create the GitHub Release. | ||
| permissions: | ||
| contents: write | ||
|
|
||
| # One release build per ref at a time. | ||
| concurrency: | ||
| group: desktop-release-${{ github.ref }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| build: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| # macOS: one universal (arm64 + x86_64) build → .dmg + .app(.tar.gz updater). | ||
| - platform: macos-latest | ||
| args: "--target universal-apple-darwin --bundles app dmg" | ||
| rust-targets: "aarch64-apple-darwin,x86_64-apple-darwin" | ||
| # Linux: tauri.linux.conf.json overrides targets to appimage + deb. | ||
| - platform: ubuntu-22.04 | ||
| args: "" | ||
| rust-targets: "" | ||
| # Windows: base tauri.conf.json targets are nsis + msi. | ||
| - platform: windows-latest | ||
| args: "" | ||
| rust-targets: "" | ||
|
|
||
| runs-on: ${{ matrix.platform }} | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
tricktreat marked this conversation as resolved.
|
||
|
|
||
| - name: Install Linux system dependencies | ||
| if: matrix.platform == 'ubuntu-22.04' | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y \ | ||
| libwebkit2gtk-4.1-dev \ | ||
| libgtk-3-dev \ | ||
| libayatana-appindicator3-dev \ | ||
| librsvg2-dev \ | ||
| libxdo-dev \ | ||
| libssl-dev \ | ||
| patchelf \ | ||
| file | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
|
|
||
| - name: Setup Rust toolchain | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| targets: ${{ matrix.rust-targets }} | ||
|
|
||
| - name: Cache Rust build | ||
| uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| workspaces: desktop/src-tauri -> target | ||
|
|
||
| # The frontend dist is built by tauri's beforeBuildCommand | ||
| # (`npm --prefix ../src/frontend run build`), which needs deps installed. | ||
| - name: Install frontend dependencies | ||
| working-directory: src/frontend | ||
| run: npm install | ||
|
|
||
| - name: Install desktop toolchain (@tauri-apps/cli) | ||
| working-directory: desktop | ||
| run: npm install | ||
|
tricktreat marked this conversation as resolved.
|
||
|
|
||
| - name: Build and publish release | ||
| uses: tauri-apps/tauri-action@v0 | ||
|
tricktreat marked this conversation as resolved.
|
||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | ||
|
tricktreat marked this conversation as resolved.
|
||
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | ||
| with: | ||
| projectPath: desktop | ||
| tagName: ${{ github.event.inputs.tag || github.ref_name }} | ||
| releaseName: "HugAgentOS Desktop __VERSION__" | ||
| releaseBody: "Download the installer for your platform below. See the docs for setup." | ||
| releaseDraft: true | ||
| prerelease: false | ||
| includeUpdaterJson: true | ||
| args: ${{ matrix.args }} | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.