Skip to content

Rewrite CI workflow for Electron (v0.7.12) #54

Rewrite CI workflow for Electron (v0.7.12)

Rewrite CI workflow for Electron (v0.7.12) #54

Workflow file for this run

name: Build & Release
# Triggered by pushing a version tag: git tag v1.0.0 && git push --tags
on:
push:
tags:
- "v*.*.*"
workflow_dispatch: # allow manual runs from the Actions tab
permissions:
contents: write # needed to create/upload release assets
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
platform: linux
- os: windows-latest
platform: windows
- os: macos-13 # Intel (x86_64)
platform: macos-intel
- os: macos-latest # Apple Silicon (arm64)
platform: macos-arm
runs-on: ${{ matrix.os }}
name: Build (${{ matrix.platform }})
steps:
# ── Checkout ────────────────────────────────────────────────────────────
- uses: actions/checkout@v4
# ── Node.js ─────────────────────────────────────────────────────────────
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: electron/package-lock.json
# ── Linux: system libs required by Electron / AppImage ──────────────────
- name: Install Linux system deps
if: matrix.platform == 'linux'
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
libgtk-3-dev libglib2.0-dev fuse libfuse2 rpm
# ── Install npm dependencies ─────────────────────────────────────────────
- name: Install npm dependencies
working-directory: electron
run: npm install
# ── Build ────────────────────────────────────────────────────────────────
- name: Build (Linux)
if: matrix.platform == 'linux'
working-directory: electron
run: npm run build-linux
env:
# Disable code-signing; we ship unsigned builds
CSC_IDENTITY_AUTO_DISCOVERY: false
- name: Build (Windows)
if: matrix.platform == 'windows'
working-directory: electron
run: npm run build-win
env:
CSC_IDENTITY_AUTO_DISCOVERY: false
- name: Build (macOS Intel)
if: matrix.platform == 'macos-intel'
working-directory: electron
run: npm run build-mac
env:
CSC_IDENTITY_AUTO_DISCOVERY: false
- name: Build (macOS ARM)
if: matrix.platform == 'macos-arm'
working-directory: electron
run: npm run build-mac
env:
CSC_IDENTITY_AUTO_DISCOVERY: false
# ── Upload artifact for debugging ────────────────────────────────────────
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.platform }}
path: |
electron/dist/*.AppImage
electron/dist/*.exe
electron/dist/*.dmg
electron/dist/*.zip
if-no-files-found: warn
retention-days: 7
# ── Attach to GitHub Release ─────────────────────────────────────────────
- name: Upload to Release
uses: softprops/action-gh-release@v2
with:
files: |
electron/dist/*.AppImage
electron/dist/*.exe
electron/dist/*.dmg
electron/dist/*.zip
generate_release_notes: true
draft: false
prerelease: ${{ contains(github.ref_name, '-') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}