-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (101 loc) · 3.98 KB
/
package.yml
File metadata and controls
111 lines (101 loc) · 3.98 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: package
on:
workflow_dispatch:
inputs:
setting:
description: Build for 'home' or 'clinic'
required: true
default: 'home'
os:
description: Which OS to target - 'win', 'mac', 'linux', 'all'
required: true
default: 'win'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ${{
(github.event.inputs.os == 'all' && fromJSON('["ubuntu-latest", "macOS-latest", "windows-latest"]')) ||
(github.event.inputs.os == 'win' && fromJSON('["windows-latest"]')) ||
(github.event.inputs.os == 'mac' && fromJSON('["macOS-latest"]')) ||
(github.event.inputs.os == 'linux' && fromJSON('["ubuntu-latest"]')) }}
steps:
# Rewrite "git:" repo urls to use "https:" instead, since GitHub Actions blocks port 9418 (as of Jan 2022).
- name: Rewrite "git:" repo urls to use "https:" instead.
run: git config --global url."https://github.com/".insteadOf "git://github.com/"
# Set up js package
- uses: actions/checkout@v1
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Set package version and name
uses: brown-ccv/gh-actions/get-package-info@main
id: package_info
# install, test, build package
- name: npm install
run: |
npm config set "//npm.pkg.github.com/:_authToken" ${{ secrets.GITHUB_TOKEN }}
npm install
- name: Load .env file
uses: xom9ikk/dotenv@v1.0.2
with:
path: ./env
mode: ${{github.event.inputs.setting}}
- name: npm build
run: npm run build
- name: npm test
run: npm test
env:
CI: true
# Build electron app package installers
- name: package electron - windows
if: startsWith(matrix.os, 'windows')
run: npm run package:windows
- name: package electron - linux
if: startsWith(matrix.os, 'ubuntu')
run: npm run package:linux
- name: package electron - mac
if: startsWith(matrix.os, 'mac')
run: npm run package:mac
# Upload installers to github action
- name: upload win-installer
uses: actions/upload-artifact@master
if: startsWith(matrix.os, 'windows')
with:
name: ${{ format('win-installer-{0}', github.event.inputs.setting) }}
path: out/make/squirrel.windows/x64/${{ steps.package_info.outputs.package_name }}-${{ steps.package_info.outputs.package_version }} Setup.exe
- name: upload mac-installer
uses: actions/upload-artifact@master
if: startsWith(matrix.os, 'mac')
with:
name: ${{ format('mac-installer-{0}', github.event.inputs.setting) }}
path: out/make/${{ steps.package_info.outputs.package_name }}-${{ steps.package_info.outputs.package_version }}-x64.dmg
- name: upload linux-installer
uses: actions/upload-artifact@master
if: startsWith(matrix.os, 'ubuntu')
with:
name: ${{ format('linux-installer-{0}', github.event.inputs.setting) }}
path: out/make/deb/x64/${{ steps.package_info.outputs.package_name }}_${{ steps.package_info.outputs.package_version }}_amd64.deb
# Build PsiTurk - linux only
- name: Set up Python 3.7
if: startsWith(matrix.os, 'ubuntu')
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install PsiTurk
if: startsWith(matrix.os, 'ubuntu')
run: pip install psiturk
- name: Create Psiturk Build
if: startsWith(matrix.os, 'ubuntu')
run: |
cd psiturkit
./psiturk-it -p ${{ steps.package_info.outputs.package_name }}-psiturk
- name: Upload PsiTurk Build
uses: actions/upload-artifact@master
if: startsWith(matrix.os, 'ubuntu')
with:
name: psiturk-build
path: psiturkit/${{ steps.package_info.outputs.package_name }}-psiturk