Skip to content

Bump v0.0.6

Bump v0.0.6 #16

Workflow file for this run

name: Release Desktop App
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
release:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
# macOS
- platform: macos-latest
args: --target aarch64-apple-darwin
rust_targets: aarch64-apple-darwin,x86_64-apple-darwin
os_label: macos
- platform: macos-latest
args: --target x86_64-apple-darwin
rust_targets: aarch64-apple-darwin,x86_64-apple-darwin
os_label: macos
# Linux
- platform: ubuntu-24.04
args: ""
rust_targets: ""
os_label: linux
- platform: ubuntu-24.04-arm
args: ""
rust_targets: ""
os_label: linux
# Windows
- platform: windows-latest
args: ""
rust_targets: ""
os_label: windows
- platform: windows-latest
args: --target aarch64-pc-windows-msvc
rust_targets: aarch64-pc-windows-msvc
os_label: windows
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
libxdo-dev \
libx11-dev \
libxcb-randr0-dev \
libxcb-shm0-dev \
libpipewire-0.3-dev \
libgbm-dev \
xdg-utils
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: lts/*
cache: npm
- name: Install Rust stable
uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
with:
targets: ${{ matrix.rust_targets }}
- name: Rust cache
uses: swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
workspaces: "./clients/desktop/src-tauri -> target"
shared-key: release-${{ matrix.platform }}-${{ matrix.args || 'native' }}
- name: Install dependencies
run: npm ci
- name: Build workspace dependencies
run: |
npm run build -w packages/shared
npm run build -w clients/react
- name: Build and release
id: tauri
uses: tauri-apps/tauri-action@84b9d35b5fc46c1e45415bdb6144030364f7ebc5 # v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectPath: "./clients/desktop"
tagName: v__VERSION__
releaseName: "Collapse v__VERSION__"
releaseBody: "See the assets to download and install."
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}
- name: Rename release assets with OS labels
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
TAG="${GITHUB_REF#refs/tags/}"
OS_LABEL="${{ matrix.os_label }}"
# Draft releases aren't visible via /releases/tags/, so search all releases
RELEASE_ID=$(gh api "repos/${{ github.repository }}/releases" --jq ".[] | select(.tag_name==\"${TAG}\") | .id")
if [ -z "$RELEASE_ID" ]; then
echo "No release found for tag ${TAG}, skipping rename"
exit 0
fi
# Map OS label to file extensions this job produces
case "$OS_LABEL" in
macos) EXTS="dmg" ;;
linux) EXTS="deb AppImage" ;;
windows) EXTS="exe msi" ;;
esac
gh api "repos/${{ github.repository }}/releases/${RELEASE_ID}/assets" --jq '.[] | "\(.id) \(.name)"' | while read -r ASSET_ID ASSET_NAME; do
EXT="${ASSET_NAME##*.}"
# Only rename assets matching this platform's extensions
if [[ " $EXTS " == *" $EXT "* ]] && [[ "$ASSET_NAME" != *"${OS_LABEL}-"* ]]; then
PREFIX="${ASSET_NAME%_*}"
SUFFIX="${ASSET_NAME##*_}"
NEW_NAME="${PREFIX}_${OS_LABEL}-${SUFFIX}"
echo "Renaming: ${ASSET_NAME} → ${NEW_NAME}"
gh api --method PATCH "repos/${{ github.repository }}/releases/assets/${ASSET_ID}" -f name="${NEW_NAME}" --silent
fi
done