Skip to content

Workflow file for this run

name: Build and Release Electron App
on:
push:
branches: [ main ]
jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
arch: [x64, arm64]
exclude:
- os: windows-latest
arch: arm64
include:
- os: windows-latest
arch: ia32
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 6.0.2
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Build Electron app
env:
GH_TOKEN: ${{ secrets.PUBLIC_RELEASE }}
run: pnpm run electron:build -- --${{ matrix.arch }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.PUBLIC_RELEASE }}
with:
tag_name: v${{ github.run_number }}
release_name: Release v${{ github.run_number }}
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.PUBLIC_RELEASE }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/your-app-name*
asset_name: your-app-name-${{ matrix.os }}-${{ matrix.arch }}
asset_content_type: application/octet-stream