diff --git a/.github/workflows/node.js.yaml b/.github/workflows/node.js.yaml index 2d67a2e..f8e2a3a 100644 --- a/.github/workflows/node.js.yaml +++ b/.github/workflows/node.js.yaml @@ -14,7 +14,7 @@ jobs: strategy: matrix: - node-version: [18.x] + node-version: [20.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: diff --git a/.github/workflows/publish-package-to-npmjs.yml b/.github/workflows/publish-package-to-npmjs.yml index bce8434..a84308f 100644 --- a/.github/workflows/publish-package-to-npmjs.yml +++ b/.github/workflows/publish-package-to-npmjs.yml @@ -26,6 +26,11 @@ on: description: Publish package to CDN (In general, always release to both) required: false default: true + release_latest_version: + type: number + description: Release a latest major version (*-[majorVersion]-latest.js) + required: false + default: false jobs: incrementVersionNumber: uses: IABTechLab/uid2-shared-actions/.github/workflows/shared-increase-version-number.yaml@v2 @@ -37,7 +42,7 @@ jobs: needs: [incrementVersionNumber] strategy: matrix: - node-version: [18.x] + node-version: [20.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ target: [development, production] steps: @@ -56,16 +61,26 @@ jobs: run: npm install - name: Build script run: npm run build -- --mode=${{ matrix.target }} + # - uses: actions/upload-artifact@v4 + # if: inputs.publish_to_cdn + # with: + # name: uid2SDK-${{ matrix.target }}-${{ steps.version.outputs.package_version }} + # path: ./dist/uid2-sdk-${{ steps.version.outputs.package_version }}.js - uses: actions/upload-artifact@v4 - if: inputs.publish_to_cdn + if: inputs.release_latest_version with: - name: uid2SDK-${{ matrix.target }}-${{ steps.version.outputs.package_version }} - path: ./dist/uid2-sdk-${{ steps.version.outputs.package_version }}.js + name: uid2SDK-${{ matrix.target }}-v${{inputs.release_latest_version}}-latest + path: ./dist/uid2-sdk-latest.js + # - uses: actions/upload-artifact@v4 + # if: inputs.publish_to_cdn + # with: + # name: euidSDK-${{ matrix.target }}-${{ steps.version.outputs.package_version }} + # path: ./dist/euid-sdk-${{ steps.version.outputs.package_version }}.js - uses: actions/upload-artifact@v4 - if: inputs.publish_to_cdn + if: inputs.release_latest_version with: - name: euidSDK-${{ matrix.target }}-${{ steps.version.outputs.package_version }} - path: ./dist/euid-sdk-${{ steps.version.outputs.package_version }}.js + name: euidSDK-${{ matrix.target }}-v${{inputs.release_latest_version}}-latest + path: ./dist/euid-sdk-latest.js outputs: sdkVersion: ${{ steps.version.outputs.package_version }} publish-package: @@ -78,7 +93,7 @@ jobs: ref: ${{ needs.incrementVersionNumber.outputs.git_tag_or_hash }} - uses: actions/setup-node@v4 with: - node-version: '18.x' + node-version: '20.x' registry-url: 'https://registry.npmjs.org' scope: uid2 - run: npm ci @@ -112,11 +127,20 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ needs.incrementVersionNumber.outputs.git_tag_or_hash }} + # - uses: ./.github/actions/cdn_deployment_aws + # with: + # environment: ${{ matrix.environment }} + # artifact: uid2SDK-${{ (matrix.environment == 'integ' && 'development') || matrix.environment }}-${{ needs.build.outputs.sdkVersion}} + # invalidate_paths: '/uid2-sdk-${{ needs.build.outputs.sdkVersion}}.js' + # aws_account_id: ${{ vars.AWS_ACCOUNT_ID }} + # aws_bucket_name: ${{ vars.S3_BUCKET }} + # aws_distribution_id: ${{ secrets.AWS_DISTRIBUTION_ID }} - uses: ./.github/actions/cdn_deployment_aws + if: inputs.release_latest_version with: environment: ${{ matrix.environment }} - artifact: uid2SDK-${{ (matrix.environment == 'integ' && 'development') || matrix.environment }}-${{ needs.build.outputs.sdkVersion}} - invalidate_paths: '/uid2-sdk-${{ needs.build.outputs.sdkVersion}}.js' + artifact: uid2SDK-${{ (matrix.environment == 'integ' && 'development') || matrix.environment }}-v${{inputs.release_latest_version}}-latest + invalidate_paths: '/uid2-sdk-v${{inputs.release_latest_version}}-latest.js' aws_account_id: ${{ vars.AWS_ACCOUNT_ID }} aws_bucket_name: ${{ vars.S3_BUCKET }} aws_distribution_id: ${{ secrets.AWS_DISTRIBUTION_ID }} @@ -134,11 +158,20 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ needs.incrementVersionNumber.outputs.git_tag_or_hash }} + # - uses: ./.github/actions/cdn_deployment_aws + # with: + # environment: ${{ matrix.environment }} + # artifact: euidSDK-${{ (matrix.environment == 'integ' && 'development') || matrix.environment }}-${{ needs.build.outputs.sdkVersion}} + # invalidate_paths: '/euid-sdk-${{ needs.build.outputs.sdkVersion}}.js' + # aws_account_id: ${{ vars.EUID_AWS_ACCOUNT_ID }} + # aws_bucket_name: ${{ vars.EUID_S3_BUCKET }} + # aws_distribution_id: ${{ secrets.EUID_AWS_DISTRIBUTION_ID }} - uses: ./.github/actions/cdn_deployment_aws + if: inputs.release_latest_version with: environment: ${{ matrix.environment }} - artifact: euidSDK-${{ (matrix.environment == 'integ' && 'development') || matrix.environment }}-${{ needs.build.outputs.sdkVersion}} - invalidate_paths: '/euid-sdk-${{ needs.build.outputs.sdkVersion}}.js' + artifact: euidSDK-${{ (matrix.environment == 'integ' && 'development') || matrix.environment }}-v${{inputs.release_latest_version}}-latest + invalidate_paths: '/euid-sdk-v${{inputs.release_latest_version}}-latest.js' aws_account_id: ${{ vars.EUID_AWS_ACCOUNT_ID }} aws_bucket_name: ${{ vars.EUID_S3_BUCKET }} aws_distribution_id: ${{ secrets.EUID_AWS_DISTRIBUTION_ID }} diff --git a/.github/workflows/secureSignal-cd.yaml b/.github/workflows/secureSignal-cd.yaml index b7c2c6d..50fa691 100644 --- a/.github/workflows/secureSignal-cd.yaml +++ b/.github/workflows/secureSignal-cd.yaml @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [18.x] + node-version: [20.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ target: [development, production] diff --git a/package-lock.json b/package-lock.json index bdd8eec..5cd1042 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@uid2/uid2-sdk", - "version": "3.10.0", + "version": "3.10.19-SNAPSHOT", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@uid2/uid2-sdk", - "version": "3.10.0", + "version": "3.10.19-SNAPSHOT", "license": "Apache 2.0", "dependencies": { "axios": "^1.7.9", @@ -47,7 +47,7 @@ "webpack-dev-server": "^5.1.0" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/@ampproject/remapping": { diff --git a/package.json b/package.json index bcc1b02..8f5f73d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@uid2/uid2-sdk", - "version": "3.10.0", + "version": "3.10.19-SNAPSHOT", "description": "UID2 Client SDK", "author": "The Trade Desk", "repository": { @@ -27,7 +27,7 @@ "localtest": "cd localtest && tsx server.ts" }, "engines": { - "node": ">=18" + "node": ">=20" }, "jest": { "preset": "ts-jest", diff --git a/webpack.config.js b/webpack.config.js index fe4d0eb..7577c62 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -31,10 +31,18 @@ module.exports = (env, argv) => { import: uid2Entrypoint, filename: `uid2-sdk-${process.env.npm_package_version}.js`, }, + 'uid2-sdk-latest': { + import: uid2Entrypoint, + filename: `uid2-sdk-latest.js`, + }, 'euid-sdk': { import: euidEntrypoint, filename: `euid-sdk-${process.env.npm_package_version}.js`, }, + 'euid-sdk-latest': { + import: euidEntrypoint, + filename: `euid-sdk-latest.js`, + }, ...getExampleOutputs(env), } : espOutput,