Skip to content
This repository was archived by the owner on Oct 22, 2021. It is now read-only.

Commit 087b9eb

Browse files
👷 Feat: Replace Travis w/ GitHub Actions CI (#912)
* Feat: add GH Actions * forgot a sudo lol * don't need to update * upload dist once done * rename to linux.yml * rename name too * add other platforms * rename platforms * fix windows maybe? * spelled install wrong lol * add code cov * add snyk env * fix env * install npm * delete snyk workflow * don't install runtime dependencies before build script on win32 * win32 build script: respect README instructions * Fix: fix travis cli for manos & linux (#911) * fix: cache npm * better artifact naming attempt * cache electron binaries used by electron-builder * better AppImage artifact naming * banish travis * test which platforms need python * add publishing code * move it to the right place * always publish new draft * load token * let electron-builder figure out whether to publish artifacts or not * cleanup some Snyk stuff * remove .snyk * Make a unified Workflow with multiple platforms as Jobs * remove individual os-specific workflows, use unified workflow instead Co-authored-by: Gabriel Saillard <[email protected]>
1 parent aef706c commit 087b9eb

File tree

4 files changed

+162
-69
lines changed

4 files changed

+162
-69
lines changed
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
name: Build packaged binaries
2+
3+
on: [push, pull_request, create]
4+
5+
jobs:
6+
build-linux:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
node-version: [12.x]
11+
steps:
12+
- uses: actions/checkout@v1
13+
- name: Cache node modules
14+
uses: actions/cache@v2
15+
env:
16+
cache-name: cache-node-modules
17+
with:
18+
# npm cache files are stored in `~/.npm` on Linux/macOS
19+
path: ~/.npm
20+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
21+
restore-keys: |
22+
${{ runner.os }}-build-${{ env.cache-name }}-
23+
${{ runner.os }}-build-
24+
${{ runner.os }}-
25+
- name: Cache Electron binaries
26+
uses: actions/cache@v2
27+
env:
28+
cache-name: cache-electron-bins
29+
with:
30+
# cache location is described here:
31+
# https://github.com/electron/get#how-it-works
32+
path: ~/.cache/electron
33+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
34+
restore-keys: |
35+
${{ runner.os }}-build-${{ env.cache-name }}-
36+
${{ runner.os }}-build-
37+
${{ runner.os }}-
38+
- name: Use Node.js ${{ matrix.node-version }}
39+
uses: actions/setup-node@v1
40+
with:
41+
node-version: ${{ matrix.node-version }}
42+
- name: install linux deps
43+
run: |
44+
sudo apt install rsync libc6-dev-i386 gcc-multilib g++-multilib -y
45+
- name: set up env
46+
run: |
47+
npm install
48+
- name: npm build
49+
run: |
50+
npm run build-linux
51+
env:
52+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
- uses: actions/upload-artifact@v2
54+
with:
55+
name: Linux-AppImages
56+
path: dist/*.AppImage
57+
if-no-files-found: error
58+
59+
build-windows:
60+
runs-on: windows-latest
61+
strategy:
62+
matrix:
63+
node-version: [12.x]
64+
steps:
65+
- uses: actions/checkout@v1
66+
- name: Get npm cache directory
67+
id: npm-cache
68+
run: |
69+
echo "::set-output name=dir::$(npm config get cache)"
70+
- uses: actions/cache@v2
71+
with:
72+
path: ${{ steps.npm-cache.outputs.dir }}
73+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
74+
restore-keys: |
75+
${{ runner.os }}-node-
76+
- name: Cache Electron binaries
77+
uses: actions/cache@v2
78+
env:
79+
cache-name: cache-electron-bins
80+
with:
81+
# cache location is described here:
82+
# https://github.com/electron/get#how-it-works
83+
path: ~/AppData/Local/electron/Cache
84+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
85+
restore-keys: |
86+
${{ runner.os }}-build-${{ env.cache-name }}-
87+
${{ runner.os }}-build-
88+
${{ runner.os }}-
89+
- name: Use Node.js ${{ matrix.node-version }}
90+
uses: actions/setup-node@v1
91+
with:
92+
node-version: ${{ matrix.node-version }}
93+
- name: npm install
94+
run: |
95+
npm install
96+
- name: npm build
97+
run: |
98+
npm run build-windows
99+
env:
100+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101+
- uses: actions/upload-artifact@v2
102+
with:
103+
name: Windows-Installer
104+
path: dist/*.exe
105+
if-no-files-found: error
106+
107+
build-darwin:
108+
runs-on: macos-latest
109+
strategy:
110+
matrix:
111+
node-version: [12.x]
112+
steps:
113+
- uses: actions/checkout@v1
114+
- name: Cache node modules
115+
uses: actions/cache@v2
116+
env:
117+
cache-name: cache-node-modules
118+
with:
119+
# npm cache files are stored in `~/.npm` on Linux/macOS
120+
path: ~/.npm
121+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
122+
restore-keys: |
123+
${{ runner.os }}-build-${{ env.cache-name }}-
124+
${{ runner.os }}-build-
125+
${{ runner.os }}-
126+
- name: Cache Electron binaries
127+
uses: actions/cache@v2
128+
env:
129+
cache-name: cache-electron-bins
130+
with:
131+
# cache location is described here:
132+
# https://github.com/electron/get#how-it-works
133+
path: ~/Library/Caches/electron
134+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
135+
restore-keys: |
136+
${{ runner.os }}-build-${{ env.cache-name }}-
137+
${{ runner.os }}-build-
138+
${{ runner.os }}-
139+
- name: Use Node.js ${{ matrix.node-version }}
140+
uses: actions/setup-node@v1
141+
with:
142+
node-version: ${{ matrix.node-version }}
143+
- name: set up env
144+
run: |
145+
npm install
146+
- name: npm build
147+
run: |
148+
npm run build-darwin
149+
env:
150+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
151+
- uses: actions/upload-artifact@v2
152+
with:
153+
name: MacOS-Image
154+
path: dist/*.dmg
155+
if-no-files-found: error

.snyk

Lines changed: 0 additions & 13 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

package.json

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,16 @@
1919
"install-windows": "npm install && cd src && npm install && ..\\node_modules\\.bin\\electron-rebuild -f -w node-pty && cd ..",
2020
"prebuild-linux": "rsync -a --info=progress2 src/ prebuild-src --exclude node_modules && node prebuild-minify.js && cd prebuild-src && npm install",
2121
"prebuild-darwin": "rsync -a src/ prebuild-src --exclude node_modules && node prebuild-minify.js && cd prebuild-src && npm install",
22-
"prebuild-windows": "rmdir /S /Q src\\node_modules && mkdir prebuild-src && xcopy src\\* prebuild-src\\ /E /C /Q /Y && node prebuild-minify.js && cd prebuild-src && npm install",
23-
"build-linux": "./node_modules/.bin/electron-builder build -l -p never",
24-
"build-darwin": "./node_modules/.bin/electron-builder build -m -p never",
25-
"build-windows": "node_modules\\.bin\\electron-builder build -w -p never",
22+
"prebuild-windows": "mkdir prebuild-src && xcopy src\\* prebuild-src\\ /E /C /Q /Y && node prebuild-minify.js && cd prebuild-src && npm install",
23+
"build-linux": "./node_modules/.bin/electron-builder build -l",
24+
"build-darwin": "./node_modules/.bin/electron-builder build -m",
25+
"build-windows": "node_modules\\.bin\\electron-builder build -w",
2626
"postbuild-linux": "rm -R prebuild-src",
2727
"postbuild-darwin": "rm -R prebuild-src",
2828
"postbuild-windows": "rmdir /S /Q prebuild-src",
2929
"test": "rsync -a --info=progress2 src/ prebuild-src --exclude node_modules && node prebuild-minify.js && cd prebuild-src && npm install && snyk test && cd .. && rm -R prebuild-src",
3030
"init-file-icons": "git submodule update --init",
31-
"update-file-icons": "git submodule foreach git pull origin master && node file-icons-generator.js",
32-
"snyk-protect": "snyk protect",
33-
"prepare": "npm run snyk-protect"
31+
"update-file-icons": "git submodule foreach git pull origin master && node file-icons-generator.js"
3432
},
3533
"repository": {
3634
"type": "git",
@@ -45,6 +43,7 @@
4543
"build": {
4644
"appId": "com.edex.ui",
4745
"productName": "eDEX-UI",
46+
"publish": "github",
4847
"asar": true,
4948
"compression": "normal",
5049
"copyright": "Copyright © 2017-2020 Gabriel 'Squared' SAILLARD <[email protected]> (https://gaby.dev)",
@@ -69,7 +68,7 @@
6968
"icon": "media/linuxIcons"
7069
},
7170
"appImage": {
72-
"artifactName": "eDEX-UI Linux (${arch}).AppImage"
71+
"artifactName": "eDEX-UI-Linux-${arch}.AppImage"
7372
},
7473
"mac": {
7574
"target": [
@@ -111,12 +110,10 @@
111110
"electron-rebuild": "^2.3.2",
112111
"node-abi": "2.19.1",
113112
"node-json-minify": "1.0.0",
114-
"snyk": "^1.427.0",
115113
"uglify-es": "3.3.9"
116114
},
117115
"optionalDependencies": {
118116
"cson-parser": "4.0.5"
119117
},
120-
"snyk": true,
121118
"devDependencies": {}
122119
}

0 commit comments

Comments
 (0)