This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Electron Forge Multi-OS Build | |
on: | |
push: | |
branches: [main] # Triggers the workflow on push events to the main branch | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} # Uses the OS specified in the matrix | |
strategy: | |
matrix: | |
os: [macos-latest, windows-latest, ubuntu-latest] # List of OSes to build on | |
node-version: ["18"] # You can also matrix Node versions if needed | |
steps: | |
- uses: actions/checkout@v2 # Checks-out your repository | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: npm install | |
- name: Build the Electron app | |
run: npm run make # Replace with your build command | |
- name: Publish Release | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} # This sets the environment variable for the step | |
run: npm run publish | |
# Additional steps for each OS can be added here. | |
# For example, code signing for macOS or packaging specifics for Windows and Linux. |