diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index a1d7ea2708..0000000000 --- a/.appveyor.yml +++ /dev/null @@ -1,38 +0,0 @@ -platform: -- x64 -environment: - nodejs_version: "8" - matrix: - - node_installer: yarn -cache: -- 'node_modules' -- '%USERPROFILE%\.electron' -branches: - only: - - master - -install: -- ps: Install-Product node $env:nodejs_version $env:platform -- set PATH=%APPDATA%\npm;%PATH% -- npm i -g bolt@0.21.2 -- if not exist "node_modules" mkdir node_modules -- ps: Remove-Item node_modules -Recurse -Force -- bolt -- yarn build -- ps: | - $wixToolsetBinPath = ";C:\Program Files (x86)\WiX Toolset v3.11\bin;" - $env:PATH = $env:PATH + $wixToolsetBinPath - [Environment]::SetEnvironmentVariable("Path", $env:PATH, [EnvironmentVariableTarget]::Machine) - if ((Get-Command "light.exe" -ErrorAction SilentlyContinue) -eq $null) - { - Write-Host "Unable to find light.exe in your PATH" - } - -test_script: -- node --version -- yarn --version -- yarn lint -- yarn coverage -- yarn codecov - -build: off diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..2b71bc9be1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,118 @@ +name: CI + +on: + push: + branches: + - master + tags: + - v[0-9]+.[0-9]+.[0-9]+* + pull_request: + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest, macOS-latest, ubuntu-latest] + node-installer: [npm, yarn] + + steps: + - name: Fix git checkout line endings + run: git config --global core.autocrlf input + - uses: actions/checkout@v1 + - name: Windows specific setup + if: matrix.os == 'windows-latest' + run: | + curl -OLS https://github.com/wixtoolset/wix3/releases/download/wix3111rtm/wix311.exe + .\wix311.exe /install /quiet /norestart + npm config set node-gyp "$($env:GITHUB_WORKSPACE)\node_modules\node-gyp\bin\node-gyp.js" + - name: Linux specific setup + if: matrix.os == 'ubuntu-latest' + run: | + sudo add-apt-repository -y ppa:alexlarsson/flatpak + sudo apt-get update + sudo apt-get install -y --no-install-recommends snapcraft flatpak-builder + ci/install_runtimes.sh + - name: Use Node.js 8.x + uses: actions/setup-node@v1 + with: + node-version: 8.x + - name: Cache node_modules + uses: actions/cache@v1 + with: + path: node_modules + key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.OS }}-build-${{ env.cache-name }}- + ${{ runner.OS }}-build- + ${{ runner.OS }}- + - name: Install bolt + shell: bash + run: | + case "$(uname -s)" in + Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.21.2 ;; + *) BOLT_VERSION=latest ;; + esac + npm install -g bolt@$BOLT_VERSION + - name: Install + run: bolt + - name: Lint + run: bolt lint + - name: Build + run: bolt build + - name: Test on Windows + if: matrix.os == 'windows-latest' + run: | + $wixToolsetBinPath = ";C:\Program Files (x86)\WiX Toolset v3.11\bin;" + $env:PATH = $env:PATH + $wixToolsetBinPath + [Environment]::SetEnvironmentVariable("Path", $env:PATH, [EnvironmentVariableTarget]::Machine) + if ((Get-Command "light.exe" -ErrorAction SilentlyContinue) -eq $null) + { + Write-Host "Unable to find light.exe in your PATH" + } + bolt coverage + env: + CI: true + NODE_INSTALLER: ${{ matrix.node-installer }} + - name: Test on macOS/Linux + if: matrix.os != 'windows-latest' + run: bolt coverage + env: + CI: true + NODE_INSTALLER: ${{ matrix.node-installer }} + DEBUG: electron-installer-snap:snapcraft + - name: Codecov + run: bolt codecov + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + docs: + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + needs: build + runs-on: [ubuntu-latest] + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: Cache node_modules + uses: actions/cache@v1 + with: + path: node_modules + key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.OS }}-build-${{ env.cache-name }}- + ${{ runner.OS }}-build- + ${{ runner.OS }}- + - name: Install bolt + shell: bash + run: | + case "$(uname -s)" in + Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.21.2 ;; + *) BOLT_VERSION=latest ;; + esac + npm install -g bolt@$BOLT_VERSION + - name: Deploy docs + run: ci/docs.sh + env: + NOW_TOKEN: ${{ secrets.NOW_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1802ce51f3..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,39 +0,0 @@ -language: node_js -node_js: '8' -dist: xenial -osx_image: xcode8.3 -cache: npm -services: -- docker -jobs: - include: - - stage: test - os: linux - env: NODE_INSTALLER=npm - - os: linux - env: NODE_INSTALLER=yarn - - os: osx - env: NODE_INSTALLER=npm - - os: osx - env: NODE_INSTALLER=yarn - - stage: docs - os: linux - node_js: '12' - script: ci/docs.sh -stages: -- test -- name: docs - if: branch = master AND fork = false -branches: - only: - - master - - /^v\d+\.\d+\.\d+/ -install: -- npm i -g bolt@0.22.5 -script: ci/script.sh -after_success: bolt codecov -notifications: - slack: - secure: OIKgrHnR746qDfezkuMD2idSRrQVkfYII8JqhMmaQ46GRK6WtWC/vp/tThuj+Hc9LoHsBWNW0q4Lur1jchsgjYlgqYpdCGyl19yCMYs6XEnf0G+rXQyczzVeek9ZerwjwY5eyvdzKwE4I2khaNasyiVbdnArNDwg3TXcZdqFV2YkpNBzWJz6ha/QOO9l2D38Csdcfuz+6WdPSvoYyPcjQTvLDjvBcZapLm2lfQXduolRXxtCSDfRCAvl/DnT3TcwTyJEkHzwj32H1SyB3tW/1aPoouy0Lx+s+pQp8EWlnMq8rzS3cc9k51M7T6ziHQv9ATSo02Npf4EfzMByekbL2KO7tkkHax1J8+abUFikwtLyIPBwA9QYDV6lE0qtb3TFsRPSvsoxg7qYPDK4La+tbxMZwM0qR/oEZ5kKb5XGqNd5KO4huU3Eztp6cwXeTOdV7jYVZ1LdM+SmLKnjYaP/HHXLdGn4YJ7K/C59VlXMdaVIenOCbuIgBoK/vBn3dDX0n5xXkCTCgN7m85rOWEaFkj1vz05c/7Zvx7wvPjHe6UPTjSEBwXBU+F7Bwmq+aS5kzdIznZ2YKmn8OzdYlOkWAFhcE2PGOGVstAuqfKOBhAZHqPU0J+j+9uxdopFLHFeVxf+GZJDDB6MPYkn/xRz38JmarCaXI7nvkJFc1y40G00= - on_success: change - on_failure: change diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c1c32ae44f..76d866af1e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -83,7 +83,7 @@ bolt test Here are some things to keep in mind as you file pull requests to fix bugs, add new features, etc.: -* Travis CI and AppVeyor are used to make sure that the project builds packages as expected on the +* GitHub Actions are used to make sure that the project builds packages as expected on the supported platforms, using supported Node.js versions, and that the project conforms to the configured coding standards. * Unless it's impractical, please write tests for your changes. This will help us so that we can diff --git a/README.md b/README.md index 0443f2bcb1..f8436e2a04 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ Electron Forge -------------- -[![Linux/macOS Build Status](https://travis-ci.org/electron-userland/electron-forge.svg?branch=master)](https://travis-ci.org/electron-userland/electron-forge) -[![Windows Build status](https://ci.appveyor.com/api/projects/status/79ae80nek1eucyy3?svg=true)](https://ci.appveyor.com/project/electron-userland/electron-forge) +[![Build Status](https://github.com/electron-userland/electron-forge/workflows/CI/badge.svg)](https://github.com/electron-userland/electron-forge/actions?query=workflow:CI) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) [![npm version](https://badge.fury.io/js/electron-forge.svg)](https://www.npmjs.com/package/electron-forge) [![npm](https://img.shields.io/npm/dt/electron-forge.svg?maxAge=2592000)](https://www.npmjs.com/package/electron-forge) diff --git a/ci/docker.sh b/ci/docker.sh deleted file mode 100755 index 5fddef5009..0000000000 --- a/ci/docker.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -set -e - -NODE_INSTALLER="$1" - -npm i -g yarn -npm i -g bolt@0.22.5 - -cd /code - -bolt -bolt build -bolt lint - -# For flatpak -mkdir -p /var/run/dbus -dbus-daemon --system - -DEBUG=electron-installer-snap:snapcraft CI=true bolt coverage -- --installer=$NODE_INSTALLER diff --git a/ci/docs.sh b/ci/docs.sh index 24192e864f..76b2a01ba6 100755 --- a/ci/docs.sh +++ b/ci/docs.sh @@ -1,7 +1,7 @@ #!/bin/bash -e # Pinned due to https://github.com/zeit/now/issues/2941 -yarn global add now@16.1.2 +yarn add --dev now@16.1.2 bolt bolt build yarn docs:deploy:ci diff --git a/ci/install_runtimes.sh b/ci/install_runtimes.sh new file mode 100755 index 0000000000..f0db1e3da8 --- /dev/null +++ b/ci/install_runtimes.sh @@ -0,0 +1,35 @@ +#!/bin/bash -xe + +install_app() { + local arch="$1" + local app="$2" + local branch=$3 + install_flatpak "app/$app/$arch/$branch" +} + +install_runtime() { + local arch="$1" + local runtime="$2" + local version="$3" + install_flatpak "runtime/${runtime}/$arch/$version" +} + +install_flatpak() { + local ref="$1" + if [[ ! -d "$HOME/.local/share/flatpak/$ref" ]]; then + flatpak install --user --no-deps --assumeyes "$ref" + fi +} + +flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + +install_runtime x86_64 org.freedesktop.Sdk 1.6 +install_runtime x86_64 org.freedesktop.Platform 1.6 +install_app x86_64 org.electronjs.Electron2.BaseApp stable + +mkdir -p fakesnap/snap +cp ci/snapcraft.yaml fakesnap/snap/ +pushd fakesnap +snapcraft pull desktop-gtk3 electron-deps +popd +rm -r fakesnap diff --git a/ci/script.sh b/ci/script.sh deleted file mode 100755 index 16105620f4..0000000000 --- a/ci/script.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -e - -if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then - sudo docker run --privileged --interactive --tty --volume $(pwd):/code malept/electron-forge-container:node-8 /code/ci/docker.sh $NODE_INSTALLER -else - bolt - yarn build - yarn lint - yarn coverage -fi diff --git a/ci/snapcraft.yaml b/ci/snapcraft.yaml new file mode 100644 index 0000000000..efa048ce32 --- /dev/null +++ b/ci/snapcraft.yaml @@ -0,0 +1,21 @@ +name: electron-app +version: '1.0.0' +summary: App summary +description: | + App description + +grade: devel +confinement: devmode + +parts: + electron-deps: + plugin: nil + after: + - desktop-gtk3 + stage-packages: + - libnotify4 + - libnss3 + - libpcre3 + - libuuid1 + - libxss1 + - libxtst6