mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
172 lines
6.7 KiB
YAML
172 lines
6.7 KiB
YAML
# CircleCI configuration to build GDevelop app running
|
|
# on the Electron runtime (newIDE/electron-app) for macOS and Linux.
|
|
# For Windows, see the appveyor.yml file.
|
|
|
|
version: 2.1
|
|
orbs:
|
|
aws-cli: circleci/aws-cli@2.0.6
|
|
jobs:
|
|
build-macos:
|
|
macos:
|
|
xcode: 12.5.1
|
|
steps:
|
|
- checkout
|
|
|
|
# System dependencies (for Emscripten and upload)
|
|
- run:
|
|
name: Install dependencies for Emscripten
|
|
command: brew install cmake
|
|
|
|
- run:
|
|
name: Install dependencies for AWS S3 upload
|
|
command: curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg" && sudo installer -pkg AWSCLIV2.pkg -target /
|
|
|
|
- run:
|
|
name: Install Emscripten (for GDevelop.js)
|
|
command: git clone https://github.com/juj/emsdk.git && cd emsdk && ./emsdk install 1.39.6 && ./emsdk activate 1.39.6 && cd ..
|
|
|
|
# GDevelop.js dependencies
|
|
- restore_cache:
|
|
keys:
|
|
- gd-macos-nodejs-dependencies-{{ checksum "newIDE/app/package.json" }}-{{ checksum "newIDE/electron-app/package.json" }}-{{ checksum "GDevelop.js/package.json" }}
|
|
# fallback to using the latest cache if no exact match is found
|
|
- gd-macos-nodejs-dependencies---
|
|
|
|
- run:
|
|
name: Install GDevelop.js dependencies
|
|
command: cd GDevelop.js && npm install && cd ..
|
|
|
|
# Build GDevelop.js (and run tests to ensure it works)
|
|
- run:
|
|
name: Build GDevelop.js
|
|
command: cd GDevelop.js && source ../emsdk/emsdk_env.sh && npm run build && npm test && cd ..
|
|
|
|
# GDevelop IDE dependencies (after building GDevelop.js to avoid downloading a pre-built version)
|
|
- run:
|
|
name: Install GDevelop IDE dependencies
|
|
command: cd newIDE/app && npm install && cd ../electron-app && npm install
|
|
|
|
- save_cache:
|
|
paths:
|
|
- newIDE/electron-app/node_modules
|
|
- newIDE/app/node_modules
|
|
- GDevelop.js/node_modules
|
|
key: gd-macos-nodejs-dependencies-{{ checksum "newIDE/app/package.json" }}-{{ checksum "newIDE/electron-app/package.json" }}-{{ checksum "GDevelop.js/package.json" }}
|
|
|
|
# Build GDevelop IDE (seems like we need to allow Node.js to use more space than usual)
|
|
# Note: Code signing is done using CSC_LINK (see https://www.electron.build/code-signing).
|
|
- run:
|
|
name: Build GDevelop IDE
|
|
command: export NODE_OPTIONS="--max-old-space-size=7168" && cd newIDE/electron-app && npm run build -- --mac --publish=never
|
|
|
|
- run:
|
|
name: Clean dist folder to keep only installers/binaries.
|
|
command: rm -rf "newIDE/electron-app/dist/mac/GDevelop 5.app"
|
|
|
|
# Upload artifacts (CircleCI)
|
|
- store_artifacts:
|
|
path: newIDE/electron-app/dist
|
|
|
|
# Upload artifacts (AWS)
|
|
- run:
|
|
name: Deploy to S3 (specific commit)
|
|
command: export PATH=~/.local/bin:$PATH && aws s3 sync newIDE/electron-app/dist s3://gdevelop-releases/$(git rev-parse --abbrev-ref HEAD)/commit/$(git rev-parse HEAD)/
|
|
- run:
|
|
name: Deploy to S3 (latest)
|
|
command: export PATH=~/.local/bin:$PATH && aws s3 sync newIDE/electron-app/dist s3://gdevelop-releases/$(git rev-parse --abbrev-ref HEAD)/latest/
|
|
|
|
build-linux:
|
|
# CircleCI docker workers are failing if they don't have enough memory (no swap)
|
|
resource_class: xlarge
|
|
docker:
|
|
- image: cimg/node:16.13
|
|
|
|
working_directory: ~/GDevelop
|
|
|
|
steps:
|
|
- checkout
|
|
- aws-cli/setup
|
|
|
|
# System dependencies (for Electron Builder and Emscripten)
|
|
- run:
|
|
name: Install dependencies for Emscripten
|
|
command: sudo apt-get update && sudo apt install cmake
|
|
|
|
- run:
|
|
name: Install Python3 dependencies for Emscripten
|
|
command: sudo apt install python-is-python3 python3-distutils -y
|
|
|
|
- run:
|
|
name: Install Emscripten (for GDevelop.js)
|
|
command: git clone https://github.com/juj/emsdk.git && cd emsdk && ./emsdk install 1.39.6 && ./emsdk activate 1.39.6 && cd ..
|
|
|
|
- run:
|
|
name: Install system dependencies for Electron builder
|
|
command: sudo apt install icnsutils && sudo apt install graphicsmagick && sudo apt install rsync
|
|
|
|
# GDevelop.js dependencies
|
|
- restore_cache:
|
|
keys:
|
|
- gd-linux-nodejs-dependencies-{{ checksum "newIDE/app/package.json" }}-{{ checksum "newIDE/electron-app/package.json" }}-{{ checksum "GDevelop.js/package.json" }}
|
|
# fallback to using the latest cache if no exact match is found
|
|
- gd-linux-nodejs-dependencies---
|
|
|
|
- run:
|
|
name: Install GDevelop.js dependencies and build it
|
|
command: cd GDevelop.js && npm install && cd ..
|
|
|
|
# Build GDevelop.js (and run tests to ensure it works)
|
|
- run:
|
|
name: Build GDevelop.js
|
|
command: cd GDevelop.js && source ../emsdk/emsdk_env.sh && npm run build && npm test && cd ..
|
|
|
|
# GDevelop IDE dependencies (after building GDevelop.js to avoid downloading a pre-built version)
|
|
- run:
|
|
name: Install GDevelop IDE dependencies
|
|
command: cd newIDE/app && npm install && cd ../electron-app && npm install
|
|
|
|
- save_cache:
|
|
paths:
|
|
- newIDE/electron-app/node_modules
|
|
- newIDE/app/node_modules
|
|
- GDevelop.js/node_modules
|
|
key: gd-linux-nodejs-dependencies-{{ checksum "newIDE/app/package.json" }}-{{ checksum "newIDE/electron-app/package.json" }}-{{ checksum "GDevelop.js/package.json" }}
|
|
|
|
# Build GDevelop IDE (seems like we need to allow Node.js to use more space than usual)
|
|
- run:
|
|
name: Build GDevelop IDE
|
|
command: export NODE_OPTIONS="--max-old-space-size=7168" && cd newIDE/electron-app && npm run build -- --linux AppImage zip deb --publish=never
|
|
|
|
- run:
|
|
name: Clean dist folder to keep only installers/binaries.
|
|
command: rm -rf newIDE/electron-app/dist/linux-unpacked
|
|
|
|
# Upload artifacts (CircleCI)
|
|
- store_artifacts:
|
|
path: newIDE/electron-app/dist
|
|
|
|
# Upload artifacts (AWS)
|
|
- run:
|
|
name: Deploy to S3 (specific commit)
|
|
command: aws s3 sync newIDE/electron-app/dist s3://gdevelop-releases/$(git rev-parse --abbrev-ref HEAD)/commit/$(git rev-parse HEAD)/
|
|
- run:
|
|
name: Deploy to S3 (latest)
|
|
command: aws s3 sync newIDE/electron-app/dist s3://gdevelop-releases/$(git rev-parse --abbrev-ref HEAD)/latest/
|
|
|
|
|
|
workflows:
|
|
builds:
|
|
jobs:
|
|
- build-macos:
|
|
filters:
|
|
branches:
|
|
only:
|
|
- master
|
|
- /experimental-build.*/
|
|
- build-linux:
|
|
filters:
|
|
branches:
|
|
only:
|
|
- master
|
|
- /experimental-build.*/
|