Skip to content

Commit

Permalink
use outputs to get core pkg version (#37875)
Browse files Browse the repository at this point in the history
  • Loading branch information
kvchari committed Mar 15, 2022
1 parent e00d963 commit 419d49d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/publish-npm-packages.yml
Expand Up @@ -53,6 +53,8 @@ jobs:
environment: bento_publishing
needs: setup
runs-on: ubuntu-latest
outputs:
core-version: ${{ steps.build-core.outputs.core-version }}
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -67,12 +69,14 @@ jobs:
wget -q "${{ env.SCRIPTS_REPO }}/${{ env.SCRIPTS_DIR }}/get-core-version.js" -O ${{ env.SCRIPTS_DIR }}/get-core-version.js
wget -q "${{ env.SCRIPTS_REPO }}/${{ env.SCRIPTS_DIR }}/build-npm-binaries.js" -O ${{ env.SCRIPTS_DIR }}/build-npm-binaries.js
- name: Build package
id: build-core
run: |
npm ci
node ${{ env.SCRIPTS_DIR }}/build-npm-binaries.js
CORE_VERSION=$(node ${{ env.SCRIPTS_DIR }}/get-core-version.js ${{ github.event.inputs.amp-version }})
cd ./src/bento/core
npm version $CORE_VERSION --git-tag-version=false --allow-same-version=true
echo "::set-output name=core-version::${CORE_VERSION}"
- name: Publish package for Nightly releases
if: github.event.inputs.tag != 'latest'
run: |
Expand Down Expand Up @@ -118,7 +122,7 @@ jobs:
run: |
npm ci
node ${{ env.SCRIPTS_DIR }}/build-npm-binaries.js ${{ matrix.extension }}
node ${{ env.SCRIPTS_DIR }}/write-package-files.js ${{ matrix.extension }} ${{ github.event.inputs.amp-version }} ${{ matrix.version }}
node ${{ env.SCRIPTS_DIR }}/write-package-files.js ${{ matrix.extension }} ${{ github.event.inputs.amp-version }} ${{ matrix.version }} ${{ needs.publish-core.outputs.core-version }}
- name: Publish package for Nightly releases
if: github.event.inputs.tag != 'latest'
run: |
Expand Down
8 changes: 3 additions & 5 deletions build-system/npm-publish/write-package-files.js
Expand Up @@ -3,7 +3,8 @@
* Creates npm package files for a given component and AMP version.
*/

const [extension, ampVersion, extensionVersion] = process.argv.slice(2);
const [extension, ampVersion, extensionVersion, corePkgVersion] =
process.argv.slice(2);
const fastGlob = require('fast-glob');
const marked = require('marked');
const path = require('path');
Expand All @@ -14,10 +15,7 @@ const {getPackageDir, getSemver} = require('./utils');
const {log} = require('../common/logging');
const {stat, writeFile} = require('fs/promises');
const {valid} = require('semver');
const {
name: corePkgName,
version: corePkgVersion,
} = require('../../src/bento/core/package.json');
const {name: corePkgName} = require('../../src/bento/core/package.json');

const packageName = getNameWithoutComponentPrefix(extension);

Expand Down

0 comments on commit 419d49d

Please sign in to comment.