Skip to content

Commit f19306b

Browse files
sebjacobschrislo
andcommitted
ci: change CI to publish to GitHub package registry
* Use github npm registry. * We can use the GITHUB_TOKEN that is made available by default in a GitHub Action as the NODE_AUTH_TOKEN, although we need to add the `packages: write` permission to the Action. Co-authored-by: Chris Lowis <[email protected]>
1 parent c0e0b79 commit f19306b

File tree

4 files changed

+27
-182
lines changed

4 files changed

+27
-182
lines changed

.github/workflows/ci.yml

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

33
on:
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+
packages: write # deploy to GitHub Packages
910

1011
concurrency:
1112
group: "${{ github.workflow }} @ ${{ github.event.compare || github.head_ref || github.ref }}"
@@ -21,6 +22,8 @@ jobs:
2122
with:
2223
cache: 'npm'
2324
node-version-file: '.nvmrc'
25+
registry-url: "https://npm.pkg.github.com"
26+
2427
- uses: wagoid/commitlint-github-action@9763196e10f27aef304c9b8b660d31d97fce0f99 # v5
2528
- name: Debug info
2629
run: |
@@ -67,23 +70,16 @@ jobs:
6770
if: ${{ steps.filter.outputs.global == 'true' || steps.filter.outputs.any-workspace == 'true' }}
6871
run: npm run build
6972

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
8573
- name: Test scratch-gui
8674
if: ${{ !cancelled() && (steps.filter.outputs.global == 'true' || steps.filter.outputs.scratch-gui == 'true') }}
8775
uses: ./.github/actions/test-package
8876
with:
8977
package_name: scratch-gui
78+
79+
- name: Publish scratch-gui to GitHub Packages
80+
env:
81+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
run: |
83+
RELEASE_VERSION="0.1.0-experience-cs.$(date +'%Y%m%d%H%M%S')"
84+
npm version --no-git-tag-version $RELEASE_VERSION --workspace=@scratch/scratch-gui
85+
npm publish --access public --tag latest --workspace=@scratch/scratch-gui

.github/workflows/publish.yml

Lines changed: 0 additions & 154 deletions
This file was deleted.

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/scratch-gui/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
{
2-
"name": "@scratch/scratch-gui",
2+
"name": "@RaspberryPiFoundation/scratch-gui",
33
"version": "11.2.0-svg-sanitization.3",
44
"description": "Graphical User Interface for creating and running Scratch 3.0 projects",
55
"author": "Massachusetts Institute of Technology",
66
"license": "AGPL-3.0-only",
7-
"homepage": "https://github.com/scratchfoundation/scratch-gui#readme",
7+
"homepage": "https://github.com/RaspberryPiFoundation/scratch-editor#readme",
88
"repository": {
99
"type": "git",
10-
"url": "https://github.com/scratchfoundation/scratch-editor.git"
10+
"url": "https://github.com/RaspberryPiFoundation/scratch-editor.git"
11+
},
12+
"publishConfig": {
13+
"registry": "https://npm.pkg.github.com"
1114
},
1215
"main": "./dist/scratch-gui.js",
1316
"types": "./dist/types/index.d.ts",

0 commit comments

Comments
 (0)