workflows #9
Workflow file for this run
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: Build and Release Electron App | |
on: | |
push: | |
tags: | |
- 'v*.*.*' # This will trigger the workflow for tags matching the pattern vX.X.X | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
node-version: [20] # Specify the Node.js versions you want to test against | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: npm install | |
- name: Build the Electron app | |
run: npm run build | |
- name: Create Release | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Assets | |
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' || matrix.os == 'windows-latest' }} | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
run: | | |
for file in dist/*.{exe,dmg,AppImage}; do | |
if [[ -f "$file" ]]; then | |
echo "Uploading $file..." | |
gh release upload ${{ github.ref }} "$file" --clobber | |
fi | |
done | |
shell: bash |