Skip to content

release

release #29

Workflow file for this run

name: Build Electron App
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
platform: linux
- os: windows-latest
platform: windows
- os: macos-latest
platform: mac
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Set npm registry mirror
run: |
npm config set registry https://registry.npmjs.org/
- name: Install dependencies
run: npm install
- name: Build Electron app for macOS
if: matrix.os == 'macos-latest'
run: |
npm run build -- --mac --x64
npm run build -- --mac --arm64
env:
GH_TOKEN: ${{ secrets.PUBLIC_RELEASE }}
CSC_IDENTITY_AUTO_DISCOVERY: false
- name: Build Electron app for Windows
if: matrix.os == 'windows-latest'
run: npm run build -- --win --x64
env:
GH_TOKEN: ${{ secrets.PUBLIC_RELEASE }}
- name: Build Electron app for Linux
if: matrix.os == 'ubuntu-latest'
run: npm run build -- --linux --x64
env:
GH_TOKEN: ${{ secrets.PUBLIC_RELEASE }}
- name: List build output
run: |
ls -R release
ls -R dist
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-build
path: |
release/**/*.exe
release/**/*.dmg
release/**/*.AppImage
release/**/*.snap
dist/**/*.exe
dist/**/*.dmg
dist/**/*.AppImage
dist/**/*.snap
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ github.ref }}
name: Release ${{ github.ref }}
draft: false
prerelease: false
files: |
release/**/*.exe
release/**/*.dmg
release/**/*.AppImage
release/**/*.snap
dist/**/*.exe
dist/**/*.dmg
dist/**/*.AppImage
dist/**/*.snap
env:
GITHUB_TOKEN: ${{ secrets.PUBLIC_RELEASE }}