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 }}"
2126 with :
2227 cache : ' npm'
2328 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 : |
@@ -67,23 +74,16 @@ jobs:
6774 if : ${{ steps.filter.outputs.global == 'true' || steps.filter.outputs.any-workspace == 'true' }}
6875 run : npm run build
6976
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
8577 - name : Test scratch-gui
8678 if : ${{ !cancelled() && (steps.filter.outputs.global == 'true' || steps.filter.outputs.scratch-gui == 'true') }}
8779 uses : ./.github/actions/test-package
8880 with :
8981 package_name : scratch-gui
82+
83+ - name : Publish scratch-gui to GitHub Packages
84+ env :
85+ NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
86+ run : |
87+ RELEASE_VERSION="0.1.0-experience-cs.$(date +'%Y%m%d%H%M%S')"
88+ npm version --no-git-tag-version $RELEASE_VERSION --workspace=@RaspberryPiFoundation/scratch-gui
89+ npm publish --access public --tag latest --workspace=@RaspberryPiFoundation/scratch-gui
0 commit comments