Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions .github/workflows/update_gh_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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
Expand Down
8 changes: 5 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
);

Expand All @@ -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();
Expand Down Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
14 changes: 7 additions & 7 deletions scripts/gh-predeploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ function injectFooter(initialContents) {
<ul>
<li><a target="_blank" href="https://developers.google.com/blockly/guides/overview/">Developer Docs</a></li>
<li><a target="_blank" href="https://blocklycodelabs.dev/">Codelabs</a></li>
<li><a target="_blank" href="https://google.github.io/blockly-samples/developer-tools/index.html">Developer
<li><a target="_blank" href="https://raspberrypifoundation.github.io/blockly-samples/developer-tools/index.html">Developer
Tools</a></li>
</ul>
</div>
<div class="link-list">
<label>Github</label>
<ul>
<li><a target="_blank" href="https://github.com/google/blockly/">Blockly Sources</a></li>
<li><a target="_blank" href="https://github.com/google/blockly-samples/">Blockly Samples</a></li>
<li><a target="_blank" href="https://github.com/raspberrypifoundation/blockly/">Blockly Sources</a></li>
<li><a target="_blank" href="https://github.com/raspberrypifoundation/blockly-samples/">Blockly Samples</a></li>
</ul>
</div>
<div class="link-list">
Expand Down Expand Up @@ -107,7 +107,7 @@ function injectFooter(initialContents) {
* @returns {string} The modified contents of the page, as a string.
*/
function injectPluginNavBar(inputString, packageJson, pluginDir, isLocal) {
const codeLink = `https://github.com/google/blockly-samples/blob/master/plugins/${pluginDir}`;
const codeLink = `https://github.com/raspberrypifoundation/blockly-samples/blob/main/plugins/${pluginDir}`;
const npmLink = `https://www.npmjs.com/package/${packageJson.name}`;
const baseURL = isLocal ? '/' : '/blockly-samples/';

Expand Down Expand Up @@ -367,7 +367,7 @@ function injectExampleNavBar(inputString, demoConfig, pageRoot, isLocal) {
const descriptionString = demoConfig.description
? `<div class="subtitle">${demoConfig.description}</div>`
: ``;
const codeLink = `https://github.com/google/blockly-samples/blob/master/${pageRoot}`;
const codeLink = `https://github.com/raspberrypifoundation/blockly-samples/blob/main/${pageRoot}`;

const pages = demoConfig.pages;
const tabString = pages ? createExampleTabs(pageRoot, pages, isLocal) : '';
Expand Down Expand Up @@ -594,10 +594,10 @@ function createIndexPage(isLocal) {
<!-- HEADER -->
<nav id="toolbar">
<div class="site-width layout horizontal">
<a href="https://google.github.io/blockly-samples/"><img src="https://blocklycodelabs.dev/images/logo_knockout.png" class="logo-devs"
<a href="https://raspberrypifoundation.github.io/blockly-samples/"><img src="https://blocklycodelabs.dev/images/logo_knockout.png" class="logo-devs"
alt="Blockly" /></a>
</div>
<a class="button" href="https://github.com/google/blockly-samples">View on GitHub</a>
<a class="button" href="https://github.com/raspberrypifoundation/blockly-samples">View on GitHub</a>
</nav>
<main id="main" class="index">
<div class="drop-shadow"></div>
Expand Down
Loading