From 13688e0b8960481b7b7651dc2219bd1b3f1d01dc Mon Sep 17 00:00:00 2001 From: James Mead Date: Thu, 16 Jan 2025 16:46:17 +0000 Subject: [PATCH] Change CI to publish to GitHub package registry On pushes to the experience-cs branch. --- .github/workflows/ci-cd.yml | 14 ++++++++------ package-lock.json | 4 ++-- package.json | 11 +++++++---- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 1fbc029dec7..683afbfe549 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -3,7 +3,7 @@ name: CI/CD on: pull_request: # Runs whenever a pull request is created or updated (including from another fork) push: # Runs whenever a commit is pushed to the repository... - branches: [master, develop, hotfix/*] # ...on any of these branches + branches: [experience-cs] # ...on any of these branches workflow_dispatch: # Allows you to run this workflow manually from the Actions tab concurrency: group: "${{ github.workflow }} @ ${{ github.head_ref || github.ref }}" @@ -79,11 +79,13 @@ jobs: if [[ ${{contains(github.ref, 'hotfix')}} ]]; then sed -e "s|hotfix/REPLACE|${{ github.ref_name }}|" --in-place release.config.js fi - - name: Semantic Release - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npx --no -- semantic-release + - name: Publish to GitHub Packages + if: github.ref == 'refs/heads/experience-cs' + run: | + RELEASE_VERSION="0.1.0-raspberrypifoundation.$(date +'%Y%m%d%H%M%S')" + npm version --no-git-tag-version $RELEASE_VERSION + npm set https://npm.pkg.github.com/:_authToken=$NPM_TOKEN + npm publish --access public --tag latest - name: Deploy playground to GitHub Pages uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3 if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' diff --git a/package-lock.json b/package-lock.json index c9c8b558d75..db15b72e4d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "scratch-gui", - "version": "5.1.29", + "version": "0.1.0-raspberrypifoundation.20250120104951", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "scratch-gui", - "version": "5.1.29", + "version": "0.1.0-raspberrypifoundation.20250120104951", "license": "AGPL-3.0-only", "dependencies": { "@microbit/microbit-universal-hex": "^0.2.2", diff --git a/package.json b/package.json index 29db12d7870..0563796011c 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,16 @@ { - "name": "scratch-gui", - "version": "5.1.29", + "name": "@freerange/scratch-gui", + "version": "0.1.0-raspberrypifoundation.20250120104951", "description": "Graphical User Interface for creating and running Scratch 3.0 projects", "author": "Massachusetts Institute of Technology", "license": "AGPL-3.0-only", - "homepage": "https://github.com/scratchfoundation/scratch-gui#readme", + "homepage": "https://github.com/freerange/scratch-gui#readme", "repository": { "type": "git", - "url": "https://github.com/scratchfoundation/scratch-gui.git" + "url": "https://github.com/freerange/scratch-gui.git" + }, + "publishConfig": { + "registry": "https://npm.pkg.github.com" }, "main": "./dist/scratch-gui.js", "scripts": {