From efc0e8cc399162657f2a2c7d5eabd352da040f89 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.json | 9 ++++++--- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 1fbc029dec7..443b32639c3 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=$GITHUB_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.json b/package.json index 29db12d7870..dd4ad42cf65 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,16 @@ { - "name": "scratch-gui", + "name": "@freerange/scratch-gui", "version": "5.1.29", "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": {