Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
204 changes: 204 additions & 0 deletions .github/workflows/multi-platform-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
name: Multi-Platform Build & Release

on:
push:
branches:
- '**'
tags:
- 'v*'
pull_request:
branches:
- main
- master

permissions:
contents: write

jobs:
# Windows Build
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '18'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Package Windows
run: npm run package:win

- name: Upload Windows Artifacts
uses: actions/upload-artifact@v4
with:
name: windows-builds
path: |
release/*.exe
release/*.zip
retention-days: 7

# macOS Build
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '18'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Package macOS
run: npm run package:mac

- name: Upload macOS Artifacts
uses: actions/upload-artifact@v4
with:
name: macos-builds
path: |
release/*.dmg
release/*.zip
retention-days: 7

# Linux Build
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '18'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Package Linux
run: npm run package:linux

- name: Upload Linux Artifacts
uses: actions/upload-artifact@v4
with:
name: linux-builds
path: release/*.AppImage
retention-days: 7

# Android Build
build-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '18'

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Install dependencies
run: npm ci

- name: Build Android
run: npm run build:android

- name: Make gradlew executable
run: chmod +x android/gradlew

- name: Build APK (Debug)
run: |
cd android
./gradlew assembleDebug

- name: Upload Android APK
uses: actions/upload-artifact@v4
with:
name: android-builds
path: android/app/build/outputs/apk/debug/*.apk
retention-days: 7

# Create Release (only on tags)
release:
needs: [build-windows, build-macos, build-linux, build-android]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Display structure of downloaded files
run: ls -R artifacts

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/windows-builds/*
artifacts/macos-builds/*
artifacts/linux-builds/*
artifacts/android-builds/*
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Create auto release on every push (non-tag)
auto-release:
needs: [build-windows, build-macos, build-linux, build-android]
runs-on: ubuntu-latest
if: "!startsWith(github.ref, 'refs/tags/')"
Comment on lines +168 to +172

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Auto-release publishes during pull_request builds

The auto-release job is gated only by if: "!startsWith(github.ref, 'refs/tags/')", so it runs for pull_request events as well as pushes, yet the steps later in the job call softprops/action-gh-release with GITHUB_TOKEN. On pull_request workflows—especially those from forks—GitHub supplies a read-only token that cannot create releases, so this job will fail and block PR CI even though no release should be published. Restrict the job to push/tag events or skip it for pull_request to avoid PR build failures.

Useful? React with 👍 / 👎.

steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Create Auto Release
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/windows-builds/*
artifacts/macos-builds/*
artifacts/linux-builds/*
artifacts/android-builds/*
tag_name: build-${{ github.ref_name }}-${{ github.run_number }}
name: Build ${{ github.ref_name }} #${{ github.run_number }}
body: |
🤖 Automated build from commit ${{ github.sha }}

**Branch:** ${{ github.ref_name }}
**Platforms:** Windows, macOS, Linux, Android

📦 **Downloads:**
- Windows: `.exe` installer and portable `.zip`
- macOS: `.dmg` installer and `.zip` archive
- Linux: `.AppImage` (universal package)
- Android: `.apk` (debug build)
draft: false
prerelease: true
target_commitish: ${{ github.sha }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,12 @@ out/

# TypeScript
*.tsbuildinfo

# Capacitor
.capacitor/
android/build/
android/.gradle/
android/app/build/
android/app/release/
android/local.properties
ios/
Loading
Loading