-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (80 loc) · 3.29 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Build
on: [ push, pull_request ]
jobs:
test:
runs-on: ubuntu-latest
# skip whilst tests are broken
if: ${{ 'true' == 'false' }}
env:
NODE_ENV: 'test'
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: '16'
cache: 'yarn'
- run: npm i -g yarn
- run: sudo curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
- run: sudo echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
- run: sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install google-chrome-stable unzip xvfb libxi6 libgconf-2-4 -y
- run: wget https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip && unzip chromedriver_linux64.zip
- run: sudo mv chromedriver /usr/bin/chromedriver && sudo chmod +x /usr/bin/chromedriver
- run: yarn install
- run: yarn run test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: '16'
cache: 'yarn'
- run: sudo dpkg --add-architecture i386 && sudo apt-get update && sudo apt-get install fakeroot flatpak-builder rpm elfutils wine -y
- run: sudo flatpak remote-add --system --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
- run: sudo flatpak install --system --no-deps --assumeyes --noninteractive runtime/org.freedesktop.Sdk/x86_64/19.08
- run: sudo flatpak install --system --no-deps --assumeyes --noninteractive runtime/org.freedesktop.Platform/x86_64/19.08
- run: sudo flatpak install --system --no-deps --assumeyes --noninteractive app/org.electronjs.Electron2.BaseApp/x86_64/stable
- run: yarn install
- name: Build linux
run: yarn run make -p linux
- name: Build windows
run: yarn run make -p win32
- uses: actions/upload-artifact@v2
with:
name: artifacts_linux
path: |
out/make/**/*.deb
out/make/**/*.rpm
out/make/**/*.flatpak
out/make/**/*.exe
retention-days: 1
release:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- run: sudo apt-get update && sudo apt-get install jq -y
- run: echo "PACKAGE_VERSION=$(cat package.json | jq -r '.version')" >> $GITHUB_ENV
- name: Get previous tag
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: 1.0.0
- uses: actions/download-artifact@v2
if: ${{ steps.previoustag.outputs.tag }} != "v${{ env.PACKAGE_VERSION }}"
with:
name: artifacts_linux
- uses: "marvinpinto/action-automatic-releases@latest"
if: ${{ steps.previoustag.outputs.tag }} != "v${{ env.PACKAGE_VERSION }}"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "v${{ env.PACKAGE_VERSION }}"
prerelease: true
title: "v${{ env.PACKAGE_VERSION }}"
files: |
deb/**/*.deb
flatpak/**/*.flatpak
rpm/**/*.rpm
squirrel.windows/**/*.exe