Skip to content

Commit

Permalink
Let Github Actions build npm binaries (#33877)
Browse files Browse the repository at this point in the history
  • Loading branch information
estherkim committed Apr 19, 2021
1 parent 7f7ca15 commit 89f94e7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
28 changes: 28 additions & 0 deletions build-system/pr-check/build-npm-binaries.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* Copyright 2021 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* @fileoverview
* Builds npm binaries for specified Bento components.
*/

const [extension] = process.argv.slice(2);
const {timedExecOrDie} = require('./utils');
const {updatePackages} = require('../common/update-packages');

updatePackages();
timedExecOrDie(`amp build --extensions=${extension} --core_runtime_only`);
timedExecOrDie(`amp dist --extensions=${extension} --core_runtime_only`);
4 changes: 2 additions & 2 deletions build-system/tasks/extension-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ async function buildExtension(
await doBuildJs(jsBundles, 'ww.max.js', options);
}
if (options.npm) {
await buildNpmBinaires(extDir, options);
await buildNpmBinaries(extDir, options);
}
if (options.binaries) {
await buildBinaries(extDir, options.binaries, options);
Expand Down Expand Up @@ -564,7 +564,7 @@ function buildExtensionCss(extDir, name, version, options) {
* @param {!Object} options
* @return {!Promise}
*/
function buildNpmBinaires(extDir, options) {
function buildNpmBinaries(extDir, options) {
const {npm} = options;
const keys = Object.keys(npm);
const promises = keys.flatMap((entryPoint) => {
Expand Down

0 comments on commit 89f94e7

Please sign in to comment.