forked from beekeeper-studio/beekeeper-studio
-
-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (82 loc) · 3.09 KB
/
studio-master.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Studio - Master build
on:
push:
branches:
- "master"
paths-ignore:
- 'apps/sqltools/**'
concurrency:
group: master-build
cancel-in-progress: true
jobs:
masterbuild:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-14, ubuntu-20.04, windows-2019]
steps:
- name: Check out Git repository
uses: actions/checkout@v1
- name: Install python 3.8 (not Mac)
uses: actions/setup-python@v5
with:
python-version: 3.8
if: "!startsWith(matrix.os, 'macos')"
- name: Install python 3.8 (mac)
if: "startsWith(matrix.os, 'macos')"
run: |
# Install Python 3.8
brew install [email protected]
# Add Python 3.8 to PATH
echo "/opt/homebrew/opt/[email protected]/libexec/bin" >> $GITHUB_PATH
export PATH="/opt/homebrew/opt/[email protected]/libexec/bin:$PATH"
export PYTHON_PATH="/opt/homebrew/opt/[email protected]/libexec/bin/python3"
- name: Verify Python Version
if: "startsWith(matrix.os, 'windows')"
run: |
$PYTHON_VERSION = python --version | Out-String
Write-Output "Installed Python version: $PYTHON_VERSION"
if (-not $PYTHON_VERSION.StartsWith("Python 3.8")) {
Write-Output "Error: Python version does not start with 3.8"
exit 1
}
shell: powershell
- name: Verify Python Version
if: "!startsWith(matrix.os, 'windows')"
run: |
PYTHON_VERSION=$(python3 --version | cut -d " " -f 2)
echo "Installed Python version: $PYTHON_VERSION"
if [[ ! $PYTHON_VERSION == 3.8* ]]; then
echo "Error: Python version does not start with 3.8"
exit 1
fi
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: yarn
- name: Clean cache
run: yarn cache clean
- name: Check dependencies
run: "yarn install --frozen-lockfile --network-timeout 100000"
env:
npm_config_node_gyp: ${{ github.workspace }}${{ runner.os == 'Windows' && '\node_modules\node-gyp\bin\node-gyp.js' || '/node_modules/node-gyp/bin/node-gyp.js' }}
- name: Build Electron app
run: "yarn run electron:build --publish never"
env:
PYTHON_PATH: "${{ startsWith(matrix.os, 'macos') && '/opt/homebrew/opt/[email protected]/libexec/bin/python3' || '$PYTHON_PATH' }}"
PYTHONPATH: "${{ startsWith(matrix.os, 'macos') && '/opt/homebrew/opt/[email protected]/libexec/bin/python3' || '$PYTHONPATH' }}"
- name: Cleanup artifacts
if: "!startsWith(matrix.os, 'windows')"
run: |
npx rimraf "apps/studio/dist/!(*.exe|*.deb|*.rpm|*.AppImage|*.dmg|*.snap)"
- name: Cleanup artifacts Win
if: "startsWith(matrix.os, 'windows')"
continue-on-error: true
run: |
npx rimraf "apps\studio\dist\!(*.exe)"
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.os }}
path: apps/studio/dist