Skip to content

Commit b02abbd

Browse files
Prepare to Publish Agent to NPM - NEWRELIC-7455 NEWRELIC-7476 (#434)
1 parent 754f68b commit b02abbd

File tree

194 files changed

+5057
-6082
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+5057
-6082
lines changed

.eslintrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
module.exports = {
22
ignorePatterns: [
33
'dist/**/*',
4+
'temp/**/*',
45
'build/**/*',
56
'coverage/**/*',
7+
'node_modules/**/*',
68
'tests/assets/frameworks/**/*',
79
'tests/assets/js/internal/**/*',
810
'tests/assets/js/vendor/**/*',
11+
'tests/assets/test-builds/**/*',
912
'tests/assets/modular/js-errors/js/vendor/**/*',
10-
'tools/test-builds/**/*',
1113

1214
// Remove the below ignores once lint errors are fixed
1315
'tools/scripts/publish-current.js',

.github/workflows/publish-dev.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
- uses: actions/checkout@v3
1818
- name: install
1919
run: npm ci
20+
- name: sync versions
21+
run: npm run sync:version
2022
- name: build
2123
run: npm run cdn:build:dev
2224
- name: upload artifacts to S3
Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
1-
name: Publish NPM Packages (Latest)
1+
name: Publish to NPM
22

33
on:
44
workflow_dispatch:
5-
inputs:
6-
release_type:
7-
description: 'Type of release. patch or minor (major if breaking)'
8-
required: true
9-
type: choice
10-
options:
11-
- patch
12-
- minor
13-
- major
145

156
jobs:
16-
publish-all-packages:
7+
publish-npm:
178
runs-on: ubuntu-latest
189

1910
env:
@@ -22,7 +13,6 @@ jobs:
2213
NPM_TOKEN: ${{ secrets.BROWSER_NPM_TOKEN }}
2314
NODE_AUTH_TOKEN: ${{ secrets.BROWSER_NPM_TOKEN }}
2415

25-
2616
steps:
2717
- uses: actions/checkout@v3
2818
with:
@@ -38,21 +28,9 @@ jobs:
3828
- name: install
3929
run: npm ci
4030

41-
- name: version
42-
run: node tools/scripts/version.mjs ${{ github.event.inputs.release_type }} --no-git-tag-version --force
43-
44-
# - name: build
45-
# run: npx nx run-many --target=build
46-
47-
- name: tag
48-
run: |
49-
export PACKAGE_VERSION=$(node -e "(function () { console.log(require('./packages/browser-agent/package.json').version) })()")
50-
git add packages/**/package.json
51-
git commit -a -m "Pre-Release Versioning"
52-
git tag -a ${PACKAGE_VERSION}
53-
git push
54-
git push origin refs/tags/${PACKAGE_VERSION}
31+
- name: sync versions
32+
run: npm run sync:version
5533

5634
- name: publish
5735
run: |
58-
node tools/scripts/publish.mjs latest
36+
npm publish

.github/workflows/publish-release.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,29 @@ jobs:
182182
- name: check files exist
183183
run: |
184184
node tools/scripts/check-version.js \
185-
-e yes
185+
-e yes
186+
publish-npm:
187+
runs-on: ubuntu-latest
188+
needs: [publish-to-nrdb]
189+
env:
190+
GH_TOKEN: ${{ secrets.PAT_GITHUB }}
191+
GITHUB_TOKEN: ${{ secrets.PAT_GITHUB }}
192+
NPM_TOKEN: ${{ secrets.BROWSER_NPM_TOKEN }}
193+
NODE_AUTH_TOKEN: ${{ secrets.BROWSER_NPM_TOKEN }}
194+
steps:
195+
- uses: actions/checkout@v3
196+
with:
197+
token: ${{ secrets.PAT_GITHUB }}
198+
- name: login
199+
run: |
200+
git config user.name "${{ github.actor }}"
201+
git config user.email "${{ github.actor }}@users.noreply.github.com"
202+
git remote set-url origin https://${{github.actor}}:${GH_TOKEN}@github.com/$GITHUB_REPOSITORY
203+
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
204+
- name: install
205+
run: npm ci
206+
- name: force versions to sync
207+
run: npm run sync:version
208+
- name: publish
209+
run: |
210+
npm publish

.github/workflows/raise-release-notes-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
- name: Build and raise PR to docs-website
2121
run: |
2222
node tools/scripts/docs-website/create-docs-pr.js \
23-
-t=v${{steps.build_versions.outputs.CDN_VERSION}}
23+
-t=v${{steps.build_versions.outputs.CDN_VERSION}}

0 commit comments

Comments
 (0)