Skip to content

Commit

Permalink
feat: Add GitHub Actions workflow for building and releasing Electron…
Browse files Browse the repository at this point in the history
… app
  • Loading branch information
HashCookie committed May 26, 2024
1 parent a8dd692 commit fb85b8f
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build and Release Electron App

on:
push:
tags:
- 'v*.*.*' # Trigger on version tags

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16'

- name: Install dependencies
run: yarn install

- name: Build Electron app
run: yarn dist

- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: electron-app-${{ matrix.os }}
path: dist/

release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: electron-app-*

- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/
asset_name: electron-app-${{ matrix.os }}.zip
asset_content_type: application/zip

0 comments on commit fb85b8f

Please sign in to comment.