From 9b5e061541e60379943518d56319a048cc469069 Mon Sep 17 00:00:00 2001 From: Samuel Meuli Date: Sat, 16 Nov 2019 13:05:46 +0100 Subject: [PATCH] Add GitHub actions --- .github/workflows/release.yml | 42 +++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 26 ++++++++++++++++++++++ package.json | 5 +++-- 3 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..d2501c2e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: Build/release + +on: push + +jobs: + release: + runs-on: ${{ matrix.os }} + + # Platforms to build on/for + strategy: + matrix: + os: [macos-10.14, windows-2019, ubuntu-18.04] + + 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: 10 + + - name: Install Snapcraft + uses: samuelmeuli/action-snapcraft@v1 + with: + # Log in to Snap Store + snapcraft_token: ${{ secrets.snapcraft_token }} + + - 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: ${{ secrets.github_token }} + + # macOS code signing certificate + mac_certs: ${{ secrets.mac_certs }} + mac_certs_password: ${{ secrets.mac_certs_password }} + + # 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') }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..7af5ce7b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,26 @@ +name: Test + +on: push + +jobs: + test: + runs-on: ${{ matrix.os }} + + # Platforms to test on + strategy: + matrix: + os: [macos-10.14, windows-2019, ubuntu-18.04] + + 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: 10 + + - name: Run tests + run: | + yarn + yarn test diff --git a/package.json b/package.json index d19e6624..cbc9f4c5 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,6 @@ "build:ts": "run-p build:ts:*", "build:ts:main": "webpack --config ./webpack.main.js --mode production", "build:ts:renderer": "webpack --config ./webpack.renderer.js --mode production", - "build:app": "electron-builder --mac --windows --linux", - "release": "env-cmd run-s build:clean build:ts 'build:app --publish always'", "website:start": "run-p website:start:*", "website:start:serve": "serve ./website --listen 3000", "website:start:ts": "tsc ./website/index.ts --watch", @@ -267,6 +265,9 @@ ] }, "linux": { + "target": [ + "AppImage" + ], "category": "Office" }, "dmg": {