Utility proc #1545
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
name: Studio - PR Build | |
on: | |
pull_request: | |
paths-ignore: | |
- apps/sqltools/** | |
- docs/** | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04] | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v1 | |
- name: Install Node.js, NPM and Yarn | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16 | |
- 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 python@3.8 | |
# Add Python 3.8 to PATH | |
echo "/usr/local/opt/python@3.8/libexec/bin" >> $GITHUB_PATH | |
export PATH="/usr/local/opt/python@3.8/libexec/bin:$PATH" | |
export PYTHON_PATH="/usr/local/opt/python@3.8/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: 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" | |
- 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 |