From c52ce29babf412eae3f2a245e0bcff1df6f25bd5 Mon Sep 17 00:00:00 2001 From: sajjad isvand Date: Fri, 14 Jun 2024 02:26:41 +0330 Subject: [PATCH] ci: split build workflow into separate jobs for each OS --- .github/workflows/build.yml | 57 ++++++++++++++++++++++++++++++++----- .github/workflows/pull.yml | 56 +++++++++++++++++++++++++++++++----- 2 files changed, 99 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a1ea4b9..44f3663 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,20 +1,19 @@ -name: Build +name: Build on push on: push: + branches-ignore: ["main"] paths-ignore: - "README.md" - "README-*.md" - ".github/ISSUE_TEMPLATE/*" jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest, macos-latest, ubuntu-latest] + build_on_linux: + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Checkout repository + uses: actions/checkout@v3 - name: Install Node v18 uses: actions/setup-node@v3 @@ -22,6 +21,50 @@ jobs: node-version: 18 cache: npm + - name: Install dependencies + run: npm ci + + - name: Install electron-builder + run: npm i electron-builder -g + + - name: Build typescript files + run: npm run build:code + + + + build_on_win: + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install Node v18 + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Install electron-builder + run: npm i electron-builder -g + + - name: Build typescript files + run: npm run build:code + + + build_on_macos: + runs-on: macOS-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install Node v18 + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: npm - name: Install dependencies run: npm ci diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 09bcdb5..8dd0ffb 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -9,12 +9,31 @@ on: - "*.md" jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + build_on_linux: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install Node v18 + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Install electron-builder + run: npm i electron-builder -g + + - name: Build typescript files + run: npm run build:code + + + build_on_win: + runs-on: windows-latest steps: - name: Checkout repository uses: actions/checkout@v3 @@ -27,9 +46,32 @@ jobs: - name: Install dependencies run: npm ci + + - name: Install electron-builder + run: npm i electron-builder -g + + - name: Build typescript files + run: npm run build:code + + + build_on_macos: + runs-on: macOS-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install Node v18 + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: npm + - name: Install dependencies + run: npm ci + - name: Install electron-builder run: npm i electron-builder -g - - name: Build - run: npm run build + - name: Build typescript files + run: npm run build:code + \ No newline at end of file