Skip to content

build

build #20

Workflow file for this run

name: NoteWizard - Build Multi-Platform Installer
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
workflow_dispatch:
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
include:
- os: windows-latest
platform: win
artifact_pattern: 'dist/*.exe'
- os: ubuntu-latest
platform: linux
artifact_pattern: |
dist/*.AppImage
dist/*.deb
dist/*.rpm
- os: macos-latest
platform: mac
artifact_pattern: |
dist/*.dmg
dist/*.zip
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
- name: Cache node_modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci --prefer-offline --no-audit --no-fund
- name: Build for ${{ matrix.platform }}
run: npm run dist:${{ matrix.platform }} --verbose
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CSC_IDENTITY_AUTO_DISCOVERY: false
CSC_FOR_PULL_REQUEST: true
ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES: true
USE_HARD_LINKS: false
- name: List dist directory (Debug)
run: |
echo "Contents of dist directory:"
ls -R dist/
shell: bash
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: NoteWizard-${{ matrix.platform }}-${{ github.sha }}
path: ${{ matrix.artifact_pattern }}
retention-days: 30
if-no-files-found: warn
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: List downloaded artifacts (Debug)
run: |
echo "Artifacts downloaded:"
ls -R artifacts/
shell: bash
- name: Create Release
uses: softprops/action-gh-release@v1
with:
name: ${{ github.ref_name }}
files: artifacts/**/*
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}