diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bf0c8dcf3..82fb9a769 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,14 +8,15 @@ on: - cron: '5 17 * * 4' # Thursdays at 17:05 UTC (09:05 PST / 10:05 PDT) permissions: + id-token: write # Required for OIDC. contents: write # For checkout and tag. packages: write # For publish. jobs: publish: runs-on: ubuntu-latest - # Don't try to publish from a fork of google/blockly-samples. - if: ${{ github.repository_owner == 'google' }} + # Don't try to publish from a fork of RaspberryPiFoundation/blockly-samples. + if: ${{ github.repository_owner == 'RaspberryPiFoundation' }} # Environment specific to releasing so we can isolate the npm token. environment: release @@ -26,7 +27,7 @@ jobs: # fetch all tags and commits so that lerna can version appropriately with: fetch-depth: 0 - ref: 'master' + ref: 'main' # This uses a reverse-engineered email for the github actions bot. See # https://github.com/actions/checkout/issues/13#issuecomment-724415212 @@ -40,11 +41,6 @@ jobs: with: node-version: 20 - - name: Configure npm - run: npm config set //wombat-dressing-room.appspot.com/:_authToken=$NODE_AUTH_TOKEN - env: - NODE_AUTH_TOKEN: ${{ secrets.RELEASE_BACKED_NPM_TOKEN }} - - name: NPM install # Use CI so that we don't update dependencies in this step. run: npm ci @@ -64,6 +60,6 @@ jobs: name: Update GitHub Pages # Call the Update gh-pages workflow only if publishing succeeds needs: [publish] - # Don't try to auto-update if on a fork of google/blockly-samples. - if: ${{ github.repository_owner == 'google' }} + # Don't try to auto-update if on a fork of RaspberryPiFoundation/blockly-samples. + if: ${{ github.repository_owner == 'RaspberryPiFoundation' }} uses: ./.github/workflows/update_gh_pages.yml diff --git a/.github/workflows/update_gh_pages.yml b/.github/workflows/update_gh_pages.yml index 013bed1e9..1cc804a56 100644 --- a/.github/workflows/update_gh_pages.yml +++ b/.github/workflows/update_gh_pages.yml @@ -8,7 +8,7 @@ on: branch: description: 'Branch to publish from' required: true - default: 'master' + default: 'main' type: string workflow_call: # Allow this workflow to be called from publish workflow. @@ -23,7 +23,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 with: - ref: ${{ inputs.branch || 'master' }} + ref: ${{ inputs.branch || 'main' }} - name: Setup Node uses: actions/setup-node@v3 diff --git a/gulpfile.js b/gulpfile.js index 56717b331..3b8a5257c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -66,7 +66,7 @@ function prepareForPublish(done) { `${path.resolve(releaseDir)}`, ); execSync( - `git clone https://github.com/google/blockly-samples ${releaseDir}`, + `git clone https://github.com/RaspberryPiFoundation/blockly-samples ${releaseDir}`, {stdio: 'pipe'}, ); @@ -84,7 +84,7 @@ function prepareForPublish(done) { // Login to npm. console.log('Logging in to npm.'); - execSync(`npm login --registry https://wombat-dressing-room.appspot.com`, { + execSync(`npm login`, { stdio: 'inherit', }); done(); @@ -304,7 +304,9 @@ function deployToGhPagesOrigin(done) { * @returns {Function} Gulp task. */ function deployToGhPagesUpstream(done) { - return deployToGhPages('https://github.com/google/blockly-samples.git')(done); + return deployToGhPages( + 'https://github.com/RaspberryPiFoundation/blockly-samples.git', + )(done); } module.exports = { diff --git a/scripts.md b/scripts.md index 8a3e89e66..6b1bf51e2 100644 --- a/scripts.md +++ b/scripts.md @@ -23,7 +23,7 @@ https://YOURUSERNAME.github.io/blockly-samples/. This script is similar to `npm run deploy` but it deploys the plugins to `blockly-samples` upstream. You can browse these plugin playgrounds at: -https://google.github.io/blockly-samples/. +https://raspberrypifoundation.github.io/blockly-samples/. ### `npm run license` diff --git a/scripts/gh-predeploy.js b/scripts/gh-predeploy.js index f08504c1d..b6ae17aaf 100644 --- a/scripts/gh-predeploy.js +++ b/scripts/gh-predeploy.js @@ -69,15 +69,15 @@ function injectFooter(initialContents) {