Files
next-ai-draw-io/.github/workflows/electron-release.yml

103 lines
2.3 KiB
YAML

name: Electron Release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version:
description: "Version tag (e.g., v0.4.5)"
required: false
jobs:
build:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
platform: mac
- os: windows-latest
platform: win
- os: ubuntu-latest
platform: linux
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build Electron app
run: npm run dist:${{ matrix.platform }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload macOS artifacts
if: matrix.platform == 'mac'
uses: actions/upload-artifact@v4
with:
name: mac-build
path: |
release/*.dmg
release/*.zip
if-no-files-found: error
- name: Upload Windows artifacts
if: matrix.platform == 'win'
uses: actions/upload-artifact@v4
with:
name: win-build
path: |
release/*.exe
if-no-files-found: error
- name: Upload Linux artifacts
if: matrix.platform == 'linux'
uses: actions/upload-artifact@v4
with:
name: linux-build
path: |
release/*.AppImage
release/*.deb
if-no-files-found: error
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
artifacts/**/*.dmg
artifacts/**/*.zip
artifacts/**/*.exe
artifacts/**/*.AppImage
artifacts/**/*.deb
draft: true
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}