Skip to content

Commit

Permalink
Change CI to publish to GitHub package registry
Browse files Browse the repository at this point in the history
On pushes to the experience-cs branch.
  • Loading branch information
floehopper committed Jan 20, 2025
1 parent b8db7da commit 3077d5f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand All @@ -14,6 +14,7 @@ permissions:
pages: write # deploy to GitHub Pages
issues: write # comment on released issues
pull-requests: write # comment on released pull requests
packages: write # deploy to GitHub Packages

jobs:
ci-cd:
Expand Down Expand Up @@ -79,11 +80,14 @@ jobs:
if [[ ${{contains(github.ref, 'hotfix')}} ]]; then
sed -e "s|hotfix/REPLACE|${{ github.ref_name }}|" --in-place release.config.js
fi
- name: 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 publish --access public --tag latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx --no -- semantic-release
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- 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'
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit 3077d5f

Please sign in to comment.