Skip to content

Commit c71f63d

Browse files
authored
chore: update publish and ghpages workflows (#2650)
1 parent 2db3b2b commit c71f63d

File tree

5 files changed

+21
-23
lines changed

5 files changed

+21
-23
lines changed

.github/workflows/publish.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ on:
88
- cron: '5 17 * * 4' # Thursdays at 17:05 UTC (09:05 PST / 10:05 PDT)
99

1010
permissions:
11+
id-token: write # Required for OIDC.
1112
contents: write # For checkout and tag.
1213
packages: write # For publish.
1314

1415
jobs:
1516
publish:
1617
runs-on: ubuntu-latest
17-
# Don't try to publish from a fork of google/blockly-samples.
18-
if: ${{ github.repository_owner == 'google' }}
18+
# Don't try to publish from a fork of RaspberryPiFoundation/blockly-samples.
19+
if: ${{ github.repository_owner == 'RaspberryPiFoundation' }}
1920

2021
# Environment specific to releasing so we can isolate the npm token.
2122
environment: release
@@ -26,7 +27,7 @@ jobs:
2627
# fetch all tags and commits so that lerna can version appropriately
2728
with:
2829
fetch-depth: 0
29-
ref: 'master'
30+
ref: 'main'
3031

3132
# This uses a reverse-engineered email for the github actions bot. See
3233
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
@@ -40,11 +41,6 @@ jobs:
4041
with:
4142
node-version: 20
4243

43-
- name: Configure npm
44-
run: npm config set //wombat-dressing-room.appspot.com/:_authToken=$NODE_AUTH_TOKEN
45-
env:
46-
NODE_AUTH_TOKEN: ${{ secrets.RELEASE_BACKED_NPM_TOKEN }}
47-
4844
- name: NPM install
4945
# Use CI so that we don't update dependencies in this step.
5046
run: npm ci
@@ -64,6 +60,6 @@ jobs:
6460
name: Update GitHub Pages
6561
# Call the Update gh-pages workflow only if publishing succeeds
6662
needs: [publish]
67-
# Don't try to auto-update if on a fork of google/blockly-samples.
68-
if: ${{ github.repository_owner == 'google' }}
63+
# Don't try to auto-update if on a fork of RaspberryPiFoundation/blockly-samples.
64+
if: ${{ github.repository_owner == 'RaspberryPiFoundation' }}
6965
uses: ./.github/workflows/update_gh_pages.yml

.github/workflows/update_gh_pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
branch:
99
description: 'Branch to publish from'
1010
required: true
11-
default: 'master'
11+
default: 'main'
1212
type: string
1313
workflow_call: # Allow this workflow to be called from publish workflow.
1414

@@ -23,7 +23,7 @@ jobs:
2323
- name: Checkout
2424
uses: actions/checkout@v3
2525
with:
26-
ref: ${{ inputs.branch || 'master' }}
26+
ref: ${{ inputs.branch || 'main' }}
2727

2828
- name: Setup Node
2929
uses: actions/setup-node@v3

gulpfile.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function prepareForPublish(done) {
6666
`${path.resolve(releaseDir)}`,
6767
);
6868
execSync(
69-
`git clone https://github.com/google/blockly-samples ${releaseDir}`,
69+
`git clone https://github.com/RaspberryPiFoundation/blockly-samples ${releaseDir}`,
7070
{stdio: 'pipe'},
7171
);
7272

@@ -84,7 +84,7 @@ function prepareForPublish(done) {
8484

8585
// Login to npm.
8686
console.log('Logging in to npm.');
87-
execSync(`npm login --registry https://wombat-dressing-room.appspot.com`, {
87+
execSync(`npm login`, {
8888
stdio: 'inherit',
8989
});
9090
done();
@@ -304,7 +304,9 @@ function deployToGhPagesOrigin(done) {
304304
* @returns {Function} Gulp task.
305305
*/
306306
function deployToGhPagesUpstream(done) {
307-
return deployToGhPages('https://github.com/google/blockly-samples.git')(done);
307+
return deployToGhPages(
308+
'https://github.com/RaspberryPiFoundation/blockly-samples.git',
309+
)(done);
308310
}
309311

310312
module.exports = {

scripts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ https://YOURUSERNAME.github.io/blockly-samples/.
2323

2424
This script is similar to `npm run deploy` but it deploys the plugins to
2525
`blockly-samples` upstream. You can browse these plugin playgrounds at:
26-
https://google.github.io/blockly-samples/.
26+
https://raspberrypifoundation.github.io/blockly-samples/.
2727

2828
### `npm run license`
2929

scripts/gh-predeploy.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ function injectFooter(initialContents) {
6969
<ul>
7070
<li><a target="_blank" href="https://developers.google.com/blockly/guides/overview/">Developer Docs</a></li>
7171
<li><a target="_blank" href="https://blocklycodelabs.dev/">Codelabs</a></li>
72-
<li><a target="_blank" href="https://google.github.io/blockly-samples/developer-tools/index.html">Developer
72+
<li><a target="_blank" href="https://raspberrypifoundation.github.io/blockly-samples/developer-tools/index.html">Developer
7373
Tools</a></li>
7474
</ul>
7575
</div>
7676
<div class="link-list">
7777
<label>Github</label>
7878
<ul>
79-
<li><a target="_blank" href="https://github.com/google/blockly/">Blockly Sources</a></li>
80-
<li><a target="_blank" href="https://github.com/google/blockly-samples/">Blockly Samples</a></li>
79+
<li><a target="_blank" href="https://github.com/raspberrypifoundation/blockly/">Blockly Sources</a></li>
80+
<li><a target="_blank" href="https://github.com/raspberrypifoundation/blockly-samples/">Blockly Samples</a></li>
8181
</ul>
8282
</div>
8383
<div class="link-list">
@@ -107,7 +107,7 @@ function injectFooter(initialContents) {
107107
* @returns {string} The modified contents of the page, as a string.
108108
*/
109109
function injectPluginNavBar(inputString, packageJson, pluginDir, isLocal) {
110-
const codeLink = `https://github.com/google/blockly-samples/blob/master/plugins/${pluginDir}`;
110+
const codeLink = `https://github.com/raspberrypifoundation/blockly-samples/blob/main/plugins/${pluginDir}`;
111111
const npmLink = `https://www.npmjs.com/package/${packageJson.name}`;
112112
const baseURL = isLocal ? '/' : '/blockly-samples/';
113113

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

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

0 commit comments

Comments
 (0)