Skip to content

Commit 906150d

Browse files
chore: [UEPR-56] resolve merge conflicts
2 parents c3588f5 + 43a8660 commit 906150d

File tree

109 files changed

+5772
-7153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+5772
-7153
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @scratchfoundation/scratch-editor-code-owners

.github/actions/install-dependencies/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ runs:
2525
fi
2626
# When the main workflow calls many workspace workflows, we can reuse this cache for all of them.
2727
# Since this is caching the node_modules directory, DO NOT add partial-match restore keys!
28-
- uses: actions/cache/restore@v4
28+
- uses: actions/cache/restore@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4
2929
id: restore-node-modules-cache
3030
with:
3131
path: |
@@ -39,7 +39,7 @@ runs:
3939
working-directory: .
4040
shell: bash
4141
run: NODE_ENV=development npm ci
42-
- uses: actions/cache/save@v4
42+
- uses: actions/cache/save@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4
4343
if: steps.restore-node-modules-cache.outputs.cache-hit != 'true'
4444
with:
4545
path: |

.github/actions/test-package/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ runs:
2222
npm run test | tee -a ./test-results/${{ inputs.package_name }}-test-results.txt
2323
- name: Store Test Results
2424
if: ${{ !cancelled() }}
25-
uses: actions/upload-artifact@v4
25+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
2626
with:
2727
name: ${{ inputs.package_name }}-test-output
2828
path: ./packages/${{ inputs.package_name }}/test-results/*

.github/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
changelog:
2+
categories:
3+
- title: General
4+
labels:
5+
- '*'
6+
exclude:
7+
authors:
8+
- 'renovate[bot]'
9+
labels:
10+
- 'dependencies'
11+
- 'security'
12+
- title: Security
13+
labels:
14+
- 'security'
15+
# The "Dependencies" category includes
16+
# - items with the 'dependencies' label
17+
# - items excluded above, mainly by the exclude.authors in "General"
18+
- title: Dependencies
19+
labels:
20+
- '*'

.github/workflows/ci.yml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
name: CI
22

33
on:
4+
merge_group:
45
pull_request:
6+
push: # WARNING: Renovate sometimes automerges without PR, so we MUST build and test renovate/** branches
57
workflow_call:
68
workflow_dispatch:
79

810
concurrency:
9-
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
11+
group: "${{ github.workflow }} @ ${{ github.event.compare || github.head_ref || github.ref }}"
1012
cancel-in-progress: true
1113

1214
jobs:
1315
ci:
1416
name: Detect affected packages, build and test
1517
runs-on: ubuntu-latest
1618
steps:
17-
- uses: actions/checkout@v4
18-
- uses: actions/setup-node@v4
19+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
20+
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
1921
with:
2022
cache: 'npm'
2123
node-version-file: '.nvmrc'
22-
- uses: wagoid/commitlint-github-action@v5
24+
- uses: wagoid/commitlint-github-action@9763196e10f27aef304c9b8b660d31d97fce0f99 # v5
2325
- name: Debug info
2426
run: |
2527
cat <<EOF
@@ -31,56 +33,57 @@ jobs:
3133
Working directory: $(pwd)
3234
EOF
3335
34-
- uses: dorny/paths-filter@v3
36+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
3537
id: filter
3638
with:
39+
# Files in the `global` filter affect all workspaces, even if workspace-specific files have not changed.
3740
filters: |
38-
any-workspace:
41+
global:
3942
- ".github/workflows/ci.yml"
43+
- "package.json"
44+
- "package-lock.json"
45+
- "scripts/**"
46+
any-workspace:
4047
- "packages/**"
4148
scratch-svg-renderer:
42-
- ".github/workflows/ci.yml"
4349
- "packages/scratch-svg-renderer/**"
4450
scratch-render:
45-
- ".github/workflows/ci.yml"
4651
- "packages/scratch-render/**"
4752
- "packages/scratch-svg-renderer/**"
4853
scratch-vm:
49-
- ".github/workflows/ci.yml"
5054
- "packages/scratch-render/**"
5155
- "packages/scratch-svg-renderer/**"
5256
- "packages/scratch-vm/**"
5357
scratch-gui:
54-
- ".github/workflows/ci.yml"
5558
- "packages/scratch-gui/**"
5659
- "packages/scratch-render/**"
5760
- "packages/scratch-svg-renderer/**"
5861
- "packages/scratch-vm/**"
59-
60-
- if: ${{ steps.filter.outputs.any-workspace == 'true' }}
62+
63+
- if: ${{ steps.filter.outputs.global == 'true' || steps.filter.outputs.any-workspace == 'true' }}
6164
uses: ./.github/actions/install-dependencies
6265

6366
- name: Build packages
64-
if: ${{ steps.filter.outputs.any-workspace == 'true' }}
67+
if: ${{ steps.filter.outputs.global == 'true' || steps.filter.outputs.any-workspace == 'true' }}
6568
run: npm run build
6669

6770
- name: Test scratch-svg-renderer
68-
if: ${{ !cancelled() && steps.filter.outputs.scratch-svg-renderer == 'true' }}
71+
if: ${{ !cancelled() && (steps.filter.outputs.global == 'true' || steps.filter.outputs.scratch-svg-renderer == 'true') }}
6972
uses: ./.github/actions/test-package
7073
with:
7174
package_name: scratch-svg-renderer
7275
- name: Test scratch-render
73-
if: ${{ !cancelled() && steps.filter.outputs.scratch-render == 'true' }}
76+
if: ${{ !cancelled() && (steps.filter.outputs.global == 'true' || steps.filter.outputs.scratch-render == 'true') }}
7477
uses: ./.github/actions/test-package
7578
with:
7679
package_name: scratch-render
7780
- name: Test scratch-vm
78-
if: ${{ !cancelled() && steps.filter.outputs.scratch-vm == 'true' }}
81+
if: ${{ !cancelled() && (steps.filter.outputs.global == 'true' || steps.filter.outputs.scratch-vm == 'true') }}
7982
uses: ./.github/actions/test-package
8083
with:
8184
package_name: scratch-vm
8285
- name: Test scratch-gui
83-
if: ${{ !cancelled() && steps.filter.outputs.scratch-gui == 'true' }}
86+
if: ${{ !cancelled() && (steps.filter.outputs.global == 'true' || steps.filter.outputs.scratch-gui == 'true') }}
8487
uses: ./.github/actions/test-package
8588
with:
8689
package_name: scratch-gui

.github/workflows/publish.yml

Lines changed: 58 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,52 +8,94 @@ jobs:
88
ci:
99
uses: ./.github/workflows/ci.yml
1010
cd:
11+
needs:
12+
- ci
1113
runs-on: ubuntu-latest
1214
steps:
13-
- uses: actions/checkout@v4
14-
- uses: actions/setup-node@v4
15-
with:
16-
cache: 'npm'
17-
node-version-file: '.nvmrc'
18-
registry-url: 'https://registry.npmjs.org'
15+
- name: Debug info
16+
run: |
17+
cat <<EOF
18+
Release tag name: ${{ github.event.release.tag_name }}
19+
Release target commit-ish: ${{ github.event.release.target_commitish }}
20+
EOF
21+
22+
- name: Determine NPM tag
23+
id: npm_tag
24+
shell: bash
25+
run: |
26+
case ${{ github.event.release.target_commitish }} in
27+
develop | main | master)
28+
if [[ ${{ github.event.release.prerelease }} == true ]]; then
29+
npm_tag=beta
30+
else
31+
npm_tag=latest
32+
fi
33+
;;
34+
*)
35+
# use the branch name
36+
npm_tag="${{ github.event.release.target_commitish }}"
37+
;;
38+
esac
39+
echo "Determined NPM tag: [$npm_tag]"
40+
echo "npm_tag=${npm_tag}" >> "$GITHUB_OUTPUT"
41+
- name: Check NPM tag
42+
run: |
43+
if [ -z "${{ steps.npm_tag.outputs.npm_tag }}" ]; then
44+
echo "Refusing to publish with empty NPM tag."
45+
exit 1
46+
fi
1947
2048
- name: Config GitHub user
2149
shell: bash
2250
run: |
2351
git config --global user.name 'GitHub Actions'
2452
git config --global user.email 'github-actions@localhost'
2553
54+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
55+
with:
56+
token: ${{ secrets.PAT_RELEASE_PUSH }} # persists the token for pushing to the repo later
57+
58+
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
59+
with:
60+
cache: 'npm'
61+
node-version-file: '.nvmrc'
62+
registry-url: 'https://registry.npmjs.org'
63+
64+
- uses: ./.github/actions/install-dependencies
65+
2666
- name: Update the version in the package files
2767
shell: bash
2868
run: |
2969
GIT_TAG="${{github.event.release.tag_name}}"
3070
NEW_VERSION="${GIT_TAG/v/}"
3171
32-
bash ./scripts/update-dependencies-with-tag-versions.sh "$NEW_VERSION"
33-
git add package* && git commit -m "Release $NEW_VERSION"
72+
npm version "$NEW_VERSION" --no-git-tag-version
73+
git add package* && git commit -m "chore(release): $NEW_VERSION [skip ci]"
3474
75+
# Install dependencies after the version update so that
76+
# the build outputs refer to the newest version of inner packages
3577
- uses: ./.github/actions/install-dependencies
3678

3779
- name: Build packages
3880
run: npm run build
3981

4082
- name: Publish scratch-svg-renderer
41-
run: npm publish --access=public --workspace=@scratch/scratch-svg-renderer
83+
run: npm publish --access=public --tag="${{steps.npm_tag.outputs.npm_tag}}" --workspace=@scratch/scratch-svg-renderer
4284
env:
4385
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
4486

4587
- name: Publish scratch-render
46-
run: npm publish --access=public --workspace=@scratch/scratch-render
88+
run: npm publish --access=public --tag="${{steps.npm_tag.outputs.npm_tag}}" --workspace=@scratch/scratch-render
4789
env:
4890
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
4991

5092
- name: Publish scratch-vm
51-
run: npm publish --access=public --workspace=@scratch/scratch-vm
93+
run: npm publish --access=public --tag="${{steps.npm_tag.outputs.npm_tag}}" --workspace=@scratch/scratch-vm
5294
env:
5395
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
5496

5597
- name: Publish scratch-gui
56-
run: npm publish --access=public --workspace=@scratch/scratch-gui
98+
run: npm publish --access=public --tag="${{steps.npm_tag.outputs.npm_tag}}" --workspace=@scratch/scratch-gui
5799
env:
58100
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
59101

@@ -80,35 +122,33 @@ jobs:
80122
git push -f origin "refs/tags/${{github.event.release.tag_name}}"
81123
82124
- name: Deploy scratch-svg-renderer to GitHub Pages
83-
uses: peaceiris/actions-gh-pages@v4
125+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4
84126
with:
85127
github_token: ${{ secrets.GITHUB_TOKEN }}
86128
publish_dir: ./packages/scratch-svg-renderer/playground
87129
destination_dir: scratch-svg-renderer
88130
full_commit_message: "Build for ${{ github.sha }} ${{ github.event.head_commit.message }}"
89131

90132
- name: Deploy scratch-render to GitHub Pages
91-
uses: peaceiris/actions-gh-pages@v4
133+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4
92134
with:
93135
github_token: ${{ secrets.GITHUB_TOKEN }}
94136
publish_dir: ./packages/scratch-render/playground
95137
destination_dir: scratch-render
96138
full_commit_message: "Build for ${{ github.sha }} ${{ github.event.head_commit.message }}"
97139

98140
- name: Deploy scratch-vm to GitHub Pages
99-
uses: peaceiris/actions-gh-pages@v4
141+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4
100142
with:
101143
github_token: ${{ secrets.GITHUB_TOKEN }}
102144
publish_dir: ./packages/scratch-vm/playground
103145
destination_dir: scratch-vm
104146
full_commit_message: "Build for ${{ github.sha }} ${{ github.event.head_commit.message }}"
105147

106148
- name: Deploy scratch-gui to GitHub Pages
107-
uses: peaceiris/actions-gh-pages@v4
149+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4
108150
with:
109151
github_token: ${{ secrets.GITHUB_TOKEN }}
110152
publish_dir: ./packages/scratch-gui/build
111153
destination_dir: scratch-gui
112154
full_commit_message: "Build for ${{ github.sha }} ${{ github.event.head_commit.message }}"
113-
needs:
114-
- ci

.github/workflows/signature-assistant.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
issue_comment:
44
types: [created]
55
pull_request_target:
6-
types: [opened,closed,synchronize]
6+
types: [opened, closed, synchronize]
77

88
permissions:
99
actions: write
@@ -13,19 +13,25 @@ permissions:
1313

1414
jobs:
1515
CLA-Assistant:
16+
if: github.event_name == 'pull_request_target' ||
17+
(
18+
github.event.comment.body == 'recheck' ||
19+
github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA'
20+
)
1621
runs-on: ubuntu-latest
1722
steps:
23+
- uses: scratchfoundation/scratch-agreements/.github/actions/cla-allowlist@main
24+
id: cla-allowlist
1825
- name: "CLA Assistant"
19-
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
2026
uses: contributor-assistant/github-action@ca4a40a7d1004f18d9960b404b97e5f30a505a08 # v2.6.1
2127
env:
2228
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2329
# the below token should have repo scope and must be manually added by you in the repository's secrets
2430
PERSONAL_ACCESS_TOKEN: ${{ secrets.GHA_AGREEMENTS_PAT }}
2531
with:
26-
remote-organization-name: 'scratchfoundation'
27-
remote-repository-name: 'scratch-agreements'
28-
path-to-signatures: 'signatures/version1/cla.json'
29-
path-to-document: 'https://github.com/scratchfoundation/scratch-agreements/blob/main/CLA.md'
30-
branch: 'main'
31-
allowlist: semantic-release-bot,*[bot]
32+
remote-organization-name: "scratchfoundation"
33+
remote-repository-name: "scratch-agreements"
34+
path-to-signatures: "signatures/version1/cla.json"
35+
path-to-document: "https://github.com/scratchfoundation/scratch-agreements/blob/main/CLA.md"
36+
branch: "main"
37+
allowlist: ${{ steps.cla-allowlist.outputs.allowlist }}

.github/workflows/update-i18n.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
update-i18n:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v4
20-
- uses: actions/setup-node@v4
19+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
20+
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
2121
with:
2222
cache: 'npm'
2323
node-version-file: '.nvmrc'

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v20
1+
20.19.4

0 commit comments

Comments
 (0)