11name : CI
22
33on :
4- merge_group :
5- pull_request :
6- push : # WARNING: Renovate sometimes automerges without PR, so we MUST build and test renovate/** branches
7- workflow_call :
8- workflow_dispatch :
4+ workflow_dispatch : # Allows you to run this workflow manually from the Actions tab
5+ push : # Runs whenever a commit is pushed to the repository
6+ branches : [experience-cs]
7+
8+ permissions :
9+ contents : write # publish a GitHub release
10+ pages : write # deploy to GitHub Pages
11+ issues : write # comment on released issues
12+ pull-requests : write # comment on released pull requests
13+ packages : write # deploy to GitHub Packages
914
1015concurrency :
1116 group : " ${{ github.workflow }} @ ${{ github.event.compare || github.head_ref || github.ref }}"
1924 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
2025 - uses : actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
2126 with :
22- cache : ' npm'
23- node-version-file : ' .nvmrc'
27+ cache : " npm"
28+ node-version-file : " .nvmrc"
29+ registry-url : " https://npm.pkg.github.com"
30+
2431 - uses : wagoid/commitlint-github-action@9763196e10f27aef304c9b8b660d31d97fce0f99 # v5
2532 - name : Debug info
2633 run : |
@@ -33,57 +40,20 @@ jobs:
3340 Working directory: $(pwd)
3441 EOF
3542
36- - uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
37- id : filter
38- with :
39- # Files in the `global` filter affect all workspaces, even if workspace-specific files have not changed.
40- filters : |
41- global:
42- - ".github/workflows/ci.yml"
43- - "package.json"
44- - "package-lock.json"
45- - "scripts/**"
46- any-workspace:
47- - "packages/**"
48- scratch-svg-renderer:
49- - "packages/scratch-svg-renderer/**"
50- scratch-render:
51- - "packages/scratch-render/**"
52- - "packages/scratch-svg-renderer/**"
53- scratch-vm:
54- - "packages/scratch-render/**"
55- - "packages/scratch-svg-renderer/**"
56- - "packages/scratch-vm/**"
57- scratch-gui:
58- - "packages/scratch-gui/**"
59- - "packages/scratch-render/**"
60- - "packages/scratch-svg-renderer/**"
61- - "packages/scratch-vm/**"
62-
63- - if : ${{ steps.filter.outputs.global == 'true' || steps.filter.outputs.any-workspace == 'true' }}
64- uses : ./.github/actions/install-dependencies
65-
66- - name : Build packages
67- if : ${{ steps.filter.outputs.global == 'true' || steps.filter.outputs.any-workspace == 'true' }}
68- run : npm run build
43+ - name : Build and test scratch-gui
44+ env :
45+ NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
46+ working-directory : ./packages/scratch-gui
47+ run : |
48+ npm ci
49+ npm run build
50+ npm run test
6951
70- - name : Test scratch-svg-renderer
71- if : ${{ !cancelled() && (steps.filter.outputs.global == 'true' || steps.filter.outputs.scratch-svg-renderer == 'true') }}
72- uses : ./.github/actions/test-package
73- with :
74- package_name : scratch-svg-renderer
75- - name : Test scratch-render
76- if : ${{ !cancelled() && (steps.filter.outputs.global == 'true' || steps.filter.outputs.scratch-render == 'true') }}
77- uses : ./.github/actions/test-package
78- with :
79- package_name : scratch-render
80- - name : Test scratch-vm
81- if : ${{ !cancelled() && (steps.filter.outputs.global == 'true' || steps.filter.outputs.scratch-vm == 'true') }}
82- uses : ./.github/actions/test-package
83- with :
84- package_name : scratch-vm
85- - name : Test scratch-gui
86- if : ${{ !cancelled() && (steps.filter.outputs.global == 'true' || steps.filter.outputs.scratch-gui == 'true') }}
87- uses : ./.github/actions/test-package
88- with :
89- package_name : scratch-gui
52+ - name : Publish scratch-gui to GitHub Packages
53+ env :
54+ NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
55+ working-directory : ./packages/scratch-gui
56+ run : |
57+ RELEASE_VERSION="0.1.0-experience-cs.$(date +'%Y%m%d%H%M%S')"
58+ npm version --no-git-tag-version $RELEASE_VERSION
59+ npm publish --access public --tag latest
0 commit comments