Releasing the Mod
Scratch 3.0 has been relicensed to be under the GNU Affero General Public License v3. This means that, if you release your mod, you must also release the source code of your mod with it.
Useful Information
What if my mod is based on an older pre-AGPL licensed version of Scratch 3.0?
This means you are still using a BSD 3-Clause licensed version of Scratch. You are not required to release the source code of your mod.
What does the AGPL license require?
A simple overview of the license can be found here. Tip: Hover your mouse over the points under permission/conditions/limitations for a description of them.
What version of Scratch 3.0 is the code linked at the end of the tutorials from?
The tutorials currently are based on a BSD 3-Clause licesned version of Scratch 3.0. However, they will be updated to an AGPL licensed version if the BSD 3-Clause licesned version becomes outdated.
How do I know if I'm using an AGPL or a BSD 3-Clause licensed version of Scratch 3.0?
In your
scratch-gui
orscratch-vm
folder, check theLICENSE.md
file. If it starts withGNU AFFERO GENERAL PUBLIC LICENSE
, then you are using an AGPL licensed version of Scratch 3.0.
GitHub (with GitHub Actions) Recommended
This section expects that you forked the Scratch repositories and cloned your fork when initally setting up your mod.
Commit and push your changes
First, you will need to commit and push your changes to GitHub.
git commit -am "any commit message you want... should describe your changes."
git push origin develop
develop
is the main branch for most Scratch repositories.
Add GitHub Actions workflow
In your scratch-gui
repository, add a .github/workflows/publish.yml
file.
name: Publish
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: "npm"
- name: Install Dependencies
run: npm ci
- name: Build Scratch
run: npm run build
- name: Upload the pages artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./build
deploy:
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Publish Pages
id: deployment
uses: actions/deploy-pages@v2
Next, make sure that GitHub Pages's Source setting is set to "GitHub Actions" in your repository's Settings -> Pages
.
Finally, go to the Actions tab, go to "Publish" on the left sidebar, press "Run workflow" (in the blue banner), ensure the develop
branch is selected and press "Run workflow" to build and publish Scratch to GitHub Pages.
Improvements
You could improve this by automatically rebuilding when you push to the repository or when you publish a release.
Run on push to repository
on:
push:
branches:
- "develop"
Run on release publish
on:
release:
types: [published]
Manual Hosting
Run this command to build scratch-gui
. Once you have run the command, you will have a folder called build
, this contains the Scratch build.
- NPM
- Yarn
- PNPM
npm run build
yarn run build
pnpm run build
Once you have built Scratch, you can upload the contents of the build
folder anywhere you like.