Move Node.js package.json to platform/node (#2343)

Co-authored-by: Andrew Calcutt <acalcutt@techidiots.net>
This commit is contained in:
Bart Louwers
2024-07-10 16:15:26 +02:00
committed by GitHub
parent a34817c4a7
commit 41ff7c3b0d
14 changed files with 137 additions and 456 deletions

View File

@@ -150,13 +150,13 @@ jobs:
- name: Upload benchmark results to S3
if: always() && env.run_device_test == 'true' && matrix.test.name == 'Android Benchmark'
run: |
npm install --ignore-scripts
npm install
node scripts/aws-device-farm/download-benchmark-results.mjs ${{ steps.aws_device_farm_run.outputs.runArn }}
- name: Log Test Spec Output
if: failure() && env.run_device_test == 'true'
run: |
npm install --ignore-scripts
npm install
node scripts/aws-device-farm/log-test-spec-output.mjs ${{ steps.aws_device_farm_run.outputs.runArn }}
- name: Generate another token (previous one could have expired)

View File

@@ -203,7 +203,7 @@ jobs:
- name: Start server
run: |
npm install --ignore-scripts
npm install
node test/storage/server.js &
- name: Generate coverage report

View File

@@ -43,7 +43,7 @@ jobs:
${{ runner.os }}-
- name: npm install
run: npm install --ignore-scripts
run: npm install
- name: Prepare ccache
run: ccache --clear

View File

@@ -272,16 +272,19 @@ jobs:
path: metrics/macos-xcode11-release-style.html
- name: Test (Linux)
working-directory: platform/node
if: runner.os == 'Linux'
run: xvfb-run --auto-servernum npm test
- name: Test (MacOS)
if: runner.os == 'MacOS'
working-directory: platform/node
run: npm test
- name: Test (Windows)
if: runner.os == 'Windows'
shell: pwsh
working-directory: platform/node
env:
LIBGL_ALWAYS_SOFTWARE: true
GALLIUM_DRIVER: softpipe
@@ -292,5 +295,6 @@ jobs:
# On PRs make sure that the npm package can be packaged.
- name: Pack
working-directory: platform/node
run: |
npm pack --dry-run
npm pack --dry-run

View File

@@ -24,6 +24,7 @@ jobs:
- name: Check if version is published
id: check
working-directory: platform/node
run: |
currentVersion="$( node -e "console.log(require('./package.json').version)" )"
isPublished="$( npm view @maplibre/maplibre-gl-native versions --json | jq -c --arg cv "$currentVersion" 'any(. == $cv)' )"
@@ -231,21 +232,23 @@ jobs:
- name: Publish X64 Release to Github
if: matrix.arch == 'x86_64'
working-directory: platform/node
env:
PUBLISH: true
BUILDTYPE: RelWithDebInfo
NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./platform/node/scripts/publish.sh
./scripts/publish.sh
- name: Publish ARM Release to Github
if: matrix.arch == 'arm64'
working-directory: platform/node
env:
PUBLISH: true
BUILDTYPE: RelWithDebInfo
NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./platform/node/scripts/publish.sh --target_arch=arm64
./scripts/publish.sh --target_arch=arm64
publish_npm:
runs-on: ubuntu-latest
@@ -269,12 +272,16 @@ jobs:
- name: Get version
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1
with:
path: platform/node
- name: npm ci
working-directory: platform/node
run: npm ci --ignore-scripts
- name: Prepare release
id: prepare_release
working-directory: platform/node
run: |
RELEASE_TYPE="$(node -e "console.log(require('semver').prerelease('${{ steps.package-version.outputs.current-version }}') ? 'prerelease' : 'regular')")"
if [[ $RELEASE_TYPE == 'regular' ]]; then
@@ -284,8 +291,9 @@ jobs:
fi
- name: Extract changelog for version
working-directory: platform/node
run: |
awk '/^##/ { p = 0 }; p == 1 { print }; $0 == "## ${{ steps.package-version.outputs.current-version }}" { p = 1 };' platform/node/CHANGELOG.md > changelog_for_version.md
awk '/^##/ { p = 0 }; p == 1 { print }; $0 == "## ${{ steps.package-version.outputs.current-version }}" { p = 1 };' CHANGELOG.md > changelog_for_version.md
cat changelog_for_version.md
- name: Update Release Notes
@@ -296,13 +304,14 @@ jobs:
with:
tag: node-v${{ steps.package-version.outputs.current-version }}
name: node-v${{ steps.package-version.outputs.current-version }}
bodyFile: changelog_for_version.md
bodyFile: platform/node/changelog_for_version.md
allowUpdates: true
draft: false
prerelease: ${{ steps.prepare_release.outputs.prerelease }}
- name: Publish to NPM (release)
if: ${{ steps.prepare_release.outputs.prerelease == 'false' }}
working-directory: platform/node
run: |
npm config set //registry.npmjs.org/:_authToken "${NPM_TOKEN}"
npm publish --access public
@@ -311,6 +320,7 @@ jobs:
- name: Publish to NPM (prerelease)
if: ${{ steps.prepare_release.outputs.prerelease == 'true' }}
working-directory: platform/node
run: |
npm config set //registry.npmjs.org/:_authToken "${NPM_TOKEN}"
npm publish --tag next --access public

View File

@@ -12,5 +12,5 @@ jobs:
- uses: actions/checkout@v4
- run: |
npm install --ignore-scripts
npm install
npx tsc -p scripts/jsconfig.json