Skip to content

Commit

Permalink
Remove duplicate bundle compilation in CI (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwbonner authored Aug 8, 2023
1 parent 4c573e1 commit 841a44d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 8 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
pull_request:

jobs:
format:
name: Check Formatting
compile:
name: Check & Compile
runs-on: ubuntu-latest

steps:
Expand All @@ -18,9 +18,16 @@ jobs:
node-version: "18.x"
cache: "npm"
- name: Install Node.js dependencies
run: npm ci
run: npm ci --ignore-scripts
- name: Check formatting
run: npm run check-format
- name: Compile bundles
run: npm run compile
- name: Upload bundles
uses: actions/upload-artifact@v3
with:
name: bundles
path: bundles/*.js

build:
strategy:
Expand Down Expand Up @@ -50,6 +57,7 @@ jobs:

name: Build for ${{ matrix.platform.displayName }} (${{ matrix.arch }})
runs-on: ${{ matrix.platform.os }}
needs: compile

steps:
- name: Checkout repository
Expand All @@ -69,8 +77,13 @@ jobs:
run: |
echo "CSC_LINK=${{ secrets.MACOS_CERTIFICATE }}" >> $GITHUB_ENV
echo "CSC_KEY_PASSWORD=${{ secrets.MACOS_CERTIFICATE_PWD }}" >> $GITHUB_ENV
- name: Download bundles
uses: actions/download-artifact@v3
with:
name: bundles
path: bundles
- name: Build app
run: npm run build -- --${{ matrix.arch }} ${{ matrix.platform.buildArg }} --publish never
run: npx electron-builder build --${{ matrix.arch }} ${{ matrix.platform.buildArg }} --publish never
env:
NODE_OPTIONS: --max-old-space-size=4096
- name: Prepare macOS artifact
Expand Down
21 changes: 17 additions & 4 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
types: [published]

jobs:
format:
name: Check Formatting
compile:
name: Check & Compile
runs-on: ubuntu-latest

steps:
Expand All @@ -18,9 +18,16 @@ jobs:
node-version: "18.x"
cache: "npm"
- name: Install Node.js dependencies
run: npm ci
run: npm ci --ignore-scripts
- name: Check formatting
run: npm run check-format
- name: Compile bundles
run: npm run compile
- name: Upload bundles
uses: actions/upload-artifact@v3
with:
name: bundles
path: bundles/*.js

build:
strategy:
Expand Down Expand Up @@ -80,6 +87,7 @@ jobs:

name: Build for ${{ matrix.platform.displayName }} (${{ matrix.arch }})
runs-on: ${{ matrix.platform.os }}
needs: compile

steps:
- name: Checkout repository
Expand Down Expand Up @@ -107,8 +115,13 @@ jobs:
echo "APPLE_ID=${{ secrets.MACOS_APPLE_ID }}" >> $GITHUB_ENV
echo "APPLE_ID_PWD=${{ secrets.MACOS_APPLE_ID_PWD }}" >> $GITHUB_ENV
echo "APPLE_ID_TEAM=${{ secrets.MACOS_APPLE_ID_TEAM }}" >> $GITHUB_ENV
- name: Download bundles
uses: actions/download-artifact@v3
with:
name: bundles
path: bundles
- name: Build app
run: npm run build -- --${{ matrix.arch }} ${{ matrix.platform.buildArg }} --publish never
run: npx electron-builder build --${{ matrix.arch }} ${{ matrix.platform.buildArg }} --publish never
env:
NODE_OPTIONS: --max-old-space-size=4096
- name: Prepare macOS artifact
Expand Down

0 comments on commit 841a44d

Please sign in to comment.