Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ on:
type: boolean
default: false

permissions:
contents: read
packages: write

concurrency:
group: "${{ github.workflow }} @ ${{ github.event.compare || github.head_ref || github.ref }}"
cancel-in-progress: true
Expand All @@ -34,6 +38,7 @@ jobs:
with:
cache: 'npm'
node-version-file: '.nvmrc'
registry-url: https://npm.pkg.github.com
- name: Debug Info
# https://docs.github.com/en/actions/reference/security/secure-use#use-an-intermediate-environment-variable
env:
Expand Down Expand Up @@ -68,8 +73,14 @@ jobs:
fi

- if: ${{ steps.filter.outputs.any-workspace == 'true' }}
env:
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ./.github/actions/install-dependencies

- name: Install Rolldown linux binaries
if: ${{ steps.filter.outputs.any-workspace == 'true' }}
run: npm install @rolldown/binding-linux-x64-gnu --no-save --ignore-scripts

# TODO: Packages currently depend on each other's compiled dist at build time. Fix that and matrix the builds.
- name: Build Packages
if: ${{ steps.filter.outputs.any-workspace == 'true' }}
Expand All @@ -86,6 +97,16 @@ jobs:
packages/**/dist
packages/**/playground

- name: Publish scratch-gui to GitHub Packages
if: ${{ github.ref == 'refs/heads/experience-cs' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
working-directory: ./packages/scratch-gui
env:
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
RELEASE_VERSION="13.7.3-experience-cs.$(date +'%Y%m%d%H%M%S')"
npm version --no-git-tag-version "$RELEASE_VERSION"
npm publish --access public --tag latest

test:
name: Test
needs: build
Expand Down
235 changes: 0 additions & 235 deletions .github/workflows/publish.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@RaspberryPiFoundation:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${NPM_AUTH_TOKEN}
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,46 @@ Scratch project by pressing "Create" on that website or by visiting <https://scr
This is a source code repository for the packages that make up the Scratch editor and a few additional support
packages. Use this if you'd like to learn about how the Scratch editor works or to contribute to its development.

## Raspberry Pi Foundation fork (`experience-cs`)

This repository is a public fork of [scratchfoundation/scratch-editor](https://github.com/scratchfoundation/scratch-editor), maintained for Experience CS and related products. Modified source is published under AGPL-3.0; published npm packages should correspond to a specific commit on this repository.

### Upstream anchor and integration branch

| | |
|---|---|
| **Upstream release** | [`v13.7.3`](https://github.com/scratchfoundation/scratch-editor/releases/tag/v13.7.3) on [scratchfoundation/scratch-editor](https://github.com/scratchfoundation/scratch-editor) |
| **Integration branch** | [`experience-cs`](https://github.com/RaspberryPiFoundation/scratch-editor/tree/experience-cs) — long-lived branch; feature work merges here via PR |
| **Published package** | [`@RaspberryPiFoundation/scratch-gui`](https://github.com/RaspberryPiFoundation/scratch-editor/pkgs/npm/scratch-gui) on GitHub Packages |

This was base on the latest upstream release tag `v13.7.3` with RPF-specific packaging and CI.

### Local development

Use the Node version in [`.nvmrc`](.nvmrc). Install dependencies from the **repository root**:

```bash
nvm install
nvm use
NODE_ENV=development npm ci
npm run build
```

Root [`.npmrc`](.npmrc) routes the `@RaspberryPiFoundation` scope to GitHub Packages. This requires a Github access token with `read:packages` and `repo`.

```bash
cd packages/scratch-gui
npm run test:lint
npm run test:unit
npm start # http://localhost:8601/
```

### CI and publishing

- **Pull requests:** CI runs build and tests; **no** package is published to GitHub Packages.
- **Push to `experience-cs`:** CI builds and publishes `@RaspberryPiFoundation/scratch-gui` with a version such as `13.7.3-experience-cs.YYYYMMDDHHMMSS`. Pin an explicit version in consumers (e.g. editor-ui); do not rely on floating `latest` in production.
- Publishing is configured in [`.github/workflows/ci.yml`](.github/workflows/ci.yml) (inline publish step on the `experience-cs` branch only). Upstream’s npmjs release workflow (`.github/workflows/publish.yml`) is disabled on this fork.

## What's in this repository?

The `packages` directory in this repository contains:
Expand Down
11 changes: 5 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions packages/scratch-gui/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{
"name": "@scratch/scratch-gui",
"name": "@RaspberryPiFoundation/scratch-gui",
"version": "13.7.3",
"description": "Graphical User Interface for creating and running Scratch 3.0 projects",
"keywords": [],
"homepage": "https://github.com/scratchfoundation/scratch-gui#readme",
"homepage": "https://github.com/RaspberryPiFoundation/scratch-editor#readme",
"bugs": {
"url": "https://github.com/scratchfoundation/scratch-editor/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/scratchfoundation/scratch-editor.git"
"url": "https://github.com/RaspberryPiFoundation/scratch-editor.git"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com"
},
"license": "AGPL-3.0-only",
"author": "Massachusetts Institute of Technology",
Expand Down
Loading
Loading