-
Notifications
You must be signed in to change notification settings - Fork 0
189 lines (159 loc) · 6.12 KB
/
build.yaml
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
name: Build Moseq-Reports
on:
push:
tags:
- 'buildAll-*'
pull_request:
branches: [master, patch*, release*]
workflow_dispatch:
jobs:
buildDocs:
runs-on: ubuntu-latest
needs: build
if: ${{ endsWith(github.ref, 'master') }}
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Downloading version 14 of Node
uses: actions/setup-node@v1
with:
node-version: 14
- name: Install Repo
run: npm install
- name: Build docs
run: npm run docs:build
env:
APP_COMMIT_HASH: ${{ github.sha }}
APP_COMMIT_REF: ${{ github.ref }}
- name: Init new repo in dist folder and commit generated files
run: |
cd docs/.vuepress/dist
git init
git add -A
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m 'deploy ${{ github.ref }}'
cd -
- name: Force push to destination branch
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# change as neccessary
branch: gh-pages
force: true
directory: ./docs/.vuepress/dist
build:
strategy:
matrix:
os: [ubuntu-latest, macos-11, windows-latest]
runs-on: ${{ matrix.os }}
env:
ARTIFACT_NAME: "build-${{ matrix.os }}"
ARTIFACT_DEST: "build-${{ matrix.os }}.zip"
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: 14
- name: Print environment info
run: |
python --version
pip --version
node --version
# BEGIN WINDOWS CERT PREP
- name: Decode and Prep Windows Cert
if: ${{ runner.os == 'Windows' }}
id: windows_pfx
uses: timheuer/base64-to-file@v1
with:
fileName: "win-certificate.pfx"
encodedString: ${{secrets.WINDOWS_CERTIFICATE_P12}}
- name: Windows Add Variables to Path
if: ${{ runner.os == 'Windows' }}
env:
CERT_PATH: ${{steps.windows_pfx.outputs.filePath}}
CERT_PASSWORD: ${{secrets.WINDOWS_CERTIFICATE_PSWD}}
run: |
echo CSC_LINK=${CERT_PATH} >> $GITHUB_ENV
echo CSC_KEY_PASSWORD=${CERT_PASSWORD} >> $GITHUB_ENV
certutil -p "${{secrets.WINDOWS_CERTIFICATE_PSWD}}" -importpfx "${{steps.windows_pfx.outputs.filePath}}"
# END WINDOWS CERT PREP
# BEGIN MACOS CERT PREP
- name: macOS Decode and Prep Developer Application ID
if: ${{ runner.os == 'macOS' }}
id: mac_application_pfx
uses: timheuer/base64-to-file@v1
with:
filename: "application-certificate.pfx"
encodedString: ${{secrets.MACOS_DEVELOPER_ID_APPLICATION_P12}}
- name: macOS Decode and Prep Developer Installer ID
if: ${{ runner.os == 'macOS' }}
id: mac_installer_pfx
uses: timheuer/base64-to-file@v1
with:
filename: "developer-certificate.pfx"
encodedString: ${{secrets.MACOS_DEVELOPER_ID_INSTALLER_P12}}
- name: macOS Decode and Prep Development ID
if: ${{ runner.os == 'macOS' }}
id: mac_development_pfx
uses: timheuer/base64-to-file@v1
with:
filename: "development-certificate.pfx"
encodedString: ${{secrets.MACOS_MAC_DEVELOPMENT_P12}}
- name: macOS Add Certificates to Keychain
if: ${{ runner.os == 'macOS' }}
env:
APPLICATION_PFX: ${{ steps.mac_application_pfx.outputs.filePath }}
APPLICATION_PSWD: ${{ secrets.MACOS_DEVELOPER_ID_APPLICATION_PSWD }}
INSTALLER_PFX: ${{ steps.mac_installer_pfx.outputs.filePath }}
INSTALLER_PSWD: ${{ secrets.MACOS_DEVELOPER_ID_INSTALLER_PSWD}}
DEVELOPMENT_PFX: ${{ steps.mac_development_pfx.outputs.filePath }}
DEVELOPMENT_PSWD: ${{ secrets.MACOS_MAC_DEVELOPMENT_PSWD }}
KEYCHAIN_PSWD: ${{ secrets.MACOS_KEYCHAIN_PSWD }}
run: |
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
echo CSC_IDENTITY_AUTO_DISCOVERY=true >> $GITHUB_ENV
echo CSC_KEYCHAIN=${KEYCHAIN_PATH} >> $GITHUB_ENV
security create-keychain -p "$KEYCHAIN_PSWD" $KEYCHAIN_PATH
security default-keychain -s $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security import $APPLICATION_PFX -P "$APPLICATION_PSWD" -A -f pkcs12 -k $KEYCHAIN_PATH
security import $INSTALLER_PFX -P "$INSTALLER_PSWD" -A -f pkcs12 -k $KEYCHAIN_PATH
security import $DEVELOPMENT_PFX -P "$DEVELOPMENT_PSWD" -A -f pkcs12 -k $KEYCHAIN_PATH
security list-keychains -d user -s $KEYCHAIN_PATH
security find-identity
security find-identity -v -p codesigning
# END MACOS CERT PREP
- name: Install
run: npm install
- name: Version
run: |
echo PACKAGE_VERSION=$(npm run --silent version) >> $GITHUB_ENV
- name: Linting
run: npm run lint
- name: Git Tag
run: git tag ${{ env.PACKAGE_VERSION }}
- name: Package (release)
if: ${{ endsWith(github.ref, 'master') }}
env:
GH_TOKEN: ${{ secrets.SERVICE_ACCOUNT_TOKEN }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PSWD_MOSEQ_REPORTS: ${{ secrets.APPLE_ID_PSWD_MOSEQ_REPORTS }}
run: |
npm run package-release
- name: Package (dev)
if: ${{ !endsWith(github.ref, 'master') }}
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PSWD_MOSEQ_REPORTS: ${{ secrets.APPLE_ID_PSWD_MOSEQ_REPORTS }}
run: npm run package
- name: Zip package
run: 7z a ${{ env.ARTIFACT_DEST }} ./dist_electron/*
# - name: Upload build artifacts
# uses: actions/upload-artifact@v2
# with:
# name: ${{ env.ARTIFACT_NAME }}
# path: ${{ env.ARTIFACT_DEST }}