This repository has been archived by the owner on Oct 22, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
👷 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 <gabriel@saillard.dev>
- Loading branch information
1 parent
aef706c
commit 087b9eb
Showing
4 changed files
with
162 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
name: Build packaged binaries | ||
|
||
on: [push, pull_request, create] | ||
|
||
jobs: | ||
build-linux: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [12.x] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
# npm cache files are stored in `~/.npm` on Linux/macOS | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Cache Electron binaries | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-electron-bins | ||
with: | ||
# cache location is described here: | ||
# https://github.com/electron/get#how-it-works | ||
path: ~/.cache/electron | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: install linux deps | ||
run: | | ||
sudo apt install rsync libc6-dev-i386 gcc-multilib g++-multilib -y | ||
- name: set up env | ||
run: | | ||
npm install | ||
- name: npm build | ||
run: | | ||
npm run build-linux | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: Linux-AppImages | ||
path: dist/*.AppImage | ||
if-no-files-found: error | ||
|
||
build-windows: | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
node-version: [12.x] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Get npm cache directory | ||
id: npm-cache | ||
run: | | ||
echo "::set-output name=dir::$(npm config get cache)" | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.npm-cache.outputs.dir }} | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Cache Electron binaries | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-electron-bins | ||
with: | ||
# cache location is described here: | ||
# https://github.com/electron/get#how-it-works | ||
path: ~/AppData/Local/electron/Cache | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: npm install | ||
run: | | ||
npm install | ||
- name: npm build | ||
run: | | ||
npm run build-windows | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: Windows-Installer | ||
path: dist/*.exe | ||
if-no-files-found: error | ||
|
||
build-darwin: | ||
runs-on: macos-latest | ||
strategy: | ||
matrix: | ||
node-version: [12.x] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
# npm cache files are stored in `~/.npm` on Linux/macOS | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Cache Electron binaries | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-electron-bins | ||
with: | ||
# cache location is described here: | ||
# https://github.com/electron/get#how-it-works | ||
path: ~/Library/Caches/electron | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: set up env | ||
run: | | ||
npm install | ||
- name: npm build | ||
run: | | ||
npm run build-darwin | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: MacOS-Image | ||
path: dist/*.dmg | ||
if-no-files-found: error |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters