Add GitHub Actions workflow for building and releasing artifacts across Linux, Windows, and macOS platforms

This commit is contained in:
sanasol
2026-01-18 12:36:11 +01:00
parent e14c80f3dd
commit df46a74089
2 changed files with 105 additions and 4 deletions

103
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,103 @@
name: Build and Release
on:
push:
branches:
- main
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
platform: linux
- os: windows-latest
platform: win
- os: macos-latest
platform: mac
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 for Linux
if: matrix.platform == 'linux'
run: npm run build:linux
- name: Build for Windows
if: matrix.platform == 'win'
run: npm run build:win
- name: Build for macOS (Universal)
if: matrix.platform == 'mac'
run: npm run build:mac
- name: Upload Linux artifacts
if: matrix.platform == 'linux'
uses: actions/upload-artifact@v4
with:
name: linux-builds
path: |
dist/*.AppImage
dist/*.deb
- name: Upload Windows artifacts
if: matrix.platform == 'win'
uses: actions/upload-artifact@v4
with:
name: windows-builds
path: |
dist/*.exe
- name: Upload macOS artifacts
if: matrix.platform == 'mac'
uses: actions/upload-artifact@v4
with:
name: macos-builds
path: |
dist/*.dmg
dist/*.zip
dist/latest-mac.yml
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
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 Release
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/linux-builds/*
artifacts/windows-builds/*
artifacts/macos-builds/*
generate_release_notes: true
draft: false
prerelease: false

View File

@@ -94,15 +94,13 @@
{ {
"target": "dmg", "target": "dmg",
"arch": [ "arch": [
"x64", "universal"
"arm64"
] ]
}, },
{ {
"target": "zip", "target": "zip",
"arch": [ "arch": [
"x64", "universal"
"arm64"
] ]
} }
], ],