Skip to content

Commit

Permalink
update environment
Browse files Browse the repository at this point in the history
  • Loading branch information
chenwenhao committed Jan 12, 2024
2 parents 051d5d1 + 7d50d95 commit bf9be84
Show file tree
Hide file tree
Showing 418 changed files with 7,542 additions and 4,431 deletions.
116 changes: 116 additions & 0 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Release

on:
push:
branches:
- dev

jobs:
release:
name: build and release electron app
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, macos-12, ubuntu-latest]

steps:
- name: Check out git repository
uses: actions/checkout@v3.0.0

- name: Install Node.js
uses: actions/setup-node@v3.0.0
with:
node-version: '14'

- name: Release for Windows
if: matrix.os == 'windows-latest'
run: |
cd C:\Users
mkdir Downloads
git clone https://github.com/Seeed-Projects/seeed-codecraft D:\Users\Downloads\ws
cd D:
cd D:\Users\Downloads\ws\blocks && npm install -y --unsafe-perm=true
cd D:\Users\Downloads\ws\blocks && npm run build
cd D:\Users\Downloads\ws\l10n && npm install -y --unsafe-perm=true
cd D:\Users\Downloads\ws\l10n && npm run build
cd D:\Users\Downloads\ws\vm && npm install -y --unsafe-perm=true
cd D:\Users\Downloads\ws\vm && npm run build
cd D:\Users\Downloads\ws\gui && npm run build-win
cd D:\Users\Downloads\ws\gui && Xcopy D:\Users\Downloads\ws\gui\build D:\Users\Downloads\ws\main\app\gui /E/H/C/I
cd D:\Users\Downloads\ws\main\app && npm install -y --unsafe-perm=true && .\node_modules\.bin\electron-rebuild serialport
cd D:\Users\Downloads\ws\main && npm install -y --unsafe-perm=true && rm -rf build && npm run publish-win64
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

- name: Release for MacOS arm
if: matrix.os == 'macos-latest'
run: |
echo $PWD
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
brew install python@2
export PATH="/usr/local/opt/python@2/libexec/bin:$PATH"
alias python=python2
export script_dir=$PWD
brew install python2
cd ${script_dir}/gui && npm install -y --unsafe-perm=true
cd ${script_dir}/blocks && npm install -y --unsafe-perm=true
cd ${script_dir}/blocks && npm run build
cd ${script_dir}/l10n && npm install -y --unsafe-perm=true
cd ${script_dir}/l10n && npm run build
cd ${script_dir}/vm && npm install -y --unsafe-perm=true
cd ${script_dir}/vm && npm run build
cd ${script_dir}/gui && npm run build-mac
cd ${script_dir}/gui && rm -rf ../main/app/gui && cp -r ./build ../main/app/gui
cd ${script_dir}/main/app && npm install -y --unsafe-perm=true && ./node_modules/.bin/electron-rebuild serialport
cd ${script_dir}/main && npm install -y --unsafe-perm=true && rm -rf build && npm run publish-mac
- name: Release for MacOS x86
if: matrix.os == 'macos-12'
run: |
echo $PWD
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
brew install python@2
export PATH="/usr/local/opt/python@2/libexec/bin:$PATH"
alias python=python2
export script_dir=$PWD
brew install python2
cd ${script_dir}/gui && npm install -y --unsafe-perm=true
cd ${script_dir}/blocks && npm install -y --unsafe-perm=true
cd ${script_dir}/blocks && npm run build
cd ${script_dir}/l10n && npm install -y --unsafe-perm=true
cd ${script_dir}/l10n && npm run build
cd ${script_dir}/vm && npm install -y --unsafe-perm=true
cd ${script_dir}/vm && npm run build
cd ${script_dir}/gui && npm run build-mac
cd ${script_dir}/gui && rm -rf ../main/app/gui && cp -r ./build ../main/app/gui
cd ${script_dir}/main/app && npm install -y --unsafe-perm=true && ./node_modules/.bin/electron-rebuild serialport
cd ${script_dir}/main && npm install -y --unsafe-perm=true && rm -rf build && npm run publish-mac
- name: Release for Linux
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update && sudo apt upgrade -y
sudo apt install python2.7 -y
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 10
echo $PWD
export script_dir=$PWD
cd ${script_dir}/gui && npm install -y --unsafe-perm=true
cd ${script_dir}/blocks && npm install -y --unsafe-perm=true
cd ${script_dir}/blocks && npm run build
cd ${script_dir}/l10n && npm install -y --unsafe-perm=true
cd ${script_dir}/l10n && npm run build
cd ${script_dir}/vm && npm install -y --unsafe-perm=true
cd ${script_dir}/vm && npm run build
cd ${script_dir}/gui && npm run build-mac
cd ${script_dir}/gui && rm -rf ../main/app/gui && cp -r ./build ../main/app/gui
cd ${script_dir}/main/app && npm install -y --unsafe-perm=true && ./node_modules/.bin/electron-rebuild serialport
cd ${script_dir}/main && npm install -y --unsafe-perm=true && rm -rf build && npm run publish-linux
140 changes: 97 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,78 +1,132 @@
# Codecraft
**Codecraft is a graphical programming software which is based on Scratch 3.0. It targets teenagers of age 7-16, compatible with WIN/MAC.**

[![Feature Requests](./misc/main.jpg)](https://www.yuque.com/tinkergen-help-en/codecraft?language=en-us)

**Codecraft is a graphical programming software which is based on [Scratch 3.0](https://scratch.mit.edu/). It targets teenagers of age 7-16, compatible with WIN/MAC.**
By using a drag-and-drop interface, Codecraft has been helping users program without the need to write code in traditional text-based programming languages. Since its’ launch in 2018, it’s designed to make it easier for beginners, especially STEAM classrooms, to embrace coding to create projects and prototypes. With a focus on programming microcontrollers and IoT devices, Codecraft has been adapted and trusted by thousands of users all around the world. In 2022, Codecraft was recognized as [Bett Awards Finalist](https://www.seeedstudio.com/blog/2022/04/06/seeed-studio-codecraft-recognized-finalist-by-edtech-awards-2022/) and [The Edtech Awards Cool Tool Finalist](https://www.seeedstudio.com/blog/2022/04/06/seeed-studio-codecraft-recognized-finalist-by-edtech-awards-2022/), two important and in prestigious awards the education technology industry.

[Codecraft help online](https://www.yuque.com/tinkergen-help-en/codecraft?language=en-us)

### Support Devices
Grove Zero,Arduino Uno/Mega,micro:bit,M.A.R.K(CyberEye),Grove Joint,GLINT,Bittle

## Download
- [Grove Zero](https://www.seeedstudio.com/Grove-Zero-Starter-Kit-V2-0-p-4352.html)

- [Arduino Mega](https://www.seeedstudio.com/Arduino-Mega2560-Rev3-p-695.html?queryID=4ca214ec6d1c29f11b4fb8ea9b412462&objectID=1868&indexName=bazaar_retailer_products) && [Arduino Uno](https://www.seeedstudio.com/Arduino-Uno-Rev3-p-2995.html?queryID=62ec7ca39b8fe0ebc6e04c773397de71&objectID=196&indexName=bazaar_retailer_products) && [Grove Beginner Kit for Arduinol](https://www.seeedstudio.com/Grove-Beginner-Kit-for-Arduino-p-4549.html)

- [micro:bit](https://www.seeedstudio.com/MICRO-BIT-SBC-BOARD-ONLY-V2-2-p-5294.html?queryID=aa6734c4d3222d27c9fe62e74012ccd3&objectID=5294&indexName=bazaar_retailer_products)

- [M.A.R.K(CyberEye)](https://www.seeedstudio.com/Make-A-Robot-Kit-p-4669.html?queryID=fd7dc3b439a2a85852f4f46efe8bbd2b&objectID=4669&indexName=bazaar_retailer_products)

You can download the latest version from [the download page from our website](https://ide.tinkergen.com/download/en/)
- [GLINT](https://www.seeedstudio.com/Glint-Programmable-Wearable-Bracelet-p-4631.html?queryID=2638256e766bc26fe3165286a556f669&objectID=4631&indexName=bazaar_retailer_products)

## Getting started
- [Bittle](https://www.seeedstudio.com/CH-Bittle-p-4833.html?queryID=fe0d39474704586c27934023f1a5b95a&objectID=4833&indexName=bazaar_retailer_products)

### Prerequisites
- [Wio Terminal](https://www.seeedstudio.com/Wio-Terminal-p-4509.html?queryID=86e04846e7077e38bdc4182aeba96330&objectID=4509&indexName=bazaar_retailer_products)

## Download

You can download the latest version from [the download page from our website](https://ide.tinkergen.com/download/en/) or [Github Release](https://github.com/Seeed-Studio/CodeCraft/releases)

## Prerequisites

This project requires:
- [Node.js](https://nodejs.org/)
- [Node.js 14+](https://nodejs.org/)
- [Python 2.x](https://www.python.org/downloads/release/python-272/), and make it as the default version

### Building
## Build

Clone this repo

```bash
git clone -b main https://github.com/Seeed-Studio/CodeCraft.git ~/seeed-codecraft
export workspace=~/seeed-codecraft
pushd $workspace
```

The following steps will help you build the project locally. It will generate a installer after the building is done.
### Auto Install

Linux/Mac:

bash run-mac.sh
```bash
bash run-mac.sh
```

Windows:

bash run-win64.sh
```bash
bash run-win64.sh
```

### Manual Installation

```bash
cd ${workspace}/blocks
npm install && npm run build

cd ${workspace}/l10n
npm install && npm run build

cd ${workspace}/vm
npm install && npm run build

cd ${workspace}/gui
npm install
```

- For mac or linux like

```bash
npm run build-mac
```

- For win

```bash
npm run build-win
```

#### Build main app

```bash
rm -r ${workspace}/main/app/gui && cp -r ./build ${workspace}/main/app/gui
cd ${workspace}/main/app
npm install
./node_modules/.bin/electron-rebuild serialport

You can also build the project manually:
# If the error message “script is prohibited on this system” appears on the Windows
# system, you need to open powershell as an administrator, and then execute
# Set-ExecutionPolicy RemoteSigned

cd blocks
npm install && npm run build
cd ${workspace}/main
npm install
rm -r build
```

cd ../l10n
npm install && npm run build
- For Mac

cd ../vm
npm install && npm run build
```bash
npm run publish-mac
```

cd ../gui
npm install
// for mac or linux
npm run build-mac
// for win
npm run build-win
rm -r ../main/app/gui && cp -r ./build ../main/app/gui
- For Linux like

cd ../main/app
npm install
./node_modules/.bin/electron-rebuild serialport
```bash
npm run publish-linux
```

// If the error message “script is prohibited on this system” appears on the Windows
// system, you need to open powershell as an administrator, and then execute
// Set-ExecutionPolicy RemoteSigned
- For Windows

cd ..
npm install
rm -r build
// Mac
npm run publish-mac
// Linux
npm run publish-linux
// Windows
npm run publish-win64
```bash
npm run publish-win64
```

Once you finish building, you can find the installer under main/build/

## Architecture
## Contribute

## Contribution
`PR welcome`

We'd love to have people in open source communities help Codecraft grow. If you are interested in contributing, please read this guide.
Here, we’d also love to announce an open call for contributions to Codecraft open source project on GitHub. Whether you're a seasoned programmer or just starting out, we welcome contributions of all levels. From fixing bugs, to implementing new features & new blocks of functions, to make it compatible with more hardware platforms, to improving the overall codebase, there are many ways in which you can contribute to the project. Thanks in advance for your interest in [contributing](./misc/CONTRIBUTING.md) to this project!

## License

Expand Down
32 changes: 17 additions & 15 deletions blocks/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,37 @@ common.pyc
*.komodoproject
/nbproject/private/

/accessible/*
/dist
# Unused by scratch-blocks
dart_compressed.js
javascript_compressed.js
lua_compressed.js
php_compressed.js
python_compressed.js

/msg/json/synonyms.json
/msg/json/qqq.json
/msg/json/constants.json
/msg/json/en.jso
/msg/js/en.js
# Editor
.vscode

/accessible/*
/dist
/msg/js/*
!/msg/js/en.js
/msg/json/*
!/msg/json/en.json
/blockly_compressed_horizontal.js
/blockly_compressed_vertical.js
/blockly_uncompressed_horizontal.js
/blockly_uncompressed_vertical.js
/blocks_compressed_horizontal.js
/blocks_compressed_vertical.js
/blocks_compressed.js

/c_compressed.js
/dart_compressed.js
/javascript_compressed.js
/lua_compressed.js
/php_compressed.js
/python_compressed.js

/gh-pages
/gh-pages/main.js
/gh-pages/playgrounds
/gh-pages/Gemfile.lock
/gh-pages/closure-library
/gh-pages/_site
/*compiler*.jar
/local_blockly_compressed_vertical.js
/chromedriver

/gen_reqfiles.txt
Loading

0 comments on commit bf9be84

Please sign in to comment.