Skip to content

chore: bump version to 0.1.4 #10

chore: bump version to 0.1.4

chore: bump version to 0.1.4 #10

Workflow file for this run

name: Release Build
on:
push:
branches:
- test-ci
tags:
- "v*.*.*"
jobs:
build-and-release:
name: Build and Release - ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
include:
- platform: windows-latest
target: x86_64-pc-windows-msvc
os_name: windows
- platform: ubuntu-latest
target: x86_64-unknown-linux-gnu
os_name: linux
- platform: macos-latest
target: aarch64-apple-darwin
os_name: macos
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for git log
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install x86_64 target for macOS universal binary
if: matrix.os_name == 'macos'
run: rustup target add x86_64-apple-darwin
- name: Install Linux dependencies
if: matrix.os_name == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libsoup-3.0-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
libasound2-dev \
libxss-dev
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
key: ${{ matrix.target }}
- name: Cache Node modules
uses: actions/cache@v4
with:
path: |
node_modules
~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Install dependencies
run: bun install
- name: Setup code signing
shell: bash
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
run: |
if [ -n "$TAURI_SIGNING_PRIVATE_KEY" ]; then
echo "✅ Code signing key detected"
# The key will be used automatically by Tauri during build
else
echo "⚠️ No code signing key found. Build will proceed without signing."
echo " To enable code signing, add TAURI_SIGNING_PRIVATE_KEY to GitHub Secrets"
fi
- name: Build application (Non-macOS)
if: matrix.os_name != 'macos'
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
run: bun run tauri build --target ${{ matrix.target }}
- name: Build application (macOS Universal)
if: matrix.os_name == 'macos'
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
run: bun run tauri build --target universal-apple-darwin
- name: Prepare artifacts (Windows)
if: matrix.os_name == 'windows'
shell: pwsh
run: |
$version = "${{ github.ref_name }}" -replace '^v', ''
New-Item -ItemType Directory -Force -Path artifacts
# Find and copy installer
$exeFile = Get-ChildItem -Path "src-tauri/target/${{ matrix.target }}/release/bundle/nsis" -Filter "*.exe" -Recurse | Select-Object -First 1
if ($exeFile) {
Copy-Item $exeFile.FullName "artifacts/focust_${version}_${{ matrix.os_name }}_installer.exe"
# Copy signature file if exists
$sigFile = "$($exeFile.DirectoryName)\$($exeFile.BaseName).exe.sig"
if (Test-Path $sigFile) {
Copy-Item $sigFile "artifacts/focust_${version}_${{ matrix.os_name }}_installer.exe.sig"
Write-Host "✅ Signature file found and copied"
}
}
- name: Prepare artifacts (Linux)
if: matrix.os_name == 'linux'
run: |
version="${{ github.ref_name }}"
version="${version#v}"
mkdir -p artifacts
# Find and copy AppImage
find src-tauri/target/${{ matrix.target }}/release/bundle/appimage -name "*.AppImage" -exec cp {} artifacts/focust_${version}_${{ matrix.os_name }}.AppImage \; 2>/dev/null || true
# Copy signature file if exists
find src-tauri/target/${{ matrix.target }}/release/bundle/appimage -name "*.AppImage.sig" -exec cp {} artifacts/focust_${version}_${{ matrix.os_name }}.AppImage.sig \; 2>/dev/null || true
- name: Prepare artifacts (macOS)
if: startsWith(matrix.os_name, 'macos')
run: |
version="${{ github.ref_name }}"
version="${version#v}"
mkdir -p artifacts
# Find and copy DMG (universal binary)
find src-tauri/target/universal-apple-darwin/release/bundle/dmg -name "*.dmg" -exec cp {} artifacts/focust_${version}_${{ matrix.os_name }}.dmg \; 2>/dev/null || true
# Find and copy App Tarball
find src-tauri/target/universal-apple-darwin/release/bundle/macos -name "*.app.tar.gz" -exec cp {} artifacts/focust_${version}_${{ matrix.os_name }}.app.tar.gz \; 2>/dev/null || true
# Copy signature file if exists
find src-tauri/target/universal-apple-darwin/release/bundle/dmg -name "*.app.tar.gz.sig" -exec cp {} artifacts/focust_${version}_${{ matrix.os_name }}.app.tar.gz.sig \; 2>/dev/null || true
# Create tarball of .app (universal binary)
find src-tauri/target/universal-apple-darwin/release/bundle/macos -name "*.app" -exec tar -czf artifacts/focust_${version}_${{ matrix.os_name }}.app.tar.gz -C "$(dirname {})" "$(basename {})" \; 2>/dev/null || true
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: focust-${{ matrix.os_name }}
path: artifacts/*
if-no-files-found: error
create-release:
name: Create Release
needs: build-and-release
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version
id: version
run: |
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#v}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Get previous tag
id: previous_tag
run: |
PREV_TAG=$(git describe --abbrev=0 --tags ${{ github.ref }}^ 2>/dev/null || echo "")
echo "prev_tag=${PREV_TAG}" >> $GITHUB_OUTPUT
- name: Generate commit log
id: commit_log
run: |
if [ -n "${{ steps.previous_tag.outputs.prev_tag }}" ]; then
COMMITS=$(git log --pretty=format:"- %s (%h)" ${{ steps.previous_tag.outputs.prev_tag }}..${{ github.ref }})
else
COMMITS=$(git log --pretty=format:"- %s (%h)")
fi
# Save to file to handle multiline
echo "$COMMITS" > commit_log.txt
- name: Read release notes
id: release_notes
run: |
if [ -f "RELEASE_NOTE.md" ]; then
cat RELEASE_NOTE.md > release_body.md
echo "" >> release_body.md
echo "---" >> release_body.md
echo "" >> release_body.md
else
echo "# Release Notes" > release_body.md
echo "" >> release_body.md
echo "Version ${{ steps.version.outputs.version }}" >> release_body.md
echo "" >> release_body.md
echo "---" >> release_body.md
echo "" >> release_body.md
fi
echo "## Changes Since ${{ steps.previous_tag.outputs.prev_tag || 'Initial Release' }}" >> release_body.md
echo "" >> release_body.md
cat commit_log.txt >> release_body.md
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Display artifacts
run: |
echo "Artifacts to be released:"
ls -lh artifacts/
- name: Generate update manifest (latest.json)
run: |
VERSION="${{ steps.version.outputs.version }}"
# Create latest.json for auto-updater
cat > artifacts/latest.json << EOF
{
"version": "v${VERSION}",
"notes": "See release notes at https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }}",
"pub_date": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")",
"platforms": {
EOF
# Add Windows platform if NSIS exists
if ls artifacts/*_windows_installer.exe 1> /dev/null 2>&1; then
EXE_FILE=$(basename artifacts/*_windows_installer.exe)
EXE_SIG_FILE="${EXE_FILE}.sig"
echo ' "windows-x86_64": {' >> artifacts/latest.json
echo " \"signature\": \"$(cat artifacts/${EXE_SIG_FILE} 2>/dev/null || echo '')\"," >> artifacts/latest.json
echo " \"url\": \"https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/${EXE_FILE}\"" >> artifacts/latest.json
echo ' },' >> artifacts/latest.json
fi
# Add Linux platform if AppImage exists
if ls artifacts/*_linux.AppImage 1> /dev/null 2>&1; then
APPIMAGE_FILE=$(basename artifacts/*_linux.AppImage)
APPIMAGE_SIG_FILE="${APPIMAGE_FILE}.sig"
echo ' "linux-x86_64": {' >> artifacts/latest.json
echo " \"signature\": \"$(cat artifacts/${APPIMAGE_SIG_FILE} 2>/dev/null || echo '')\"," >> artifacts/latest.json
echo " \"url\": \"https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/${APPIMAGE_FILE}\"" >> artifacts/latest.json
echo ' },' >> artifacts/latest.json
fi
# Add macOS platform if DMG exists (universal binary)
if ls artifacts/*_macos.app.tar.gz 1> /dev/null 2>&1; then
TAR_FILE=$(basename artifacts/*_macos.app.tar.gz)
DMG_SIG_FILE="${TAR_FILE}.sig"
# Universal binary supports both architectures
for PLATFORM in "darwin-x86_64" "darwin-aarch64"; do
echo " \"${PLATFORM}\": {" >> artifacts/latest.json
echo " \"signature\": \"$(cat artifacts/${DMG_SIG_FILE} 2>/dev/null || echo '')\"," >> artifacts/latest.json
echo " \"url\": \"https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/${TAR_FILE}\"" >> artifacts/latest.json
echo ' },' >> artifacts/latest.json
done
fi
# Remove trailing comma and close JSON
sed -i '$ s/,$//' artifacts/latest.json
cat >> artifacts/latest.json << EOF
}
}
EOF
echo "✅ Generated latest.json:"
cat artifacts/latest.json
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: Focust v${{ steps.version.outputs.version }}
body_path: release_body.md
files: artifacts/*
draft: false
prerelease: false
generate_release_notes: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}