From 723e36a8a5d6516727fdac60df781d27a03f1b96 Mon Sep 17 00:00:00 2001 From: Daniel Maslowski Date: Sat, 5 Dec 2020 20:14:03 +0100 Subject: [PATCH] Set up GitHub Workflows build This also strips down the build scripts, retaining react-build for compatibility with current docs. --- .github/workflows/build.yml | 32 ++++++++++++++++++++++++++++++++ package.json | 13 ++++--------- 2 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..dbcc60ec --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,32 @@ +name: Build/release + +on: push + +jobs: + release: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + + steps: + - name: Check out Git repository + uses: actions/checkout@v1 + + - name: Install Node.js, NPM and Yarn + uses: actions/setup-node@v1 + with: + node-version: 14 + + - name: Build/release Electron app + uses: samuelmeuli/action-electron-builder@v1 + with: + # GitHub token, automatically provided to the action + # (No need to define this secret in the repo settings) + github_token: ${{ github.token }} + + # If the commit is tagged with a version (e.g. "v1.0.0"), + # release the app after building + release: ${{ startsWith(github.ref, 'refs/tags/v') }} + args: '-c.extraMetadata.main=build/electron.js' diff --git a/package.json b/package.json index 2ca23665..ca9b5e03 100644 --- a/package.json +++ b/package.json @@ -62,15 +62,10 @@ "react-start": "BROWSER=NONE react-scripts start", "electron-start": "DEV=1 electron .", "start": "concurrently 'npm run react-start' 'wait-on http://localhost:3000/ && npm run electron-start'", - "react-build": "react-scripts build", - "pack": "electron-builder --dir -c.extraMetadata.main=build/electron.js", - "electron-build-linux": "electron-builder --linux -c.extraMetadata.main=build/electron.js", - "electron-build-windows": "electron-builder --win -c.extraMetadata.main=build/electron.js", - "electron-build-mac": "electron-builder --mac -c.extraMetadata.main=build/electron.js", - "build-linux": "npm run react-build && npm run electron-build-linux", - "build-windows": "npm run react-build && npm run electron-build-windows", - "build-mac": "npm run react-build && npm run electron-build-mac", - "build": "npm run react-build && npm run electron-build-linux && npm run electron-build-windows & npm run electron-build-mac", + "react-build": "npm run build", + "pack": "npm run build:electron -- --dir", + "build:electron": "electron-builder -c.extraMetadata.main=build/electron.js", + "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", "lint": "eslint src",