mirror of
https://github.com/spartanz51/tutabridge.git
synced 2026-06-24 10:54:32 +02:00
Release workflow: add manual dispatch for branch testing
`workflow_dispatch` builds the installers on all three OSes and uploads them as workflow artifacts (no tag, no release) — so the pipeline can be validated without burning a version tag. A real `v*` tag still produces the draft release. GUI bundles are globbed from the per-OS bundle dir.
This commit is contained in:
@@ -1,10 +1,15 @@
|
|||||||
name: Release
|
name: Release
|
||||||
|
|
||||||
# Push a tag like `v0.1.0` to build installers for all three desktop OSes and
|
# Two ways in:
|
||||||
# attach them (plus the headless CLI binary) to a GitHub Release.
|
# * push a tag `v0.1.0` → build installers and attach them to a draft
|
||||||
|
# GitHub Release.
|
||||||
|
# * run manually (workflow_dispatch, on any branch) → build the same
|
||||||
|
# installers and upload them as **workflow artifacts** only, with no tag
|
||||||
|
# and no release. This is how you test the pipeline without burning a tag.
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags: ["v*"]
|
tags: ["v*"]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
@@ -12,7 +17,7 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
permissions:
|
permissions:
|
||||||
contents: write # create the release + upload assets
|
contents: write # create the release + upload assets (tag runs only)
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -21,14 +26,17 @@ jobs:
|
|||||||
rust_targets: aarch64-apple-darwin,x86_64-apple-darwin
|
rust_targets: aarch64-apple-darwin,x86_64-apple-darwin
|
||||||
tauri_args: --target universal-apple-darwin
|
tauri_args: --target universal-apple-darwin
|
||||||
cli_asset: tutabridge-macos-arm64
|
cli_asset: tutabridge-macos-arm64
|
||||||
|
bundle_path: target/universal-apple-darwin/release/bundle
|
||||||
- platform: ubuntu-latest
|
- platform: ubuntu-latest
|
||||||
rust_targets: ""
|
rust_targets: ""
|
||||||
tauri_args: ""
|
tauri_args: ""
|
||||||
cli_asset: tutabridge-linux-x86_64
|
cli_asset: tutabridge-linux-x86_64
|
||||||
|
bundle_path: target/release/bundle
|
||||||
- platform: windows-latest
|
- platform: windows-latest
|
||||||
rust_targets: ""
|
rust_targets: ""
|
||||||
tauri_args: ""
|
tauri_args: ""
|
||||||
cli_asset: tutabridge-windows-x86_64.exe
|
cli_asset: tutabridge-windows-x86_64.exe
|
||||||
|
bundle_path: target/release/bundle
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.platform }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout (with vendored SDK submodule)
|
- name: Checkout (with vendored SDK submodule)
|
||||||
@@ -76,33 +84,51 @@ jobs:
|
|||||||
working-directory: ui
|
working-directory: ui
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
# Builds the GUI bundles (.dmg / .msi+.exe / .deb+.AppImage), creates or
|
# Builds the GUI bundles (.dmg / .msi+.exe / .deb+.AppImage). On a tag it
|
||||||
# updates the Release for this tag, and uploads them. Draft so assets can
|
# also creates/updates a draft Release and uploads them; on a manual run
|
||||||
# be reviewed before publishing.
|
# `tagName` is empty so it only builds (no release).
|
||||||
- name: Build & release GUI bundles
|
- name: Build GUI bundles
|
||||||
|
id: tauri
|
||||||
uses: tauri-apps/tauri-action@v0
|
uses: tauri-apps/tauri-action@v0
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
tagName: ${{ github.ref_name }}
|
tagName: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || '' }}
|
||||||
releaseName: "TutaBridge ${{ github.ref_name }}"
|
releaseName: ${{ startsWith(github.ref, 'refs/tags/') && format('TutaBridge {0}', github.ref_name) || '' }}
|
||||||
releaseDraft: true
|
releaseDraft: true
|
||||||
prerelease: false
|
prerelease: false
|
||||||
args: ${{ matrix.tauri_args }}
|
args: ${{ matrix.tauri_args }}
|
||||||
|
|
||||||
# The headless CLI — the AUR/daemon target — as a standalone binary.
|
|
||||||
- name: Build CLI
|
- name: Build CLI
|
||||||
run: cargo build --release -p tutabridge
|
run: cargo build --release -p tutabridge
|
||||||
|
|
||||||
- name: Attach CLI binary to the release
|
# --- Tag run: attach the CLI binary to the draft release ---
|
||||||
|
- name: Attach CLI to release
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ runner.os }}" = "Windows" ]; then
|
src=target/release/tutabridge
|
||||||
src="target/release/tutabridge.exe"
|
[ "${{ runner.os }}" = "Windows" ] && src=target/release/tutabridge.exe
|
||||||
else
|
|
||||||
src="target/release/tutabridge"
|
|
||||||
fi
|
|
||||||
cp "$src" "${{ matrix.cli_asset }}"
|
cp "$src" "${{ matrix.cli_asset }}"
|
||||||
gh release upload "${{ github.ref_name }}" "${{ matrix.cli_asset }}" --clobber
|
gh release upload "${{ github.ref_name }}" "${{ matrix.cli_asset }}" --clobber
|
||||||
|
|
||||||
|
# --- Manual run: publish everything as downloadable workflow artifacts ---
|
||||||
|
- name: Upload GUI bundles as artifacts
|
||||||
|
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: gui-bundles-${{ matrix.platform }}
|
||||||
|
path: ${{ matrix.bundle_path }}/**
|
||||||
|
if-no-files-found: warn
|
||||||
|
|
||||||
|
- name: Upload CLI as artifact
|
||||||
|
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.cli_asset }}
|
||||||
|
path: |
|
||||||
|
target/release/tutabridge
|
||||||
|
target/release/tutabridge.exe
|
||||||
|
if-no-files-found: warn
|
||||||
|
|||||||
Reference in New Issue
Block a user