Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get corePkgVersion from github workflow job output instead of package.json #37875

Merged
merged 1 commit into from
Mar 15, 2022
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
6 changes: 5 additions & 1 deletion .github/workflows/publish-npm-packages.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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